import gradio as gr | |
from fastapi import FastAPI | |
from chatbot import chatbot | |
app = FastAPI() | |
# Endpoint to handle chat requests | |
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() | |