Spaces:
Runtime error
Runtime error
Update prompts.py
Browse files- prompts.py +10 -3
prompts.py
CHANGED
@@ -11,13 +11,21 @@ METRICS_SYSTEM_PROMPT = "You are a precise JSON output agent. Output a single JS
|
|
11 |
TOOL_SYSTEM_PROMPT = """You are a precise routing agent. Your task is to select the most appropriate action to respond to a user's query and provide the required inputs as a single JSON object.
|
12 |
|
13 |
Available Actions and their inputs:
|
14 |
-
- "create_huggingface_space": Creates a new HF space. Requires: "owner", "space_name", "sdk",
|
15 |
-
- "
|
|
|
|
|
16 |
- "search_duckduckgo_and_report": Searches the web. Requires: "search_engine_query".
|
17 |
- "scrape_url_and_report": Scrapes a single URL. Requires: "url".
|
18 |
- "answer_using_conversation_memory": Answers from memory.
|
19 |
- "quick_respond": For simple conversation.
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
Example for creating a space:
|
22 |
{"action": "create_huggingface_space", "action_input": {"owner": "test-user", "space_name": "my-translator-app", "sdk": "gradio", "description": "a simple Gradio app that translates english text to french text"}}
|
23 |
|
@@ -65,7 +73,6 @@ Project Details:
|
|
65 |
Ensure the output is a single, complete, and functional project definition ready to be used.
|
66 |
"""
|
67 |
|
68 |
-
|
69 |
def get_metrics_user_prompt(user_input: str, bot_response: str) -> str:
|
70 |
return f"User: \"{user_input}\"\nAI: \"{bot_response}\"\nMetrics: \"takeaway\" (3-7 words), \"response_success_score\" (0.0-1.0), \"future_confidence_score\" (0.0-1.0). Output JSON ONLY."
|
71 |
|
|
|
11 |
TOOL_SYSTEM_PROMPT = """You are a precise routing agent. Your task is to select the most appropriate action to respond to a user's query and provide the required inputs as a single JSON object.
|
12 |
|
13 |
Available Actions and their inputs:
|
14 |
+
- "create_huggingface_space": Creates a new HF space. Requires: "owner", "space_name", "sdk", "description".
|
15 |
+
- "list_space_files": Lists all files in an existing HF space. Requires: "owner", "space_name".
|
16 |
+
- "get_space_file_content": Retrieves the content of a specific file in a space. Requires: "owner", "space_name", "file_path".
|
17 |
+
- "update_huggingface_space_file": Updates a file in an existing HF space. Requires: "owner", "space_name", "file_path", "new_content", "commit_message".
|
18 |
- "search_duckduckgo_and_report": Searches the web. Requires: "search_engine_query".
|
19 |
- "scrape_url_and_report": Scrapes a single URL. Requires: "url".
|
20 |
- "answer_using_conversation_memory": Answers from memory.
|
21 |
- "quick_respond": For simple conversation.
|
22 |
|
23 |
+
Example for listing files:
|
24 |
+
{"action": "list_space_files", "action_input": {"owner": "test-user", "space_name": "my-app"}}
|
25 |
+
|
26 |
+
Example for reading a file:
|
27 |
+
{"action": "get_space_file_content", "action_input": {"owner": "test-user", "space_name": "my-app", "file_path": "app.py"}}
|
28 |
+
|
29 |
Example for creating a space:
|
30 |
{"action": "create_huggingface_space", "action_input": {"owner": "test-user", "space_name": "my-translator-app", "sdk": "gradio", "description": "a simple Gradio app that translates english text to french text"}}
|
31 |
|
|
|
73 |
Ensure the output is a single, complete, and functional project definition ready to be used.
|
74 |
"""
|
75 |
|
|
|
76 |
def get_metrics_user_prompt(user_input: str, bot_response: str) -> str:
|
77 |
return f"User: \"{user_input}\"\nAI: \"{bot_response}\"\nMetrics: \"takeaway\" (3-7 words), \"response_success_score\" (0.0-1.0), \"future_confidence_score\" (0.0-1.0). Output JSON ONLY."
|
78 |
|