Deep_research_agent / planner_agent.py
Shekarss's picture
Upload 10 files
aa9134d verified
raw
history blame contribute delete
822 Bytes
from model import model
from agents import Agent
from pydantic import BaseModel, Field
HOW_MANY_SEARCHES = 3
INSTRUCTIONS = f"You are a helpful research assistant. Given a query, come up with a set of web searches \
to perform to best answer the query. Output {HOW_MANY_SEARCHES} terms to query for."
class WebSearchItem(BaseModel):
reason: str = Field(description="Your reasoning for why this search is important to the query.")
query: str = Field(description="The search term to use for the web search.")
class WebSearchPlan(BaseModel):
searches: list[WebSearchItem] = Field(description="A list of web searches to perform to best answer the query.")
planner_agent = Agent(
name='Planner Agent',
instructions=INSTRUCTIONS,
model=model,
output_type=WebSearchPlan
)