from textwrap import dedent from agno.agent import Agent from agno.models.openai import OpenAIChat from agno.models.xai import xAI from agno.models.google import Gemini from agno.models.openrouter import OpenRouter from tools import tools model = { "grok": xAI(id="grok-3-beta"), "gpt": OpenAIChat(id="gpt-4.1-nano"), "gemini": Gemini(id="gemini-2.5-pro-preview-03-25"), # "open_router": OpenRouter(id="qwen/qwen3-235b-a22b") "open_router": OpenRouter(id="google/gemini-2.5-pro-exp-03-25") } def get_current_date() -> str: import datetime date = datetime.datetime.now().strftime("%Y-%m-%d") return "The current date is " + date agent = Agent( model=model["grok"], markdown=False, debug_mode=True, instructions=dedent( """ You are a general AI assistant. I will ask you a question. Report your thoughts, but your final answer must be only the answer itself, with nothing else. The answer should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string. The questions come in the following format: ": ", you can use the task_id to retrieve attached files related to the question (only if available). """), tools=tools, context={"current_time": get_current_date}, add_context=True, show_tool_calls=True )