Spaces:
Build error
Build error
Update app.py
Browse files
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
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 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(
|
| 92 |
-
|
| 93 |
-
st.write("## Research Content")
|
| 94 |
st.write('-------------------------------')
|
| 95 |
-
st.write(
|
| 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.")
|