This commit is contained in:
Michael Poluektov 2024-08-08 12:30:07 +01:00
parent a725801e55
commit 309cd645f1

View File

@ -726,7 +726,8 @@ async def generate_chat_completion(
payload = { payload = {
**form_data.model_dump(exclude_none=True, exclude=["metadata"]), **form_data.model_dump(exclude_none=True, exclude=["metadata"]),
} }
payload.pop("metadata", None) if "metadata" in payload:
del payload["metadata"]
model_id = form_data.model model_id = form_data.model
model_info = Models.get_model_by_id(model_id) model_info = Models.get_model_by_id(model_id)
@ -785,7 +786,8 @@ async def generate_openai_chat_completion(
): ):
completion_form = OpenAIChatCompletionForm(**form_data) completion_form = OpenAIChatCompletionForm(**form_data)
payload = {**completion_form.model_dump(exclude_none=True, exclude=["metadata"])} payload = {**completion_form.model_dump(exclude_none=True, exclude=["metadata"])}
payload.pop("metadata", None) if "metadata" in payload:
del payload["metadata"]
model_id = completion_form.model model_id = completion_form.model
model_info = Models.get_model_by_id(model_id) model_info = Models.get_model_by_id(model_id)