feat(ai): add comprehensive AI streaming and non-streaming processing services
This commit is contained in:
parent
fdca1fbf86
commit
4cc14687e0
@ -67,12 +67,10 @@ pub async fn process_message_ai_streaming(
|
||||
let ai_display_name_for_final = ai_display_name.clone();
|
||||
|
||||
let chunk_count = std::sync::Arc::new(std::sync::atomic::AtomicU64::new(0));
|
||||
let room_manager_cb = room_manager.clone();
|
||||
let queue_for_chunk = queue.clone();
|
||||
|
||||
let on_chunk = move |chunk: agent::chat::AiStreamChunk| {
|
||||
Box::pin({
|
||||
let room_manager = room_manager_cb.clone();
|
||||
let queue = queue_for_chunk.clone();
|
||||
let streaming_msg_id = streaming_msg_id;
|
||||
let room_id = room_id_inner;
|
||||
@ -102,7 +100,6 @@ pub async fn process_message_ai_streaming(
|
||||
chunk_type: Some(chunk_type_str.to_string()),
|
||||
};
|
||||
queue.publish_stream_chunk(&event).await;
|
||||
room_manager.broadcast_stream_chunk(event).await;
|
||||
}
|
||||
}) as Pin<Box<dyn std::future::Future<Output = ()> + Send>>
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user