Skip to content

Commit

Permalink
cleanup: handle ||[{ case in regenerate_message properly
Browse files Browse the repository at this point in the history
  • Loading branch information
skeptrunedev committed Aug 24, 2024
1 parent b4b4a95 commit 037247c
Show file tree
Hide file tree
Showing 2 changed files with 438 additions and 15 deletions.
9 changes: 8 additions & 1 deletion server/src/handlers/message_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,14 @@ pub async fn regenerate_message_patch(
.map(|message| {
let mut message = message;
if message.role == "assistant" {
if message.content.starts_with("[{") {
if message.content.starts_with("||[{") {
match message.content.rsplit_once("}]") {
Some((_, ai_message)) => {
message.content = ai_message.to_string();
}
_ => return message,
}
} else if message.content.starts_with("[{") {
// This is (chunks, content)
message.content = message
.content
Expand Down
Loading

0 comments on commit 037247c

Please sign in to comment.