File size: 1,850 Bytes
4f87fc6
d68986e
1bcef24
2e527e0
 
 
1bcef24
65822ef
1bcef24
2e527e0
 
 
 
c42da51
 
2e527e0
 
d68986e
 
 
 
 
 
 
1bcef24
4f87fc6
d68986e
1bcef24
4f87fc6
 
 
 
 
 
 
 
 
 
 
65822ef
d68986e
 
 
1bcef24
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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: "<task_id>: <question>", 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
)