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