Spaces:
Build error
Build error
Upload 2 files
Browse files- main.py +22 -0
- requirements.txt +1 -1
main.py
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from agent import run_agent
|
3 |
+
|
4 |
+
examples = [
|
5 |
+
"What's the capital of France?",
|
6 |
+
"Solve: 345 * 12",
|
7 |
+
"Write a Python function to reverse a list.",
|
8 |
+
"What's the square root of 169?",
|
9 |
+
"Who discovered penicillin?"
|
10 |
+
]
|
11 |
+
|
12 |
+
def ask_agent(input_text):
|
13 |
+
return run_agent(input_text)
|
14 |
+
|
15 |
+
iface = gr.Interface(fn=ask_agent,
|
16 |
+
inputs="text",
|
17 |
+
outputs="text",
|
18 |
+
title="Final Assignment Agent",
|
19 |
+
description="Enter your question and the agent will answer it.",
|
20 |
+
examples=examples)
|
21 |
+
|
22 |
+
iface.launch()
|
requirements.txt
CHANGED
@@ -1,2 +1,2 @@
|
|
|
|
1 |
gradio
|
2 |
-
requests
|
|
|
1 |
+
smol-agent
|
2 |
gradio
|
|