From 8cb69964d27d6171a9e7c63c8bbc6d0e1b13e00f Mon Sep 17 00:00:00 2001 From: Kimi Date: Thu, 4 Jul 2024 14:57:49 -0700 Subject: [PATCH] fix: bug fixing for #1455 - not able to serialize json for Azure (#1495) Co-authored-by: cpacker --- memgpt/llm_api/llm_api_tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memgpt/llm_api/llm_api_tools.py b/memgpt/llm_api/llm_api_tools.py index a26721d4..bb0d7e61 100644 --- a/memgpt/llm_api/llm_api_tools.py +++ b/memgpt/llm_api/llm_api_tools.py @@ -231,7 +231,7 @@ def create( data = dict( # NOTE: don't pass model to Azure calls, that is the deployment_id # model=agent_config.model, - messages=messages, + messages=[m.to_openai_dict() for m in messages], tools=[{"type": "function", "function": f} for f in functions] if functions else None, tool_choice=function_call, user=str(user_id), @@ -240,7 +240,7 @@ def create( data = dict( # NOTE: don't pass model to Azure calls, that is the deployment_id # model=agent_config.model, - messages=messages, + messages=[m.to_openai_dict() for m in messages], functions=functions, function_call=function_call, user=str(user_id),