[router] responses api POST and GET with local storage (#10581)

Co-authored-by: key4ng <rukeyang@gmail.com>
This commit is contained in:
Simo Lin
2025-09-23 12:12:02 -04:00
committed by GitHub
parent ddab4fc7c7
commit 98c3b04ff2
14 changed files with 1158 additions and 176 deletions

View File

@@ -11,7 +11,7 @@ use std::fmt::Debug;
use crate::protocols::spec::{
ChatCompletionRequest, CompletionRequest, EmbeddingRequest, GenerateRequest, RerankRequest,
ResponsesRequest,
ResponsesGetParams, ResponsesRequest,
};
pub mod factory;
@@ -82,7 +82,12 @@ pub trait RouterTrait: Send + Sync + Debug {
) -> Response;
/// Retrieve a stored/background response by id
async fn get_response(&self, headers: Option<&HeaderMap>, response_id: &str) -> Response;
async fn get_response(
&self,
headers: Option<&HeaderMap>,
response_id: &str,
params: &ResponsesGetParams,
) -> Response;
/// Cancel a background response by id
async fn cancel_response(&self, headers: Option<&HeaderMap>, response_id: &str) -> Response;