import gradio as gr def simple_greet(name): if not name: name = "朋友" return f"你好, {name}! API调用成功! 🎉" demo = gr.Interface( fn=simple_greet, inputs=gr.Textbox(label="请输入你的名字"), outputs=gr.Textbox(label="问候语"), title="我的简单测试应用" ) demo.launch()