-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: chunks get inserted in completion_first manner when completion_first = true #2245
bugfix: chunks get inserted in completion_first manner when completion_first = true #2245
Conversation
Arbiter::new().spawn(async move { | ||
let chunk_v: Vec<String> = r.iter().collect(); | ||
let completion = chunk_v.join(""); | ||
|
||
let message_to_be_stored = if completion_first { | ||
format!("{}{}", completion, chunk_metadatas_stringified) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.into_iter() | ||
.filter_map(|mut message| { | ||
if message.content.starts_with("||[{") { | ||
match message.content.rsplit_once("}]") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the format string }} = a single }. Not sure why they don't just do a } but yeah.
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(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Tested by cherry-pick'ing the frontend commit and duplicating the error then validating that this fixes it.
03e74fb
to
037247c
Compare
No description provided.