chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
from openai.types.shared.reasoning import Reasoning
|
||||
from pydantic import BaseModel
|
||||
|
||||
from agents import Agent, ModelSettings
|
||||
|
||||
PROMPT = (
|
||||
"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 between 5 and 20 terms to query for."
|
||||
)
|
||||
|
||||
|
||||
class WebSearchItem(BaseModel):
|
||||
reason: str
|
||||
"Your reasoning for why this search is important to the 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="PlannerAgent",
|
||||
instructions=PROMPT,
|
||||
model="gpt-5.6-sol",
|
||||
model_settings=ModelSettings(reasoning=Reasoning(effort="medium")),
|
||||
output_type=WebSearchPlan,
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
from agents import Agent, WebSearchTool
|
||||
|
||||
INSTRUCTIONS = (
|
||||
"You are a research assistant. Given a search term, you search the web for that term and "
|
||||
"produce a concise summary of the results. The summary must be 2-3 paragraphs and less than 300 "
|
||||
"words. Capture the main points. Write succinctly, no need to have complete sentences or good "
|
||||
"grammar. This will be consumed by someone synthesizing a report, so its vital you capture the "
|
||||
"essence and ignore any fluff. Do not include any additional commentary other than the summary "
|
||||
"itself."
|
||||
)
|
||||
|
||||
search_agent = Agent(
|
||||
name="Search agent",
|
||||
model="gpt-5.6-sol",
|
||||
instructions=INSTRUCTIONS,
|
||||
tools=[WebSearchTool()],
|
||||
)
|
||||
@@ -0,0 +1,35 @@
|
||||
# Agent used to synthesize a final report from the individual summaries.
|
||||
from openai.types.shared.reasoning import Reasoning
|
||||
from pydantic import BaseModel
|
||||
|
||||
from agents import Agent, ModelSettings
|
||||
|
||||
PROMPT = (
|
||||
"You are a senior researcher tasked with writing a cohesive report for a research query. "
|
||||
"You will be provided with the original query, and some initial research done by a research "
|
||||
"assistant.\n"
|
||||
"You should first come up with an outline for the report that describes the structure and "
|
||||
"flow of the report. Then, generate the report and return that as your final output.\n"
|
||||
"The final output should be in markdown format, and it should be lengthy and detailed. Aim "
|
||||
"for 5-10 pages of content, at least 1000 words."
|
||||
)
|
||||
|
||||
|
||||
class ReportData(BaseModel):
|
||||
short_summary: str
|
||||
"""A short 2-3 sentence summary of the findings."""
|
||||
|
||||
markdown_report: str
|
||||
"""The final report"""
|
||||
|
||||
follow_up_questions: list[str]
|
||||
"""Suggested topics to research further"""
|
||||
|
||||
|
||||
writer_agent = Agent(
|
||||
name="WriterAgent",
|
||||
instructions=PROMPT,
|
||||
model="gpt-5-mini",
|
||||
model_settings=ModelSettings(reasoning=Reasoning(effort="medium")),
|
||||
output_type=ReportData,
|
||||
)
|
||||
Reference in New Issue
Block a user