Spaces:
Sleeping
Sleeping
| # Create a CodeAgent with DuckDuckGo search capability | |
| from smolagents import CodeAgent, DuckDuckGoSearchTool, GradioUI, InferenceClientModel | |
| web_agent = CodeAgent( | |
| tools=[DuckDuckGoSearchTool()], | |
| model=InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct"), | |
| name="web_search_agent", | |
| description="A web search agent that can search the internet using DuckDuckGo to find current information, news, and answers to questions.", | |
| ) | |
| manager_agent = CodeAgent( | |
| model=InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", max_tokens=8192), | |
| tools=[], | |
| managed_agents=[web_agent], | |
| planning_interval=5, | |
| verbosity_level=2, | |
| max_steps=15, | |
| ) | |
| if __name__ == "__main__": | |
| GradioUI(manager_agent).launch() | |