feat(gateway): 添加标准文本非流式心跳

This commit is contained in:
Entropy.Xu
2026-05-29 14:35:16 +08:00
parent 8bd82c8c95
commit bb5a4454a5
7 changed files with 924 additions and 9 deletions
@@ -1182,12 +1182,18 @@ fn build_json_whitespace_heartbeat_stream(
}
}
pub(crate) fn build_openai_image_sync_json_whitespace_heartbeat_stream(
pub(crate) fn build_sync_json_whitespace_heartbeat_stream(
rx: mpsc::Receiver<Result<Bytes, IoError>>,
) -> impl futures_util::Stream<Item = Result<Bytes, IoError>> + Send + 'static {
build_json_whitespace_heartbeat_stream(rx, OPENAI_IMAGE_SYNC_JSON_HEARTBEAT_INTERVAL, None)
}
pub(crate) fn build_openai_image_sync_json_whitespace_heartbeat_stream(
rx: mpsc::Receiver<Result<Bytes, IoError>>,
) -> impl futures_util::Stream<Item = Result<Bytes, IoError>> + Send + 'static {
build_sync_json_whitespace_heartbeat_stream(rx)
}
async fn openai_image_sync_json_heartbeat_final_bytes(
result: Result<Option<Response<Body>>, GatewayError>,
) -> Vec<u8> {
@@ -1,7 +1,8 @@
mod execution;
pub(crate) use execution::{
build_openai_image_sync_json_whitespace_heartbeat_stream, execute_execution_runtime_sync,
build_openai_image_sync_json_whitespace_heartbeat_stream,
build_sync_json_whitespace_heartbeat_stream, execute_execution_runtime_sync,
};
#[allow(unused_imports)]