jmc310/deep_research
0
1import sys
2import os
3
4# Add the current directory to the Python path
5sys.path.append(os.path.dirname(os.path.abspath(__file__)))
6
7import gradio as gr
8from research_manager import ResearchManager
9
10async def run(query: str):
11 async for chunk in ResearchManager().run(query):
12 yield chunk
13
14with gr.Blocks(theme=gr.themes.Default(primary_hue="sky")) as ui:
15 gr.Markdown("# Deep Research")
16 query_textbox = gr.Textbox(label="What topic would you like to research?")
17 run_button = gr.Button("Run", variant="primary")
18 report = gr.Markdown(label="Report")
19
20 run_button.click(fn=run, inputs=query_textbox, outputs=report)
21 query_textbox.submit(fn=run, inputs=query_textbox, outputs=report)
22
23ui.launch() 