mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-08 10:27:46 +08:00
Normalize endpoint API root handling
This commit is contained in:
@@ -378,7 +378,7 @@ async fn gateway_skips_unsupported_local_openai_chat_sync_candidate_before_tryin
|
||||
);
|
||||
assert_eq!(
|
||||
seen_execution_runtime_request.url,
|
||||
"https://api.openai.backup.example/v1/chat/completions"
|
||||
"https://api.openai.backup.example/chat/completions"
|
||||
);
|
||||
assert_eq!(
|
||||
seen_execution_runtime_request.model,
|
||||
@@ -1115,7 +1115,7 @@ async fn gateway_retries_next_local_openai_chat_sync_candidate_after_auth_failur
|
||||
);
|
||||
assert_eq!(
|
||||
seen_execution_runtime_requests[0].url,
|
||||
"https://api.openai.primary.example/v1/chat/completions"
|
||||
"https://api.openai.primary.example/chat/completions"
|
||||
);
|
||||
assert_eq!(
|
||||
seen_execution_runtime_requests[0].authorization,
|
||||
@@ -1123,7 +1123,7 @@ async fn gateway_retries_next_local_openai_chat_sync_candidate_after_auth_failur
|
||||
);
|
||||
assert_eq!(
|
||||
seen_execution_runtime_requests[1].url,
|
||||
"https://api.openai.backup.example/v1/chat/completions"
|
||||
"https://api.openai.backup.example/chat/completions"
|
||||
);
|
||||
assert_eq!(
|
||||
seen_execution_runtime_requests[1].model,
|
||||
|
||||
@@ -233,7 +233,7 @@ async fn proxy_pii_redaction_local_openai_chat_runtime_masks_headers_and_restore
|
||||
let seen_provider_request = Arc::new(Mutex::new(None::<SeenProviderRequest>));
|
||||
let seen_provider_request_clone = Arc::clone(&seen_provider_request);
|
||||
let provider_app = Router::new().route(
|
||||
"/v1/chat/completions",
|
||||
"/chat/completions",
|
||||
any(move |request: Request| {
|
||||
let seen_provider_request_inner = Arc::clone(&seen_provider_request_clone);
|
||||
async move {
|
||||
@@ -491,7 +491,7 @@ async fn gateway_executes_openai_chat_sync_via_local_decision_gate_without_execu
|
||||
)
|
||||
.expect("endpoint should build")
|
||||
.with_transport_fields(
|
||||
"https://api.openai.example".to_string(),
|
||||
"https://api.openai.example/v1".to_string(),
|
||||
None,
|
||||
None,
|
||||
Some(2),
|
||||
@@ -669,7 +669,7 @@ async fn gateway_executes_openai_chat_sync_via_local_decision_gate_without_execu
|
||||
let (upstream_url, upstream_handle) = start_server(upstream).await;
|
||||
let (provider_url, provider_handle) = start_server(provider).await;
|
||||
let mut primary_endpoint = sample_provider_catalog_endpoint();
|
||||
primary_endpoint.base_url = provider_url.clone();
|
||||
primary_endpoint.base_url = format!("{provider_url}/v1");
|
||||
let provider_catalog_repository = Arc::new(InMemoryProviderCatalogReadRepository::seed(
|
||||
vec![sample_provider_catalog_provider(), backup_provider],
|
||||
{
|
||||
@@ -871,7 +871,7 @@ async fn gateway_executes_openai_chat_sync_with_regex_model_mapping_in_execution
|
||||
)
|
||||
.expect("endpoint should build")
|
||||
.with_transport_fields(
|
||||
"https://api.openai.example".to_string(),
|
||||
"https://api.openai.example/v1".to_string(),
|
||||
None,
|
||||
None,
|
||||
Some(2),
|
||||
|
||||
@@ -308,7 +308,7 @@ async fn run_sync_redaction_case_with_system_config(
|
||||
let seen_provider_request = Arc::new(Mutex::new(None::<SeenProviderRequest>));
|
||||
let seen_provider_request_clone = Arc::clone(&seen_provider_request);
|
||||
let provider_app = Router::new().route(
|
||||
"/v1/chat/completions",
|
||||
"/chat/completions",
|
||||
any(move |request: Request| {
|
||||
let seen_provider_request_inner = Arc::clone(&seen_provider_request_clone);
|
||||
async move {
|
||||
@@ -631,7 +631,7 @@ async fn ai_execute_pii_redaction_restores_executed_candidate_session_after_late
|
||||
let seen_provider_request = Arc::new(Mutex::new(None::<SeenProviderRequest>));
|
||||
let seen_provider_request_clone = Arc::clone(&seen_provider_request);
|
||||
let provider_app = Router::new().route(
|
||||
"/v1/chat/completions",
|
||||
"/chat/completions",
|
||||
any(move |request: Request| {
|
||||
let seen_provider_request_inner = Arc::clone(&seen_provider_request_clone);
|
||||
async move {
|
||||
|
||||
@@ -486,7 +486,7 @@ async fn gateway_converts_gemini_image_sync_to_openai_image_provider_impl() {
|
||||
StoredProviderCatalogProvider::new(
|
||||
"provider-openai-image-bridge-1".to_string(),
|
||||
"openai".to_string(),
|
||||
Some("https://api.openai.com".to_string()),
|
||||
Some("https://api.openai.com/v1".to_string()),
|
||||
"openai".to_string(),
|
||||
)
|
||||
.expect("provider should build")
|
||||
@@ -514,7 +514,7 @@ async fn gateway_converts_gemini_image_sync_to_openai_image_provider_impl() {
|
||||
)
|
||||
.expect("endpoint should build")
|
||||
.with_transport_fields(
|
||||
"https://api.openai.com".to_string(),
|
||||
"https://api.openai.com/v1".to_string(),
|
||||
None,
|
||||
None,
|
||||
Some(2),
|
||||
|
||||
Reference in New Issue
Block a user