Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files1234567891 unmodified line111213141516from smolagents import LiteLLMModel, CodeAgent, WebSearchTool, GradioUI, Tool, ToolCollectionmodel = LiteLLMModel(model_id="groq/llama-3.3-70b-versatile")image_generation_tool = Tool.from_space("black-forest-labs/FLUX.1-schnell",1 unmodified linedescription="Generate an image from a prompt")# with ToolCollection.from_mcp({"url": "http://127.0.0.1:9000/mcp", "transport": "streamable-http"}, trust_remote_code=True) as tool_collection:agent = CodeAgent(model=model, tools=[WebSearchTool(),image_generation_tool])GradioUI(agent).launch()123456789101112131415161718191 unmodified line212223242526from smolagents import LiteLLMModel, CodeAgent, WebSearchTool, GradioUI, Tool, ToolCollection, toolmodel = LiteLLMModel(model_id="groq/llama-3.3-70b-versatile")@tooldef weather_tool(city: str)-> str:"""This is a tool to get weather information about a particular cityargs:city: str"""return f"The current weather in {city} is 25 degrees celsius."image_generation_tool = Tool.from_space("black-forest-labs/FLUX.1-schnell",1 unmodified linedescription="Generate an image from a prompt")# with ToolCollection.from_mcp({"url": "http://127.0.0.1:9000/mcp", "transport": "streamable-http"}, trust_remote_code=True) as tool_collection:agent = CodeAgent(model=model, tools=[WebSearchTool(),image_generation_tool, weather_tool])GradioUI(agent).launch()
main.py+12-2