File size: 433 Bytes
b433100
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import gradio as gr
from fastapi import FastAPI
from chatbot import chatbot

app = FastAPI()

# Endpoint to handle chat requests
@app.post("/chat", response_model=str)
def chat_endpoint(chat_request: str):
    return chatbot(chat_request)

def main():
    # Launch Gradio interface for the chatbot
    gr.Interface(fn=chatbot, inputs="text", outputs="text", title="Chatbot").launch(share=True)

if __name__ == "__main__":
    main()