Spaces:
Runtime error
Runtime error
Eddyhzd
commited on
Commit
·
fb13585
1
Parent(s):
eb7fab5
test
Browse files
app.py
CHANGED
|
@@ -57,7 +57,6 @@ class MCPClientWrapper:
|
|
| 57 |
|
| 58 |
clientMCP = MCPClientWrapper()
|
| 59 |
clientMCP.connect("mcp_server.py")
|
| 60 |
-
print(f"Connected to MCP server. Available tools: {', '.join([tool['name'] for tool in clientMCP.tools])}")
|
| 61 |
print(clientMCP.tools)
|
| 62 |
|
| 63 |
# Chatbot : simple écho Fonction chatbot reliée à Mistral
|
|
@@ -70,17 +69,11 @@ def chatbot(message, history):
|
|
| 70 |
|
| 71 |
messages.append({"role": "user", "content": message})
|
| 72 |
|
| 73 |
-
available_tools = [{
|
| 74 |
-
"name": tool.name,
|
| 75 |
-
"description": tool.description,
|
| 76 |
-
"input_schema": tool.inputSchema
|
| 77 |
-
} for tool in clientMCP.tools]
|
| 78 |
-
|
| 79 |
# Appel API Mistral
|
| 80 |
response = clientLLM.chat.completions.create(
|
| 81 |
model="mistral-small-latest",
|
| 82 |
messages=messages,
|
| 83 |
-
tools=
|
| 84 |
)
|
| 85 |
|
| 86 |
bot_reply = response.choices[0].message.content.strip()
|
|
|
|
| 57 |
|
| 58 |
clientMCP = MCPClientWrapper()
|
| 59 |
clientMCP.connect("mcp_server.py")
|
|
|
|
| 60 |
print(clientMCP.tools)
|
| 61 |
|
| 62 |
# Chatbot : simple écho Fonction chatbot reliée à Mistral
|
|
|
|
| 69 |
|
| 70 |
messages.append({"role": "user", "content": message})
|
| 71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
# Appel API Mistral
|
| 73 |
response = clientLLM.chat.completions.create(
|
| 74 |
model="mistral-small-latest",
|
| 75 |
messages=messages,
|
| 76 |
+
tools=clientMCP.tools
|
| 77 |
)
|
| 78 |
|
| 79 |
bot_reply = response.choices[0].message.content.strip()
|