SwatGarg commited on
Commit
73c75f4
·
verified ·
1 Parent(s): bc9a213

Update app.py

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