From 9893e7ac8314209bb4511d43f0f175a56992e19e Mon Sep 17 00:00:00 2001 From: Phodal Huang Date: Wed, 23 Oct 2024 10:16:52 +0800 Subject: [PATCH] refactor(SSEProcessor): set success flag on valid completion content --- .../kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt b/core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt index b6bd860f3..028bbd447 100644 --- a/core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt +++ b/core/src/main/kotlin/cc/unitmesh/devti/llms/custom/CustomSSEProcessor.kt @@ -114,6 +114,8 @@ open class CustomSSEProcessor(private val project: Project) { val completion = result.choices[0].message if (completion != null && completion.content != null) { + hasSuccessRequest = true + output += completion.content trySend(completion.content) }