wlchee commited on
Commit
52860b0
·
verified ·
1 Parent(s): 0f665aa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -7,11 +7,11 @@ from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClien
7
 
8
  try:
9
  mcp_client = MCPClient(
10
- {"url": "https://baxin-newssearch-mcp.hf.space/gradio_api/mcp/sse"} # This is the MCP Server we created in the previous section
11
  )
12
  tools = mcp_client.get_tools()
13
 
14
- model = InferenceClientModel()
15
  agent = CodeAgent(tools=[*tools], model=model)
16
 
17
  demo = gr.ChatInterface(
@@ -22,6 +22,6 @@ try:
22
  description="This is a simple agent that uses MCP tools to answer questions.",
23
  )
24
 
25
- demo.launch(share=True)
26
  finally:
27
  mcp_client.disconnect()
 
7
 
8
  try:
9
  mcp_client = MCPClient(
10
+ {"url": "https://wlchee-mcp-sentiment.hf.space/gradio_api/mcp/sse"} # This is the MCP Server we created in the previous section
11
  )
12
  tools = mcp_client.get_tools()
13
 
14
+ model = InferenceClientModel(token=os.getenv("mcp2"))
15
  agent = CodeAgent(tools=[*tools], model=model)
16
 
17
  demo = gr.ChatInterface(
 
22
  description="This is a simple agent that uses MCP tools to answer questions.",
23
  )
24
 
25
+ demo.launch()
26
  finally:
27
  mcp_client.disconnect()