From 8187922ef18aa6cf826bb0bf03de622da0d5ac4b Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 7 Aug 2024 15:49:48 +0200 Subject: [PATCH] fix: "metadata" issue --- backend/apps/openai/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/apps/openai/main.py b/backend/apps/openai/main.py index a0d8f3750..a39b2787e 100644 --- a/backend/apps/openai/main.py +++ b/backend/apps/openai/main.py @@ -356,7 +356,9 @@ async def generate_chat_completion( ): idx = 0 payload = {**form_data} - payload.pop("metadata") + + if "metadata" in payload: + payload.pop("metadata") model_id = form_data.get("model") model_info = Models.get_model_by_id(model_id)