File size: 420 Bytes
9718baa | 1 2 3 4 5 6 7 8 9 10 11 12 13 | import gradio as gr
from src.rag import chat
def response(message, history):
history = history or []
response_text = chat(message)
history.append({"role": "user", "content": message})
history.append({"role": "assistant", "content": response_text})
return history
demo = gr.ChatInterface(fn=response, type="messages", examples=["hello", "hola", "merhaba"], title="Echo Bot")
demo.launch(share=True) |