refactor: separation of json-stream-parser to own crate

This commit is contained in:
Per Stark
2025-04-22 16:44:37 +02:00
parent 3fdee5a3a3
commit ce006f6ecc
8 changed files with 26 additions and 13 deletions

View File

@@ -21,6 +21,7 @@ use futures::{
stream::{self, once},
Stream, StreamExt, TryStreamExt,
};
use json_stream_parser::JsonStreamParser;
use minijinja::Value;
use serde::{Deserialize, Serialize};
use serde_json::from_str;
@@ -28,17 +29,14 @@ use surrealdb::{engine::any::Any, Surreal};
use tokio::sync::{mpsc::channel, Mutex};
use tracing::{debug, error};
use common::{
storage::{
db::SurrealDbClient,
types::{
conversation::Conversation,
message::{Message, MessageRole},
system_settings::SystemSettings,
user::User,
},
use common::storage::{
db::SurrealDbClient,
types::{
conversation::Conversation,
message::{Message, MessageRole},
system_settings::SystemSettings,
user::User,
},
utils::stream_parser::JsonStreamParser,
};
use crate::html_state::HtmlState;

View File

@@ -258,7 +258,7 @@ fn get_plot_html(
Ok(plot.to_html())
}
// Small utility to unzip tuple3 vectors from iterators (add this helper)
// Small utility to unzip tuple3 vectors from iterators
trait Unzip3<A, B, C> {
fn unzip3(self) -> (Vec<A>, Vec<B>, Vec<C>);
}