refactor ai serving modules and crates

This commit is contained in:
fawney19
2026-05-02 13:23:54 +08:00
parent 4fc7cecf30
commit c130d0e2c9
309 changed files with 21549 additions and 14265 deletions

View File

@@ -1,9 +1,8 @@
//! Legacy pairwise conversion exports.
//! Pairwise format conversion entry points.
//!
//! Primary routing lives under `crate::formats::<wire_format>` and must pass
//! through canonical IR. This module remains so older pipeline/gateway call
//! sites and focused golden tests can keep their existing function names while
//! the cleanup proceeds.
//! The public helpers in this module route through the registry, so request and
//! response conversion still pass through the typed canonical IR before a target
//! wire format is emitted.
pub mod request;
pub mod response;

View File

@@ -1,13 +1,8 @@
//! Pairwise request adapters kept for compatibility and focused tests.
//! Pairwise request conversion helpers.
//!
//! New request routing should use the registry so every conversion passes
//! through the typed canonical IR.
//! Legacy request conversion function names.
//!
//! This module is intentionally a compatibility facade. Real wire-format
//! parsing and emitting lives under `formats::<format>::request`, and all
//! conversion goes through the registry's canonical IR path.
//! These helpers keep the call sites readable while delegating wire-format
//! parsing and emitting to `formats::<format>::request` through the registry's
//! canonical IR path.
use serde_json::Value;
@@ -171,7 +166,7 @@ mod tests {
};
#[test]
fn legacy_request_facade_routes_through_registry() {
fn pairwise_request_helper_routes_through_registry() {
let body = json!({
"model": "gpt-source",
"messages": [{"role": "user", "content": "hello"}],
@@ -191,7 +186,7 @@ mod tests {
}
#[test]
fn legacy_request_facade_keeps_claude_alias_shape() {
fn pairwise_request_helper_keeps_claude_shape() {
let body = json!({
"model": "gpt-source",
"messages": [{"role": "user", "content": "hello"}],
@@ -206,7 +201,7 @@ mod tests {
}
#[test]
fn legacy_normalizer_uses_format_adapter() {
fn request_normalizer_uses_format_adapter() {
let body = json!({
"model": "claude-sonnet",
"messages": [{"role": "user", "content": [{"type": "text", "text": "hello"}]}],

View File

@@ -1,13 +1,8 @@
//! Pairwise response adapters kept for compatibility and focused tests.
//! Pairwise response conversion helpers.
//!
//! New response routing should use the registry so every conversion passes
//! through the typed canonical IR.
//! Legacy response conversion function names.
//!
//! This module is intentionally a compatibility facade. Real wire-format
//! parsing and emitting lives under `formats::<format>::response`, and all
//! conversion goes through the registry's canonical IR path.
//! These helpers keep the call sites readable while delegating wire-format
//! parsing and emitting to `formats::<format>::response` through the registry's
//! canonical IR path.
use serde_json::{json, Value};
@@ -260,7 +255,7 @@ mod tests {
};
#[test]
fn legacy_response_facade_routes_through_registry() {
fn pairwise_response_helper_routes_through_registry() {
let body = json!({
"id": "chatcmpl-test",
"object": "chat.completion",
@@ -281,7 +276,7 @@ mod tests {
}
#[test]
fn legacy_response_facade_uses_report_context_model_fallback() {
fn pairwise_response_helper_uses_report_context_model_fallback() {
let body = json!({
"id": "msg-test",
"type": "message",