Commit 3e7e6e7

benny-dou <60535774+benny-dou@users.noreply.github.com>
2025-03-14 12:14:02
chore(gpt): start response if answer is not empty
1 parent 4bb9274
Changed files (1)
src/llm/response_stream.py
@@ -84,7 +84,8 @@ async def send_to_gpt_stream(client: Client, status: Message, config: dict, retr
 
             answers = beautify_llm_response(answers)
             if await count_without_entities(answers) <= TEXT_LENGTH:
-                await modify_progress(message=status, text=answers, detail_progress=True)
+                if len(answers.removeprefix(prefix)) > 3:  # start response if answer is not empty
+                    await modify_progress(message=status, text=answers, detail_progress=True)
             else:  # answers is too long, split it into multiple messages
                 parts = await smart_split(answers)
                 await modify_progress(message=status, text=parts[0], force_update=True)  # force send the first part