File size: 564 Bytes
6073dc2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import gradio as gr
from agent_config import create_agent

agent = create_agent()

def ask_agent(prompt: str) -> str:
    try:
        return agent.chat(prompt)
    except Exception as e:
        return f"Error: {e}"

iface = gr.Interface(
    fn=ask_agent,
    inputs=gr.Textbox(lines=2, placeholder="Ask the agent something..."),
    outputs="text",
    title="Agent with smolagents + DeepSeek",
    description="This agent uses smolagents, DeepSeek LLM, and custom tools to answer factual and data questions. ",
)

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