ChatBot / app.py
Heramb1's picture
Rename main.py to app.py
588f6a7 verified
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()