Spaces:
Sleeping
Sleeping
Download deep_research1.py from lemosryan007/deep_research: direct link, hf CLI and curl.
- Browser
- Download file 1.06 kB
-
https://huggingface.co/spaces/lemosryan007/deep_research/resolve/main/deep_research1.py
- Command line
-
hf download hf://spaces/lemosryan007/deep_research/deep_research1.py
-
curl -L -o deep_research1.py https://huggingface.co/spaces/lemosryan007/deep_research/resolve/main/deep_research1.py
1.06 kB
| import gradio as gr | |
| from dotenv import load_dotenv | |
| from research1_manager import ResearchManager | |
| load_dotenv(override=True) | |
| # Async generator for streaming output from ResearchManager | |
| async def run(query: str): | |
| try: | |
| async for chunk in ResearchManager().run(query): | |
| yield chunk | |
| except Exception as e: | |
| yield f"**Error:** {e!s}" | |
| with gr.Blocks(theme=gr.themes.Default(primary_hue="sky")) as ui: | |
| gr.Markdown("# 🔎 Deep Research (Display Only — No Email)") | |
| query_textbox = gr.Textbox( | |
| label="What topic would you like to research?", | |
| placeholder="e.g. Impact of AI on global logistics", | |
| lines=2, | |
| ) | |
| run_button = gr.Button("Run Research", variant="primary") | |
| report = gr.Markdown("") | |
| # Bind both click and Enter key events | |
| run_button.click(fn=run, inputs=query_textbox, outputs=report) | |
| query_textbox.submit(fn=run, inputs=query_textbox, outputs=report) | |
| # New API: just call queue() with no args | |
| if __name__ == "__main__": | |
| ui.queue().launch(inbrowser=True) | |