File size: 666 Bytes
1034e15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr

def simple_chat(message, history):
    response = f"Echo: {message}"
    history.append([message, response])
    return "", history

with gr.Blocks(title="ID Agents Test") as app:
    gr.Markdown("# 🦠 ID Agents - Simple Test")
    chatbot = gr.Chatbot()
    msg = gr.Textbox(placeholder="Test message...")
    submit = gr.Button("Send")
    
    submit.click(simple_chat, [msg, chatbot], [msg, chatbot])
    msg.submit(simple_chat, [msg, chatbot], [msg, chatbot])

if __name__ == "__main__":
    app.launch(
        auth=[("test", "test123"), ("admin", "admin123")],
        auth_message="Test accounts: test/test123 or admin/admin123"
    )