centralize openai responses alias handling

This commit is contained in:
fawney19
2026-04-26 21:47:01 +08:00
parent ea3dc3257e
commit 4ec591fbf2
52 changed files with 364 additions and 396 deletions

View File

@@ -7,6 +7,7 @@ repository.workspace = true
description = "Usage runtime shared types and queue primitives extracted from aether-gateway"
[dependencies]
aether-ai-formats.workspace = true
aether-contracts.workspace = true
aether-data.workspace = true
aether-data-contracts.workspace = true

View File

@@ -121,18 +121,18 @@ pub fn infer_internal_finalize_signature(payload: &GatewaySyncReportRequest) ->
}
pub fn resolve_internal_finalize_route(signature: &str) -> Option<InternalFinalizeRoute> {
match signature {
match aether_ai_formats::normalize_legacy_openai_format_alias(signature).as_str() {
"openai:chat" => Some(InternalFinalizeRoute {
public_path: "/v1/chat/completions",
route_family: "openai",
route_kind: "chat",
}),
"openai:responses" | "openai:cli" => Some(InternalFinalizeRoute {
"openai:responses" => Some(InternalFinalizeRoute {
public_path: "/v1/responses",
route_family: "openai",
route_kind: "responses",
}),
"openai:responses:compact" | "openai:compact" => Some(InternalFinalizeRoute {
"openai:responses:compact" => Some(InternalFinalizeRoute {
public_path: "/v1/responses/compact",
route_family: "openai",
route_kind: "responses:compact",