File size: 863 Bytes
f36f021 |
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 |
# app.py
import os
import gradio as gr
from pipeline import run_with_chain
def ask_dailywellness(query: str) -> str:
"""
Calls our main pipeline function from pipeline.py
"""
return run_with_chain(query)
# Build a simple Gradio interface
interface = gr.Interface(
fn=ask_dailywellness,
inputs=gr.Textbox(
lines=2,
label="Ask DailyWellnessAI",
placeholder="e.g., How do I improve my posture while working?"
),
outputs=gr.Textbox(
label="DailyWellnessAI Answer"
),
title="DailyWellnessAI Chat",
description=(
"Ask a wellness question, or something about DailyWellnessAI (brand). "
"If the question is out of scope, you'll get a polite refusal."
),
allow_flagging="never"
)
if __name__ == "__main__":
interface.launch(server_name="0.0.0.0", server_port=7860)
|