bugfix: chunks get inserted in completion_first manner when completion_first = true#2245
Merged
skeptrunedev merged 3 commits intomainfrom Aug 24, 2024
Conversation
cdxker
commented
Aug 24, 2024
cdxker
commented
Aug 24, 2024
| let completion = chunk_v.join(""); | ||
|
|
||
| let message_to_be_stored = if completion_first { | ||
| format!("{}{}", completion, chunk_metadatas_stringified) |
Member
Author
There was a problem hiding this comment.
I think it makes the most sense to store the chunks in the completion order the user wanted them to be streamed in. (Will likely work a lot better for the front ends to be modular.
6da64b2 to
adfd289
Compare
cdxker
commented
Aug 24, 2024
| .into_iter() | ||
| .filter_map(|mut message| { | ||
| if message.content.starts_with("||[{") { | ||
| match message.content.rsplit_once("}]") { |
Member
Author
There was a problem hiding this comment.
In the format string }} = a single }. Not sure why they don't just do a } but yeah.
cdxker
commented
Aug 24, 2024
Comment on lines
500
to
516
| if message.content.starts_with("{[") { | ||
| // This is (chunks, content) | ||
| message.content = message | ||
| .content | ||
| .split("||") | ||
| .last() | ||
| .unwrap_or("I give up, I can't find a citation") | ||
| .to_string(); | ||
| } else { | ||
| // This is (content, chunks) | ||
| message.content = message | ||
| .content | ||
| .rsplit("||") | ||
| .last() | ||
| .unwrap_or("I give up, I can't find a citation") | ||
| .to_string(); | ||
| } |
Member
Author
There was a problem hiding this comment.
This should with a strange combo of completion_first = true / false
bcfc050 to
c0cf518
Compare
completion_first = true
c0cf518 to
2981cf2
Compare
2981cf2 to
b4b4a95
Compare
Contributor
skeptrunedev
left a comment
There was a problem hiding this comment.
Looks great! Tested by cherry-pick'ing the frontend commit and duplicating the error then validating that this fixes it.
03e74fb to
037247c
Compare
skeptrunedev
approved these changes
Aug 24, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.