SwatGarg commited on
Commit
599bf2c
·
verified ·
1 Parent(s): d65d363

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -8
app.py CHANGED
@@ -71,15 +71,32 @@ topic = st.text_input("What topic do you want to write about?")
71
 
72
  if st.button('Generate Content'):
73
  if topic:
74
- content_crew = ContentCrew(topic)
75
- result = content_crew.run()
76
-
77
- # Debugging: Print the result to ensure it is not empty
78
- print("DEBUG: Result received")
79
- print(result)
80
 
 
 
 
 
 
81
  st.write("## Here is your Content Plan")
82
  st.write('-------------------------------')
83
- st.write(result)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
84
  else:
85
- st.error("Please enter a topic.")
 
71
 
72
  if st.button('Generate Content'):
73
  if topic:
74
+ # Run planner, researcher, and writer agents
75
+ planner = content_agents.planner_agent(topic)
76
+ researcher = content_agents.researcher_agent(topic)
77
+ writer = content_agents.writer_agent(topic)
 
 
78
 
79
+ # Assuming you have some method to run the agents and get the content
80
+ content_plan = planner.run()
81
+ research_content = researcher.run()
82
+ final_article = writer.run()
83
+
84
  st.write("## Here is your Content Plan")
85
  st.write('-------------------------------')
86
+ st.write(content_plan)
87
+
88
+ st.write("## Research Content")
89
+ st.write('-------------------------------')
90
+ st.write(research_content)
91
+
92
+ st.write("## Final Article")
93
+ st.write('-------------------------------')
94
+ st.write(final_article)
95
+
96
+ # Generate and display images
97
+ sections = ["Introduction", "Application", "Definition and Architecture", "How it Works", "Comparison with Other Similar Apps", "References"]
98
+ for section in sections:
99
+ image_path = content_agents.generate_image_for_section(section, topic)
100
+ st.image(image_path, caption=f'{section} Image')
101
  else:
102
+ st.error("Please enter a topic.")