File size: 1,367 Bytes
d505fe6 8b1e792 d505fe6 8b1e792 d505fe6 8b1e792 d505fe6 698bee5 d505fe6 8b1e792 10c0f96 17cf24f d505fe6 16d3622 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
import gradio as gr
from chatbot_schedule import schedule_bot_response
from chatbot_wellness import wellness_bot_response
# Define interfaces for each chatbot
def task_schedule_interface(user_input):
return schedule_bot_response(user_input)
def wellness_chatbot_interface(user_id, user_input):
return wellness_bot_response(user_id, user_input)
# Create Gradio interfaces
task_bot = gr.Interface(
fn=task_schedule_interface,
inputs=gr.Textbox(label="Describe your task and time (e.g., Schedule meeting for tomorrow at 6PM)"),
outputs="text",
title="Task Scheduler Chatbot",
description="Helps you schedule tasks into your Google Calendar."
)
wellness_bot = gr.Interface(
fn=wellness_chatbot_interface,
inputs=[
gr.Textbox(label="Enter your unique user ID (e.g., email, username)"),
gr.Textbox(label="What would you like to discuss?"),
],
outputs="text",
title="Mental Wellness Chatbot",
description="Supports your mental wellness with tailored motivational advice."
)
# Combine into a tabbed interface using Tabs
with gr.Blocks() as app:
with gr.Tabs():
with gr.TabItem("Task Scheduler"):
task_bot.render()
with gr.TabItem("Mental Wellness Support"):
wellness_bot.render()
# Launch the app
if __name__ == "__main__":
app.launch(server_port=7861)
|