File size: 504 Bytes
10e9b7d
 
d62706d
 
e80aab9
d62706d
 
 
 
 
 
4021bf3
d62706d
3c4371f
e80aab9
d62706d
 
 
 
7d65c66
d62706d
3c4371f
d62706d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()