This commit is contained in:
fawney19
2026-05-19 03:16:35 +08:00
77 changed files with 4051 additions and 333 deletions
@@ -0,0 +1,31 @@
use crate::ai_serving::resolve_openai_embedding_sync_spec as resolve_surface_sync_spec;
use crate::ai_serving::GatewayControlDecision;
use crate::{AiExecutionDecision, AppState, GatewayError};
use super::super::family::maybe_build_sync_via_standard_family_payload;
pub(crate) fn resolve_sync_spec(
plan_kind: &str,
) -> Option<super::super::family::LocalStandardSpec> {
resolve_surface_sync_spec(plan_kind)
}
pub(crate) async fn maybe_build_sync_local_openai_embedding_decision_payload(
state: &AppState,
parts: &http::request::Parts,
trace_id: &str,
decision: &GatewayControlDecision,
body_json: &serde_json::Value,
plan_kind: &str,
) -> Result<Option<AiExecutionDecision>, GatewayError> {
maybe_build_sync_via_standard_family_payload(
state,
parts,
trace_id,
decision,
body_json,
plan_kind,
resolve_sync_spec,
)
.await
}
@@ -1,5 +1,6 @@
mod chat;
mod image_intent;
mod embedding;
mod responses;
pub(crate) use crate::ai_serving::{
@@ -16,6 +17,7 @@ pub(crate) use chat::{
set_local_openai_chat_execution_exhausted_diagnostic,
};
pub(super) use image_intent::openai_request_is_image_generation_intent;
pub(crate) use embedding::maybe_build_sync_local_openai_embedding_decision_payload;
pub(crate) use responses::{
build_local_openai_responses_stream_attempt_source_for_kind,
build_local_openai_responses_stream_plan_and_reports_for_kind,