Schweig's picture
swap model
bc3940e
Raw History Blame Contribute Delete
793 Bytes
from smolagents import CodeAgent, WebSearchTool, LiteLLMModel
class BasicAgent:
def __init__(self):
print("BasicAgent initialized.")
def __call__(self, question: str) -> str:
print(f"Agent received question (first 50 chars): {question[:50]}...")
fixed_answer = "This is a default answer."
print(f"Agent returning fixed answer: {fixed_answer}")
return fixed_answer
class GAIAAgent(BasicAgent):
def __init__(self):
model = LiteLLMModel(model_id="openrouter/meta-llama/llama-3-8b-instruct:free", requests_per_minute=60)
self.agent = CodeAgent(tools=[WebSearchTool()],model=model,planning_interval=3)
print("GAIA Agent Initialized")
def __call__(self, question):
return self.agent.run(question)