mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-28 00:14:21 +00:00
chore: use model_dump in chatcmpl instead of dict()
This commit is contained in:
@@ -51,7 +51,7 @@ class OpenAIChatCompletions(requester.LLMAPIRequester):
|
|||||||
self,
|
self,
|
||||||
chat_completion: chat_completion.ChatCompletion,
|
chat_completion: chat_completion.ChatCompletion,
|
||||||
) -> llm_entities.Message:
|
) -> llm_entities.Message:
|
||||||
chatcmpl_message = chat_completion.choices[0].message.dict()
|
chatcmpl_message = chat_completion.choices[0].message.model_dump()
|
||||||
|
|
||||||
# 确保 role 字段存在且不为 None
|
# 确保 role 字段存在且不为 None
|
||||||
if "role" not in chatcmpl_message or chatcmpl_message["role"] is None:
|
if "role" not in chatcmpl_message or chatcmpl_message["role"] is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user