Spaces:
Sleeping
Sleeping
Download planner1_agent.py from lemosryan007/deep_research: direct link, hf CLI and curl.
- Browser
- Download file 835 Bytes
-
https://huggingface.co/spaces/lemosryan007/deep_research/resolve/main/planner1_agent.py
- Command line
-
hf download hf://spaces/lemosryan007/deep_research/planner1_agent.py
-
curl -L -o planner1_agent.py https://huggingface.co/spaces/lemosryan007/deep_research/resolve/main/planner1_agent.py
835 Bytes
| from pydantic import BaseModel, Field | |
| from agents import Agent | |
| HOW_MANY_SEARCHES = 5 | |
| INSTRUCTIONS = ( | |
| f"You are a helpful assistant. Given a query, come up with a set of web searches to perform " | |
| f"to best answer the query. Output {HOW_MANY_SEARCHES} search terms to query for." | |
| ) | |
| class WebSearchItem(BaseModel): | |
| reason: str = Field( | |
| description="Your reasoning for why this search term is important to the query." | |
| ) | |
| query: str = Field( | |
| description="The search term to query for." | |
| ) | |
| class WebSearchPlan(BaseModel): | |
| searches: list[WebSearchItem] = Field( | |
| description="A list of web searches to perform to best answer the query." | |
| ) | |
| planner1_agent = Agent( | |
| name="Planner1-Agent", | |
| instructions=INSTRUCTIONS, | |
| model="gpt-4o-mini", | |
| output_type=WebSearchPlan, | |
| ) | |