csabakecskemeti commited on
Commit
f84e0c0
·
verified ·
1 Parent(s): 37d3d3d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -8,13 +8,17 @@ from smolagents.mcp_client import MCPClient
8
 
9
  try:
10
  mcp_client = MCPClient(
11
- {"url": "https://abidlabs-mcp-tools.hf.space/gradio_api/mcp/sse"},
12
  {"url": "https://csabakecskemeti-mcp-sentiment.hf.space/gradio_api/mcp/sse"}
13
  )
14
  tools = mcp_client.get_tools()
15
 
 
 
 
 
 
16
  model = InferenceClientModel()
17
- agent = CodeAgent(tools=[*tools], model=model)
18
 
19
  def call_agent(message, history):
20
  return str(agent.run(message))
@@ -23,7 +27,7 @@ try:
23
  demo = gr.ChatInterface(
24
  fn=lambda message, history: str(agent.run(message)),
25
  type="messages",
26
- examples=["Prime factorization of 68", "Anlyze the sentiment of 'this is a happy day'"],
27
  title="Agent with MCP Tools",
28
  description="This is a simple agent that uses MCP tools to answer questions.",
29
  # messages=[],
 
8
 
9
  try:
10
  mcp_client = MCPClient(
 
11
  {"url": "https://csabakecskemeti-mcp-sentiment.hf.space/gradio_api/mcp/sse"}
12
  )
13
  tools = mcp_client.get_tools()
14
 
15
+ mcp_client2 = MCPClient(
16
+ {"url": "https://abidlabs-mcp-tools.hf.space/gradio_api/mcp/sse"},
17
+ )
18
+ tools2 = mcp_client2.get_tools()
19
+
20
  model = InferenceClientModel()
21
+ agent = CodeAgent(tools=[*tools, *tools2], model=model)
22
 
23
  def call_agent(message, history):
24
  return str(agent.run(message))
 
27
  demo = gr.ChatInterface(
28
  fn=lambda message, history: str(agent.run(message)),
29
  type="messages",
30
+ examples=["Prime factorization of 68", "What is the sentiment of 'I feel shit'"],
31
  title="Agent with MCP Tools",
32
  description="This is a simple agent that uses MCP tools to answer questions.",
33
  # messages=[],