ggsmith842 commited on
Commit
fc3c16b
·
1 Parent(s): 2b5540c
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -1,18 +1,17 @@
1
- import os
2
  import gradio as gr
 
 
 
 
3
 
4
- from smolagents import InferenceClientModel, CodeAgent, MCPClient
5
 
6
  try:
7
  mcp_client = MCPClient(
8
- # mcp server created in previous section
9
- # {"url": "http://localhost:7860/gradio_api/mcp/sse"}
10
- {"url": "https://ggsmith-mcp-sentiment.hf.space/gradio_api/mcp/sse"}
11
  )
12
-
13
  tools = mcp_client.get_tools()
14
 
15
- model = InferenceClientModel(token=os.getenv("HF_TOKEN"))
16
  agent = CodeAgent(tools=[*tools], model=model)
17
 
18
  demo = gr.ChatInterface(
 
 
1
  import gradio as gr
2
+ import os
3
+
4
+ from mcp import StdioServerParameters
5
+ from smolagents import InferenceClientModel, CodeAgent, ToolCollection, MCPClient
6
 
 
7
 
8
  try:
9
  mcp_client = MCPClient(
10
+ {"url": "https://ggsmith.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("HUGGINGFACE_API_TOKEN"))
15
  agent = CodeAgent(tools=[*tools], model=model)
16
 
17
  demo = gr.ChatInterface(