fareezaiahmed commited on
Commit
ff95c5e
·
verified ·
1 Parent(s): a72a567

Upload folder using huggingface_hub

Browse files
__pycache__/email_agent.cpython-312.pyc CHANGED
Binary files a/__pycache__/email_agent.cpython-312.pyc and b/__pycache__/email_agent.cpython-312.pyc differ
 
__pycache__/search_agent.cpython-312.pyc CHANGED
Binary files a/__pycache__/search_agent.cpython-312.pyc and b/__pycache__/search_agent.cpython-312.pyc differ
 
deep_research.py CHANGED
@@ -12,11 +12,39 @@ async def run(query: str):
12
 
13
  with gr.Blocks(theme=gr.themes.Default(primary_hue="sky")) as ui:
14
  gr.Markdown("# Deep Research")
15
- query_textbox = gr.Textbox(label="What topic would you like to research?")
16
- run_button = gr.Button("Run", variant="primary")
17
- report = gr.Markdown(label="Report")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  run_button.click(fn=run, inputs=query_textbox, outputs=report)
20
  query_textbox.submit(fn=run, inputs=query_textbox, outputs=report)
 
 
 
 
 
21
 
22
  ui.launch(inbrowser=True)
 
12
 
13
  with gr.Blocks(theme=gr.themes.Default(primary_hue="sky")) as ui:
14
  gr.Markdown("# Deep Research")
15
+
16
+ with gr.Row():
17
+ with gr.Column(scale=2):
18
+ query_textbox = gr.Textbox(label="What topic would you like to research?")
19
+ run_button = gr.Button("Run", variant="primary")
20
+ report = gr.Markdown(label="Report")
21
+
22
+ with gr.Column(scale=1):
23
+ gr.Markdown("## Email Results")
24
+ from_email = gr.Textbox(label="From Email")
25
+ to_email = gr.Textbox(label="To Email")
26
+ email_button = gr.Button("Send Report via Email")
27
+ email_status = gr.Textbox(label="Email Status")
28
+
29
+ def send_report_email(from_addr, to_addr, report_content):
30
+ from email_agent import send_email
31
+ try:
32
+ send_email(
33
+ subject="Deep Research Report",
34
+ html_body=report_content,
35
+ from_email_addr=from_addr,
36
+ to_email_addr=to_addr
37
+ )
38
+ return "Email sent successfully!"
39
+ except Exception as e:
40
+ return f"Error sending email: {str(e)}"
41
 
42
  run_button.click(fn=run, inputs=query_textbox, outputs=report)
43
  query_textbox.submit(fn=run, inputs=query_textbox, outputs=report)
44
+ email_button.click(
45
+ fn=send_report_email,
46
+ inputs=[from_email, to_email, report],
47
+ outputs=email_status
48
+ )
49
 
50
  ui.launch(inbrowser=True)