Spaces:
Runtime error
Runtime error
Commit ·
b14194e
1
Parent(s): 22a1e0b
Set prompt
Browse filesSigned-off-by: Aivin V. Solatorio <avsolatorio@gmail.com>
- mcp_client.py +6 -1
mcp_client.py
CHANGED
|
@@ -24,7 +24,7 @@ You must not provide answers beyond what the tools provide.
|
|
| 24 |
|
| 25 |
Do not make up data or information and never simulate the `get_wdi_data` tool. Instead, you must always call the `get_wdi_data` tool when the user asks for data.
|
| 26 |
|
| 27 |
-
You can use multiple tools if needed.
|
| 28 |
|
| 29 |
If the user asks for any information beyond what the tools available to you provide, you must say that you do not have that information.
|
| 30 |
|
|
@@ -32,6 +32,8 @@ Avoid making statements based on stereotypes or biases. Always ensure your claim
|
|
| 32 |
|
| 33 |
You may describe the data in a way that is easy to understand but you must not elaborate based on external knowledge."""
|
| 34 |
|
|
|
|
|
|
|
| 35 |
LLM_MODEL = "claude-3-5-haiku-20241022"
|
| 36 |
|
| 37 |
|
|
@@ -80,6 +82,8 @@ class MCPClientWrapper:
|
|
| 80 |
for tool in response.tools
|
| 81 |
]
|
| 82 |
|
|
|
|
|
|
|
| 83 |
tool_names = [tool["name"] for tool in self.tools]
|
| 84 |
return f"Connected to MCP server. Available tools: {', '.join(tool_names)}"
|
| 85 |
|
|
@@ -131,6 +135,7 @@ class MCPClientWrapper:
|
|
| 131 |
for content in response.content:
|
| 132 |
if content.type == "text":
|
| 133 |
result_messages.append({"role": "assistant", "content": content.text})
|
|
|
|
| 134 |
|
| 135 |
elif content.type == "tool_use":
|
| 136 |
tool_id = content.id
|
|
|
|
| 24 |
|
| 25 |
Do not make up data or information and never simulate the `get_wdi_data` tool. Instead, you must always call the `get_wdi_data` tool when the user asks for data.
|
| 26 |
|
| 27 |
+
You can use multiple tools if needed. Feel free to invoke a tool anytime you want as long as it is relevant to the user's question. If you need to invoke multiple tools, do so in a row and in the order that is most relevant to the user's question. Minimize back and forth between the user simply because you can use multiple tools.
|
| 28 |
|
| 29 |
If the user asks for any information beyond what the tools available to you provide, you must say that you do not have that information.
|
| 30 |
|
|
|
|
| 32 |
|
| 33 |
You may describe the data in a way that is easy to understand but you must not elaborate based on external knowledge."""
|
| 34 |
|
| 35 |
+
# SYSTEM_PROMPT = f"""You are a helpful assistant and today is {datetime.now().strftime("%Y-%m-%d")}."""
|
| 36 |
+
|
| 37 |
LLM_MODEL = "claude-3-5-haiku-20241022"
|
| 38 |
|
| 39 |
|
|
|
|
| 82 |
for tool in response.tools
|
| 83 |
]
|
| 84 |
|
| 85 |
+
print(self.tools)
|
| 86 |
+
|
| 87 |
tool_names = [tool["name"] for tool in self.tools]
|
| 88 |
return f"Connected to MCP server. Available tools: {', '.join(tool_names)}"
|
| 89 |
|
|
|
|
| 135 |
for content in response.content:
|
| 136 |
if content.type == "text":
|
| 137 |
result_messages.append({"role": "assistant", "content": content.text})
|
| 138 |
+
claude_messages.append({"role": "assistant", "content": content.text})
|
| 139 |
|
| 140 |
elif content.type == "tool_use":
|
| 141 |
tool_id = content.id
|