Files
patchy631--ai-engineering-hub/multiplatform_deep_researcher/research.py
T
2026-07-13 12:37:47 +08:00

14 lines
445 B
Python

from flow import DeepResearchFlow
from typing import Dict, Any
async def run_deep_research(prompt):
"""Run the deep research flow and return the result."""
try:
flow = DeepResearchFlow()
flow.state.query = prompt
payload: Dict[str, Any] = await flow.kickoff_async()
return str(payload.get("result", "No result returned"))
except Exception as e:
return f"An error occurred: {e}"