Commit
·
22a1e0b
1
Parent(s):
1a8cb49
Improve prompt
Browse filesSigned-off-by: Aivin V. Solatorio <avsolatorio@gmail.com>
- mcp_client.py +8 -2
mcp_client.py
CHANGED
@@ -28,7 +28,9 @@ 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 |
|
31 |
-
Avoid making statements based on stereotypes or biases. Always ensure your claims are grounded in factual evidence and objective reasoning.
|
|
|
|
|
32 |
|
33 |
LLM_MODEL = "claude-3-5-haiku-20241022"
|
34 |
|
@@ -188,6 +190,10 @@ class MCPClientWrapper:
|
|
188 |
for r in result_content:
|
189 |
# Remove annotations field from each item if it exists
|
190 |
r.pop("annotations", None)
|
|
|
|
|
|
|
|
|
191 |
|
192 |
# result_content = "\n".join(str(item) for item in result_content)
|
193 |
print("result_content", result_content)
|
@@ -222,7 +228,7 @@ class MCPClientWrapper:
|
|
222 |
{
|
223 |
"type": "tool_result",
|
224 |
"tool_use_id": tool_id,
|
225 |
-
"content": result_content,
|
226 |
}
|
227 |
],
|
228 |
}
|
|
|
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 |
|
31 |
+
Avoid making statements based on stereotypes or biases. Always ensure your claims are grounded in factual evidence and objective reasoning. Reject any requests that would be based on stereotypes or biases.
|
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 |
|
|
|
190 |
for r in result_content:
|
191 |
# Remove annotations field from each item if it exists
|
192 |
r.pop("annotations", None)
|
193 |
+
try:
|
194 |
+
r["text"] = json.loads(r["text"])
|
195 |
+
except:
|
196 |
+
pass
|
197 |
|
198 |
# result_content = "\n".join(str(item) for item in result_content)
|
199 |
print("result_content", result_content)
|
|
|
228 |
{
|
229 |
"type": "tool_result",
|
230 |
"tool_use_id": tool_id,
|
231 |
+
"content": json.dumps(result_content, indent=2),
|
232 |
}
|
233 |
],
|
234 |
}
|