File size: 601 Bytes
fc08be9
37a2ca8
fc08be9
 
 
37a2ca8
fc08be9
 
37a2ca8
30e2a8d
fc08be9
 
 
30e2a8d
37a2ca8
 
fc08be9
 
 
 
 
30e2a8d
fc08be9
37a2ca8
 
fc08be9
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
26
27
# app.py

import gradio as gr
from agent import create_agent
from dotenv import load_dotenv

load_dotenv()
agent = create_agent()


def respond_to_query(query: str) -> str:
    response = agent.run(query)
    return response


with gr.Blocks() as demo:
    gr.Markdown("# 🤖 SmolAgent GAIA Assistant")
    with gr.Row():
        user_input = gr.Textbox(label="Ask your question")
        output = gr.Textbox(label="Agent's Response")
    submit_btn = gr.Button("Submit")

    submit_btn.click(fn=respond_to_query, inputs=[user_input], outputs=[output])

if __name__ == "__main__":
    demo.launch()