Update app.py
Browse files
app.py
CHANGED
@@ -247,22 +247,26 @@ def create_demo():
|
|
247 |
type="messages",
|
248 |
show_label=True
|
249 |
)
|
|
|
250 |
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
history.append(ChatMessage(role="user", content=f"Write an article about: {topic}"))
|
259 |
-
yield history
|
260 |
|
261 |
-
async
|
262 |
-
history.
|
263 |
yield history
|
264 |
-
|
265 |
-
|
|
|
|
|
|
|
|
|
|
|
266 |
btn.click(
|
267 |
process_input,
|
268 |
inputs=[topic, chatbot],
|
|
|
247 |
type="messages",
|
248 |
show_label=True
|
249 |
)
|
250 |
+
|
251 |
|
252 |
+
with gr.Row(equal_height=True):
|
253 |
+
topic = gr.Textbox(
|
254 |
+
label="Article Topic",
|
255 |
+
placeholder="Enter the topic you want an article about...",
|
256 |
+
#lines=2,
|
257 |
+
scale=4
|
258 |
+
)
|
|
|
|
|
259 |
|
260 |
+
async def process_input(topic, history):
|
261 |
+
history.append(ChatMessage(role="user", content=f"Write an article about: {topic}"))
|
262 |
yield history
|
263 |
+
|
264 |
+
async for messages in article_crew.process_article(topic):
|
265 |
+
history.extend(messages)
|
266 |
+
yield history
|
267 |
+
|
268 |
+
btn = gr.Button("Write Article", variant="primary", scale=1)
|
269 |
+
|
270 |
btn.click(
|
271 |
process_input,
|
272 |
inputs=[topic, chatbot],
|