From 48d65c0e3929bc4d0188ea78ea48bad6f67a8137 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 3 Mar 2025 15:26:24 +0800 Subject: [PATCH] Handle empty prompt in chat streaming with error callback - Add error handling for empty prompts in streamChat method - Ensure proper error message generation and callback invocation - Improve error propagation in chat streaming scenarios --- neo/assistant/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/neo/assistant/api.go b/neo/assistant/api.go index 4bd611bc..f8b0bef8 100644 --- a/neo/assistant/api.go +++ b/neo/assistant/api.go @@ -631,6 +631,7 @@ func (ast *Assistant) streamChat( // if the prompt is empty, return the error if prompt == "" { + chatMessage.New().Error(retry.Error()).Done().Callback(cb).Write(c.Writer) return nil, retry }