File size: 729 Bytes
87f7c27
f6bdd77
ce9f68f
e6c371a
 
263ad5f
e6c371a
 
 
87f7c27
 
 
 
 
38d9c00
87f7c27
9f2c8e3
87f7c27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr 
from pipeline import run_pipeline
def ask_dailywellness(query: str) -> str:
    # Ensure that the query passed to run_with_chain is a valid string
    if isinstance(query, str):
        return run_pipeline(query)
    else:
        # If for some reason the query is not a string, return an error message
        return "Invalid input. Please enter a valid query."
interface = gr. Interface (
fn=ask_dailywellness,
inputs=gr.Textbox(lines=2, label="Ask DailyWellnessAI"),
outputs=gr.Textbox(label="DailyWellnessAI Answer"),
title="DailyWellnessAI",
description="Ask about wellness or DailyWellnessAI brand. Out-of-scope"
)
if __name__=="__main__":
    interface. launch(server_name="0.0.0.0", server_port=7860)