mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-09 10:57:03 +08:00
migrate ai format conversion to responses adapters
This commit is contained in:
@@ -328,11 +328,8 @@ fn resolve_fixed_provider_endpoint_template<'a>(
|
||||
}
|
||||
|
||||
template.endpoints.iter().find(|item| {
|
||||
item.api_format
|
||||
.eq_ignore_ascii_case(updated_endpoint.api_format.trim())
|
||||
|| item
|
||||
.api_format
|
||||
.eq_ignore_ascii_case(existing_endpoint.api_format.trim())
|
||||
api_format_matches(item.api_format, updated_endpoint.api_format.trim())
|
||||
|| api_format_matches(item.api_format, existing_endpoint.api_format.trim())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -349,6 +346,19 @@ fn endpoint_matches_fixed_provider_template(
|
||||
.api_format
|
||||
.trim()
|
||||
.eq_ignore_ascii_case(endpoint_template.api_format)
|
||||
|| api_format_matches(&endpoint.api_format, endpoint_template.api_format)
|
||||
}
|
||||
|
||||
fn normalize_api_format_alias(value: &str) -> String {
|
||||
match value.trim().to_ascii_lowercase().as_str() {
|
||||
"openai:cli" => "openai:responses".to_string(),
|
||||
"openai:compact" => "openai:responses:compact".to_string(),
|
||||
other => other.to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
fn api_format_matches(left: &str, right: &str) -> bool {
|
||||
normalize_api_format_alias(left) == normalize_api_format_alias(right)
|
||||
}
|
||||
|
||||
fn fixed_provider_endpoint_metadata(
|
||||
|
||||
Reference in New Issue
Block a user