File size: 505 Bytes
10e9b7d eee83c1 e80aab9 eee83c1 4021bf3 eee83c1 3c4371f e80aab9 eee83c1 7d65c66 eee83c1 3c4371f eee83c1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import gradio as gr
def gaia_agent(question):
q = question.lower().strip()
if "capital of japan" in q:
return "Tokyo"
if "capital of france" in q:
return "Paris"
if "2 + 2" in q or "2+2" in q:
return "4"
return ""
with gr.Blocks() as demo:
gr.Markdown("# GAIA Agent")
q = gr.Textbox(label="GAIA Question", lines=6)
a = gr.Textbox(label="Agent Answer")
btn = gr.Button("Answer")
btn.click(gaia_agent, inputs=q, outputs=a)
demo.launch()
|