Update app.py
Browse files
app.py
CHANGED
|
@@ -325,66 +325,47 @@ def prepare_meeting(json_input):
|
|
| 325 |
### Gradio Demo ###
|
| 326 |
with gr.Blocks() as demo:
|
| 327 |
gr.Markdown("## Curify: Unified AI Tools for Productivity")
|
| 328 |
-
|
| 329 |
-
with gr.Tab("Curify Digest"):
|
| 330 |
-
with gr.Row():
|
| 331 |
-
# Column 1: Webpage rendering
|
| 332 |
-
with gr.Column():
|
| 333 |
-
gr.Markdown("## Render Webpage")
|
| 334 |
-
url_input = gr.Textbox(label="Enter URL")
|
| 335 |
-
# Shared Button: Fetch content, show webpage, and summary/perspectives
|
| 336 |
-
fetch_btn = gr.Button("Fetch and Process Webpage")
|
| 337 |
-
text_output = gr.Textbox(label="Webpage Content", lines=7)
|
| 338 |
-
# Column 2: Summary and Perspectives
|
| 339 |
-
with gr.Column():
|
| 340 |
-
gr.Markdown("## Summary & Perspectives")
|
| 341 |
-
summary_output = gr.Textbox(label="Summary", lines=5)
|
| 342 |
-
perspectives_output = gr.Textbox(label="Perspectives", lines=5)
|
| 343 |
-
|
| 344 |
-
# Column 3: Chatbot
|
| 345 |
-
with gr.Column():
|
| 346 |
-
gr.Markdown("## Interactive Chatbot")
|
| 347 |
-
chatbot_history_gr = gr.Chatbot(label="Chat History")
|
| 348 |
-
user_input = gr.Textbox(label="Ask a Question", placeholder="Type your question here...")
|
| 349 |
-
chatbot_btn = gr.Button("Send")
|
| 350 |
-
reflection_btn = gr.Button("Generate reflection")
|
| 351 |
-
reflection_output = gr.Textbox(label="Reflections", lines=5)
|
| 352 |
-
|
| 353 |
-
fetch_btn.click(
|
| 354 |
-
process_webpage,
|
| 355 |
-
inputs=url_input,
|
| 356 |
-
outputs=[text_output, summary_output, perspectives_output],
|
| 357 |
-
)
|
| 358 |
-
|
| 359 |
-
chatbot_btn.click(
|
| 360 |
-
chat_with_ai,
|
| 361 |
-
inputs=[chatbot_history_gr, user_input, text_output],
|
| 362 |
-
outputs=chatbot_history_gr,
|
| 363 |
-
)
|
| 364 |
-
|
| 365 |
-
reflection_btn.click(
|
| 366 |
-
generate_reflection,
|
| 367 |
-
inputs=chatbot_history_gr,
|
| 368 |
-
outputs=reflection_output,
|
| 369 |
-
)
|
| 370 |
-
|
| 371 |
-
|
| 372 |
-
with gr.Tab("Curify Ideas"):
|
| 373 |
-
text_input = gr.Textbox(label="Enter text or ideas")
|
| 374 |
-
extracted_ideas = gr.Textbox(label="Extracted Ideas", interactive=False)
|
| 375 |
-
extract_button = gr.Button("Extract Ideas")
|
| 376 |
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 388 |
|
| 389 |
demo.launch(share=True)
|
| 390 |
|
|
|
|
| 325 |
### Gradio Demo ###
|
| 326 |
with gr.Blocks() as demo:
|
| 327 |
gr.Markdown("## Curify: Unified AI Tools for Productivity")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 328 |
|
| 329 |
+
with gr.Row():
|
| 330 |
+
# Column 1: Webpage rendering
|
| 331 |
+
with gr.Column():
|
| 332 |
+
gr.Markdown("## Render Webpage")
|
| 333 |
+
url_input = gr.Textbox(label="Enter URL")
|
| 334 |
+
# Shared Button: Fetch content, show webpage, and summary/perspectives
|
| 335 |
+
fetch_btn = gr.Button("Fetch and Process Webpage")
|
| 336 |
+
text_output = gr.Textbox(label="Webpage Content", lines=7)
|
| 337 |
+
# Column 2: Summary and Perspectives
|
| 338 |
+
with gr.Column():
|
| 339 |
+
gr.Markdown("## Summary & Perspectives")
|
| 340 |
+
summary_output = gr.Textbox(label="Summary", lines=5)
|
| 341 |
+
perspectives_output = gr.Textbox(label="Perspectives", lines=5)
|
| 342 |
+
|
| 343 |
+
# Column 3: Chatbot
|
| 344 |
+
with gr.Column():
|
| 345 |
+
gr.Markdown("## Interactive Chatbot")
|
| 346 |
+
chatbot_history_gr = gr.Chatbot(label="Chat History")
|
| 347 |
+
user_input = gr.Textbox(label="Ask a Question", placeholder="Type your question here...")
|
| 348 |
+
chatbot_btn = gr.Button("Send")
|
| 349 |
+
reflection_btn = gr.Button("Generate reflection")
|
| 350 |
+
reflection_output = gr.Textbox(label="Reflections", lines=5)
|
| 351 |
+
|
| 352 |
+
fetch_btn.click(
|
| 353 |
+
process_webpage,
|
| 354 |
+
inputs=url_input,
|
| 355 |
+
outputs=[text_output, summary_output, perspectives_output],
|
| 356 |
+
)
|
| 357 |
+
|
| 358 |
+
chatbot_btn.click(
|
| 359 |
+
chat_with_ai,
|
| 360 |
+
inputs=[chatbot_history_gr, user_input, text_output],
|
| 361 |
+
outputs=chatbot_history_gr,
|
| 362 |
+
)
|
| 363 |
+
|
| 364 |
+
reflection_btn.click(
|
| 365 |
+
generate_reflection,
|
| 366 |
+
inputs=chatbot_history_gr,
|
| 367 |
+
outputs=reflection_output,
|
| 368 |
+
)
|
| 369 |
|
| 370 |
demo.launch(share=True)
|
| 371 |
|