From 1f21f6dd54fcd1c673b443e5be1ed5b5c314c755 Mon Sep 17 00:00:00 2001 From: Adil Hafeez Date: Mon, 7 Apr 2025 01:49:19 -0700 Subject: [PATCH] pre-commit --- model_server/src/core/utils/model_utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/model_server/src/core/utils/model_utils.py b/model_server/src/core/utils/model_utils.py index 68d09593..9dfac528 100644 --- a/model_server/src/core/utils/model_utils.py +++ b/model_server/src/core/utils/model_utils.py @@ -162,7 +162,9 @@ class ArchBaseHandler: # "content": "\n{'name': 'get_stock_price', 'result': '$196.66'}\n" # msg[idx-1] contains tool call = '{"tool_calls": [{"name": "currency_exchange", "arguments": {"currency_symbol": "NZD"}}]}' tool_call_msg = messages[idx - 1].content - if tool_call_msg.startswith("```") and tool_call_msg.endswith("```"): + if tool_call_msg.startswith("```") and tool_call_msg.endswith( + "```" + ): tool_call_msg = tool_call_msg.strip("```").strip() if tool_call_msg.startswith("json"): tool_call_msg = tool_call_msg[4:].strip()