Ivan Hernandez Gomez
basic agent with web search
9d8c4c7
raw
history blame contribute delete
612 Bytes
import os
from agents.base_agent import Agent
class STAgent(Agent):
"""Straightforward agent. Just calling the OPENAI API"""
def __init__(self):
self.api_key = os.getenv("OPENAI_API_KEY")
if self.api_key is None:
raise RuntimeError("OPENAI_API_KEY is not set")
print("STAgent (Straightforward Agent) 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}")