GeminiAi commited on
Commit
1717905
·
verified ·
1 Parent(s): e6c27ad

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -0
app.py ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # app.py
2
+ import gradio as gr
3
+ from crew import LatestAiDevelopmentCrew
4
+
5
+ def generate_report(topic):
6
+ # Pass the input topic to the crew
7
+ inputs = {'topic': topic}
8
+ crew = LatestAiDevelopmentCrew()
9
+ crew_output = crew.crew().kickoff(inputs=inputs)
10
+
11
+ # Assuming the crew generates a report saved as 'report.md'
12
+ with open('report.md', 'r') as file:
13
+ report = file.read()
14
+
15
+ return report
16
+
17
+ # Gradio Interface
18
+ iface = gr.Interface(
19
+ fn=generate_report,
20
+ inputs="text", # Topic input as text box
21
+ outputs="markdown", # Display the report as markdown
22
+ live=True
23
+ )
24
+
25
+ # Launch the Gradio app
26
+ iface.launch()