Manavraj's picture
Update app.py
e0e8a9c verified
raw
history blame
624 Bytes
from smolagents import Tool, CodeAgent
# Your MCP server base URL on Hugging Face Spaces
MCP_URL = "https://Manavraj-Troubleshoot_MCP.hf.space"
# Load tools from your MCP server
kb_tool = Tool.from_mcp(MCP_URL, name="search_knowledge_base")
web_tool = Tool.from_mcp(MCP_URL, name="search_web")
format_tool = Tool.from_mcp(MCP_URL, name="format_response")
# Create agent with all three tools
agent = CodeAgent(tools=[kb_tool, web_tool, format_tool])
# Run example input
query = "My WiFi keeps disconnecting randomly. What can I do?"
response = agent.run(query)
print("Agent's Troubleshooting Response:")
print(response)