Connor Adams
Add logfire and duckduckgo
ef01a34
raw
history blame
669 Bytes
import logfire
from pydantic_ai import Agent
from tools.safe_duck import safe_duckduckgo_search_tool
logfire.configure()
logfire.instrument_pydantic_ai()
class BasicAgent:
def __init__(self):
self.agent = Agent(
"openai:o3-mini",
tools=[safe_duckduckgo_search_tool()],
system_prompt="Search DuckDuckGo for the given query and return the results.",
)
def __call__(self, question: str) -> str:
print(f"Agent received question (first 50 chars): {question[:50]}...")
result = self.agent.run_sync(question).output
print(f"Agent returning fixed answer: {result}")
return result