Spaces:
Runtime error
Runtime error
Download planner_agent.py from ksharma9719/Deep_Research: direct link, hf CLI and curl.
- Browser
- Download file 774 Bytes
-
https://huggingface.co/spaces/ksharma9719/Deep_Research/resolve/main/planner_agent.py
- Command line
-
hf download hf://spaces/ksharma9719/Deep_Research/planner_agent.py
-
curl -L -o planner_agent.py https://huggingface.co/spaces/ksharma9719/Deep_Research/resolve/main/planner_agent.py
774 Bytes
| from pydantic import BaseModel | |
| from agents import Agent | |
| 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 | |
| """Your reasoning for why this search is important for this query.""" | |
| query: str | |
| """The search term to use for the web search.""" | |
| class WebSearchPlan(BaseModel): | |
| searches: list[WebSearchItem] | |
| """A list of web searches to perform to best answer the query.""" | |
| planner_agent = Agent( | |
| name="Planner Agent", | |
| instructions=INSTRUCTIONS, | |
| model = 'gpt-4o-mini', | |
| output_type = WebSearchPlan | |
| ) |