Update app.py
Browse files
app.py
CHANGED
|
@@ -57,49 +57,11 @@ model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may
|
|
| 57 |
custom_role_conversions=None,
|
| 58 |
)
|
| 59 |
|
| 60 |
-
system_message="""Answer the following questions as best you can. You have access to the following tools:
|
| 61 |
-
{tools_description}
|
| 62 |
-
|
| 63 |
-
The way you use the tools is by specifying a json blob.
|
| 64 |
-
Specifically, this json should have a `action` key (with the name of the tool to use) and a `action_input` key (with the input to the tool going here).
|
| 65 |
-
|
| 66 |
-
The only values that should be in the "action" field are:
|
| 67 |
-
get_current_time_in_timezone: A tool that fetches the current local time in a specified timezone., args: {"timezone": {"type": "string"}}
|
| 68 |
-
calculator_tool: A tool that multiply 2 integers., args: {"a": {"type": "int"}, "b": {"type": "int"}}
|
| 69 |
-
web_search_tool: Performs a duckduckgo web search based on your query (think a Google search) then returns the top search results., args: {"max_results": {type": "int"}, "query": {type": "str"}}, output: {}
|
| 70 |
-
image_generation_tool: This tool creates an image according to a prompt, which is a text description. args: {}
|
| 71 |
-
|
| 72 |
-
example use :
|
| 73 |
-
```
|
| 74 |
-
{{
|
| 75 |
-
"action": "get_current_time_in_timezone",
|
| 76 |
-
"action_input": {"timezone": "America/New_York"}
|
| 77 |
-
}}
|
| 78 |
-
|
| 79 |
-
ALWAYS use the following format:
|
| 80 |
-
|
| 81 |
-
Question: the input question you must answer
|
| 82 |
-
Thought: you should always think about one action to take. Only one action at a time in this format:
|
| 83 |
-
Action:
|
| 84 |
-
```
|
| 85 |
-
$JSON_BLOB
|
| 86 |
-
```
|
| 87 |
-
Observation: the result of the action. This Observation is unique, complete, and the source of truth.
|
| 88 |
-
... (this Thought/Action/Observation can repeat N times, you should take several steps when needed. The $JSON_BLOB must be formatted as markdown and only use a SINGLE action at a time.)
|
| 89 |
-
|
| 90 |
-
You must always end your output with the following format:
|
| 91 |
-
|
| 92 |
-
Thought: I now know the final answer
|
| 93 |
-
Final Answer: the final answer to the original input question
|
| 94 |
-
|
| 95 |
-
Now begin! Reminder to ALWAYS use the exact characters `Final Answer:` when you provide a definitive answer.
|
| 96 |
-
"""
|
| 97 |
-
|
| 98 |
|
| 99 |
|
| 100 |
# Import tool from Hub
|
| 101 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 102 |
-
|
| 103 |
|
| 104 |
with open("prompts.yaml", 'r') as stream:
|
| 105 |
prompt_templates = yaml.safe_load(stream)
|
|
|
|
| 57 |
custom_role_conversions=None,
|
| 58 |
)
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
|
| 62 |
# Import tool from Hub
|
| 63 |
image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
|
| 64 |
+
search_tool = DuckDuckGoSearchTool()
|
| 65 |
|
| 66 |
with open("prompts.yaml", 'r') as stream:
|
| 67 |
prompt_templates = yaml.safe_load(stream)
|