From f14c1b7e5ebbe0edb63b4decf57e0f52bc9c2a2d Mon Sep 17 00:00:00 2001 From: Vinayak Sharma <101445708+Vinayak21574@users.noreply.github.com> Date: Wed, 10 Jul 2024 02:40:15 +0530 Subject: [PATCH] fix: Fixed issue #1523 (#1526) --- memgpt/llm_api/azure_openai.py | 1 + memgpt/server/rest_api/agents/index.py | 2 +- poetry.lock | 4 ++-- pyproject.toml | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/memgpt/llm_api/azure_openai.py b/memgpt/llm_api/azure_openai.py index dcf766fd..293f8183 100644 --- a/memgpt/llm_api/azure_openai.py +++ b/memgpt/llm_api/azure_openai.py @@ -97,6 +97,7 @@ def azure_openai_chat_completions_request( printd(f"Sending request to {url}") try: + data["messages"] = [i.to_openai_dict() for i in data["messages"]] response = requests.post(url, headers=headers, json=data) printd(f"response = {response}") response.raise_for_status() # Raises HTTPError for 4XX/5XX status diff --git a/memgpt/server/rest_api/agents/index.py b/memgpt/server/rest_api/agents/index.py index 73b11e89..77d57477 100644 --- a/memgpt/server/rest_api/agents/index.py +++ b/memgpt/server/rest_api/agents/index.py @@ -71,7 +71,7 @@ def setup_agents_index_router(server: SyncServer, interface: QueuingInterface, p persona_name = request.config["persona_name"] if "persona_name" in request.config else None persona = request.config["persona"] if "persona" in request.config else None request.config["preset"] if ("preset" in request.config and request.config["preset"]) else settings.default_preset - tool_names = request.config["function_names"] + tool_names = request.config["function_names"] if ("function_names" in request.config and request.config["function_names"]) else None metadata = request.config["metadata"] if "metadata" in request.config else {} metadata["human"] = human_name metadata["persona"] = persona_name diff --git a/poetry.lock b/poetry.lock index 965a790a..2489a2c8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8. and should not be changed by hand. [[package]] name = "aiohttp" @@ -6341,4 +6341,4 @@ server = ["fastapi", "uvicorn", "websockets"] [metadata] lock-version = "2.0" python-versions = "<3.13,>=3.10" -content-hash = "904e243813980d61b67db2d1dc96cc782299bcdfb80bb122e4f2013f11f2a9c4" +content-hash = "0522ceb628efd51c0679f3fe8b6da161c5a25a50166f81e58f1be76d0120524c" diff --git a/pyproject.toml b/pyproject.toml index 28689b59..bbeb1f6a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,9 @@ autogen = ["pyautogen"] qdrant = ["qdrant-client"] ollama = ["llama-index-embeddings-ollama"] +[tool.poetry.group.dev.dependencies] +black = "^24.4.2" + [tool.black] line-length = 140 target-version = ['py310', 'py311']