import gradio as gr import requests def chat_with_ai(input_text, mode): response = requests.post("http://localhost:8000/chat", json={"input_text": input_text, "mode": mode}) return response.json()["response"] ui = gr.Interface( fn=chat_with_ai, inputs=["text", gr.Radio(["general", "iran", "math"], label="Mode")], outputs="text", title="AI Chat System", ) ui.launch()