Spaces:
Sleeping
Sleeping
File size: 614 Bytes
89bcc88 6377a34 89bcc88 6377a34 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
import logfire
from deep_research_agent.nodes import (
BeginResearch,
FinalReport,
Researcher,
Supervisor,
WriteResearchBrief,
)
from deep_research_agent.state import ResearchState
from pydantic_graph import Graph
logfire.configure()
logfire.instrument_pydantic_ai()
async def query_agent(research_query: str):
state = ResearchState()
graph = Graph(
nodes=(BeginResearch, WriteResearchBrief, Supervisor, Researcher, FinalReport)
)
result = await graph.run(
start_node=BeginResearch(query=research_query),
state=state,
)
return result.output
|