| 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() | |