Update app.py
Browse files32 unmodified lines33343536373839404142434445464748497 unmodified lines5758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410532 unmodified lines except Exception as e: return f"Error fetching time for timezone '{timezone}': {str(e)}"
@tooldef calculator_tool(a: int, b: int) -> int: """ Multiply two integers. Args: a: An integer b: An integer Output: An integer """ return a * b
final_answer = FinalAnswerTool()
7 unmodified linescustom_role_conversions=None,)
system_message="""Answer the following questions as best you can. You have access to the following tools:{tools_description}
The way you use the tools is by specifying a json blob.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).
The only values that should be in the "action" field are:get_current_time_in_timezone: A tool that fetches the current local time in a specified timezone., args: {"timezone": {"type": "string"}}calculator_tool: A tool that multiply 2 integers., args: {"a": {"type": "int"}, "b": {"type": "int"}}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: {}image_generation_tool: This tool creates an image according to a prompt, which is a text description. args: {}
example use :```{{ "action": "get_current_time_in_timezone", "action_input": {"timezone": "America/New_York"}}}
ALWAYS use the following format:
Question: the input question you must answerThought: you should always think about one action to take. Only one action at a time in this format:Action:```$JSON_BLOB```Observation: the result of the action. This Observation is unique, complete, and the source of truth.... (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.)
You must always end your output with the following format:
Thought: I now know the final answerFinal Answer: the final answer to the original input question
Now begin! Reminder to ALWAYS use the exact characters `Final Answer:` when you provide a definitive answer. """
# Import tool from Hubimage_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)web_search_tool = DuckDuckGoSearchTool()
with open("prompts.yaml", 'r') as stream: prompt_templates = yaml.safe_load(stream)app.py+51