File size: 757 Bytes
cf55491
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"""
MINIMAL TEST VERSION - Diagnose what's wrong
Run this first to see if basic Gradio works
"""
import gradio as gr
from typing import List, Dict

def simple_echo(message: str, history: List[Dict[str, str]]):
    """Simplest possible function."""
    history = history or []
    history.append({"role": "user", "content": message})
    history.append({"role": "assistant", "content": f"Echo: {message}"})
    return history

with gr.Blocks() as demo:
    gr.Markdown("# Minimal Test")
    chatbot = gr.Chatbot(type="messages")
    msg = gr.Textbox(label="Message")
    btn = gr.Button("Send")
    
    btn.click(simple_echo, [msg, chatbot], [chatbot])

if __name__ == "__main__":
    print("Testing minimal Gradio setup...")
    demo.launch(show_api=False)