Commit 3e7e6e7
Changed files (1)
src
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