KLOWNZone23 commited on
Commit
836cb3e
·
verified ·
1 Parent(s): 22103b7

Update app.py

Browse files

Updated mcp issues

Files changed (1) hide show
  1. app.py +37 -31
app.py CHANGED
@@ -1,33 +1,39 @@
1
- import gradio as gr
 
2
 
3
- from mcp.client.stdio import StdioServerParameters
4
- from smolagents import ToolCollection, CodeAgent
5
- from smolagents import CodeAgent, InferenceClientModel
6
- from smolagents.mcp_client import MCPClient
7
 
8
- model = InferenceClientModel()
9
-
10
- try:
11
- mcp_client = MCPClient(
12
- {"url": "https://abidlabs-mcp-tools2.hf.space/gradio_api/mcp/sse"}
13
- )
14
-
15
- tools = mcp_client.get_tools()
16
- agent = CodeAgent(tools=[*tools], model=model)
17
-
18
- def call_agent(message, history):
19
- return str(agent.run(message))
20
-
21
- demo = gr.ChatInterface(
22
- fn=call_agent,
23
- type="messages",
24
- examples=["Prime factorization of 68"],
25
- title="Agent with MCP Tools",
26
- description="This is a simple agent that uses MCP tools to answer questions.",
27
- )
28
-
29
- demo.launch()
30
- except Exception as e:
31
- raise e
32
- finally:
33
- mcp_client.stop()
 
 
 
 
 
 
1
+ Docs: https://doc.termux.com
2
+ Community: https://community.termux.com
3
 
4
+ Working with packages:
5
+ - Search: pkg search <query>
6
+ - Install: pkg install <package>
7
+ - Upgrade: pkg upgrade
8
 
9
+ Report issues at https://bugs.termux.com
10
+ ~ $ nano mcp-course/unit2-gradio-client/app.y
11
+ ~ $ ls
12
+ app.json downloads my_project unit_1_quiz
13
+ app.json.save kz.py storage
14
+ build logs test1
15
+ ~ $ cd
16
+ ~ $ ce mpc-course
17
+ No command ce found, did you mean:
18
+ Command cc in package clang
19
+ Command cp in package coreutils
20
+ Command ne in package ne
21
+ Command ci in package rcs
22
+ Command cu in package uucp
23
+ ~ $ cd mcp-cousre
24
+ bash: cd: mcp-cousre: No such file or directory
25
+ ~ $ cd mcp-course
26
+ bash: cd: mcp-course: No such file or directory
27
+ ~ $ ls
28
+ app.json downloads my_project unit_1_quiz
29
+ app.json.save kz.py storage
30
+ build logs test1
31
+ ~ $ mkdir mcp-course
32
+ ~ $ ls - mfp-course
33
+ ls: cannot access '-': No such file or directory
34
+ ls: cannot access 'mfp-course': No such file or directory
35
+ ~ $ mkdir mcp-course
36
+ mkdir: cannot create directory ‘mcp-course’: File exists
37
+ ~ $ cd mcp-course
38
+ ~/mcp-course $ nano app.py
39
+ ~/mcp-course $