From 0b854bdcf155a16cd5ad66c2d645d4f78efe1646 Mon Sep 17 00:00:00 2001 From: RockChinQ <1010553892@qq.com> Date: Tue, 1 Aug 2023 10:26:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat=5Fcompletion):=20=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90=E5=88=B0stop=E4=BB=A5=E4=BD=BFmax=5Ftokens=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/openai/api/chat_completion.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/openai/api/chat_completion.py b/pkg/openai/api/chat_completion.py index e6d43165..27dae724 100644 --- a/pkg/openai/api/chat_completion.py +++ b/pkg/openai/api/chat_completion.py @@ -87,7 +87,7 @@ class ChatCompletionRequest(RequestBase): choice0 = resp["choices"][0] # 如果不是函数调用,且finish_reason为stop,则停止迭代 - if 'function_call' not in choice0['message'] and choice0["finish_reason"] == "stop": + if 'function_call' not in choice0['message']: # and choice0["finish_reason"] == "stop" self.stopped = True if 'function_call' in choice0['message']: