CoolFace
Apppublic

ruDra2916/KnowSphere

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
search_agent.py17 linesDownload Raw Back to root
1from agents import Agent, WebSearchTool, ModelSettings
2
3INSTRUCTIONS = (
4    "You are a research assistant. Given a search term, you search the web for that term and "
5    "produce a concise summary of the results. The summary must 2-3 paragraphs and less than 300 "
6    "words. Capture the main points. Write succintly, no need to have complete sentences or good "
7    "grammar. This will be consumed by someone synthesizing a report, so its vital you capture the "
8    "essence and ignore any fluff. Do not include any additional commentary other than the summary itself."
9)
10
11search_agent = Agent(
12    name="Search agent",
13    instructions=INSTRUCTIONS,
14    tools=[WebSearchTool(search_context_size="low")],
15    model="gpt-4o-mini",
16    model_settings=ModelSettings(tool_choice="required"),
17)