From 80a700b890eeb332ff7a858a57641fe6b22f95cc Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Sun, 9 Feb 2025 19:51:50 +0800 Subject: [PATCH] fix: Excerpt from the thinking process (#2181) --- apps/application/flow/tools.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/application/flow/tools.py b/apps/application/flow/tools.py index 219f39e88..a4e0d5a58 100644 --- a/apps/application/flow/tools.py +++ b/apps/application/flow/tools.py @@ -46,7 +46,10 @@ class Reasoning: self.reasoning_content_is_start = True self.reasoning_content_chunk = self.all_content[self.reasoning_content_start_tag_len:] else: - self.reasoning_content_is_end = True + if not self.reasoning_content_is_end: + self.reasoning_content_is_end = True + self.content += self.all_content + return {'content': self.all_content, 'reasoning_content': ''} else: if self.reasoning_content_is_start: self.reasoning_content_chunk += chunk.content