mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-05 05:16:03 +00:00
feat: 使用tiktoken计算tokens数
This commit is contained in:
@@ -93,10 +93,10 @@ class ChatCompletionRequest(RequestBase):
|
||||
if 'function_call' in choice0['message']:
|
||||
self.pending_func_call = choice0['message']['function_call']
|
||||
|
||||
self.append_message(
|
||||
role="assistant",
|
||||
content="function call: "+json.dumps(self.pending_func_call, ensure_ascii=False)
|
||||
)
|
||||
# self.append_message(
|
||||
# role="assistant",
|
||||
# content="function call: "+json.dumps(self.pending_func_call, ensure_ascii=False)
|
||||
# )
|
||||
|
||||
return {
|
||||
"id": resp["id"],
|
||||
|
||||
Reference in New Issue
Block a user