feat(openai): implement Responses API streaming and proactive routing
This commit adds support for the OpenAI Responses API in both streaming and non-streaming modes. It also implements proactive routing for gpt-5 and codex models and cleans up unused 'session' variable warnings across the dashboard source files.
This commit is contained in:
@@ -226,7 +226,15 @@ async fn chat_completions(
|
||||
let prompt_tokens = crate::utils::tokens::estimate_request_tokens(&model, &unified_request);
|
||||
|
||||
// Handle streaming response
|
||||
let stream_result = provider.chat_completion_stream(unified_request).await;
|
||||
// Allow provider-specific routing for streaming too
|
||||
let use_responses = provider.name() == "openai"
|
||||
&& crate::utils::registry::model_prefers_responses(&state.model_registry, &unified_request.model);
|
||||
|
||||
let stream_result = if use_responses {
|
||||
provider.chat_responses_stream(unified_request).await
|
||||
} else {
|
||||
provider.chat_completion_stream(unified_request).await
|
||||
};
|
||||
|
||||
match stream_result {
|
||||
Ok(stream) => {
|
||||
|
||||
Reference in New Issue
Block a user