LibreChat icon indicating copy to clipboard operation
LibreChat copied to clipboard

[Bug]: Streaming response drops first token when identical to prompt

Open cg-dot opened this issue 7 months ago • 0 comments

What happened?

I've noticed an odd behavior with the response after updating to the latest commit(326069d). When AI's response starts with the same token as the user's prompt, that first token is not displayed while streaming.

Steps to Reproduce

  1. Enter the prompt "Hello" (without quotes)
  2. If the AI's response starts with "Hello", the streaming output will skip this first word

For example, if the full response is "Hello! How can I assist you today?", the streaming output shows:

!
! How
! How can
! How can I assist you today?
Hello! How can I assist you today?

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Screenshots

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

cg-dot avatar Jul 10 '24 22:07 cg-dot