mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-26 06:16:09 +00:00
fix: 未序列化的function_call属性
This commit is contained in:
@@ -112,6 +112,7 @@ def count_completion_tokens(messages: list, model: str) -> int:
|
|||||||
|
|
||||||
|
|
||||||
def count_tokens(messages: list, model: str):
|
def count_tokens(messages: list, model: str):
|
||||||
|
|
||||||
if model in CHAT_COMPLETION_MODELS:
|
if model in CHAT_COMPLETION_MODELS:
|
||||||
return count_chat_completion_tokens(messages, model)
|
return count_chat_completion_tokens(messages, model)
|
||||||
elif model in COMPLETION_MODELS:
|
elif model in COMPLETION_MODELS:
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ class Session:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if 'function_call' in resp['choices'][0]['message']:
|
if 'function_call' in resp['choices'][0]['message']:
|
||||||
msg['function_call'] = resp['choices'][0]['message']['function_call']
|
msg['function_call'] = json.dumps(resp['choices'][0]['message']['function_call'])
|
||||||
|
|
||||||
pending_msgs.append(msg)
|
pending_msgs.append(msg)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user