HistoPath / test_gradio.py
ryanDing26
test
cf55491
"""
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)