Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -47,14 +47,18 @@ def process_and_package(ai_response: str):
|
|
| 47 |
agent = LlamaCppAgent(
|
| 48 |
provider,
|
| 49 |
system_prompt=(
|
| 50 |
-
"You are a code
|
| 51 |
-
"
|
| 52 |
-
"
|
|
|
|
|
|
|
|
|
|
| 53 |
),
|
| 54 |
predefined_messages_formatter_type=MessagesFormatterType.GEMMA_2,
|
| 55 |
debug_output=True
|
| 56 |
)
|
| 57 |
|
|
|
|
| 58 |
# Call the agent
|
| 59 |
# Use get_chat_response (not run)
|
| 60 |
try:
|
|
|
|
| 47 |
agent = LlamaCppAgent(
|
| 48 |
provider,
|
| 49 |
system_prompt=(
|
| 50 |
+
"You are a code packager. The user will paste text that may contain multiple code blocks. "
|
| 51 |
+
"Extract all code blocks, associate each with a filename if available, and return a JSON object "
|
| 52 |
+
"where keys are filenames and values are the full content. "
|
| 53 |
+
"ONLY return a raw JSON object — no explanations, no markdown, no text outside the JSON. "
|
| 54 |
+
"Example:\n\n"
|
| 55 |
+
"{\n \"app.py\": \"import gradio as gr\\n...\",\n \"utils.py\": \"def helper():\\n...\"\n}\n"
|
| 56 |
),
|
| 57 |
predefined_messages_formatter_type=MessagesFormatterType.GEMMA_2,
|
| 58 |
debug_output=True
|
| 59 |
)
|
| 60 |
|
| 61 |
+
|
| 62 |
# Call the agent
|
| 63 |
# Use get_chat_response (not run)
|
| 64 |
try:
|