mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-07 18:07:47 +08:00
merge(main): sync latest main into security branch
This commit is contained in:
@@ -21,8 +21,9 @@ pub use logic::{
|
||||
upstream_metadata_namespace_updates, ModelFetchRunSummary, ModelsFetchPage, ModelsFetchSuccess,
|
||||
};
|
||||
pub use strategy::{
|
||||
fetch_models_from_transports, fetch_models_from_transports_for_client_version,
|
||||
ModelFetchStrategy, ModelFetchStrategyKind, ModelsFetchOutcome, SelectedModelFetchStrategy,
|
||||
antigravity_model_id_is_routable, fetch_models_from_transports,
|
||||
fetch_models_from_transports_for_client_version, ModelFetchStrategy, ModelFetchStrategyKind,
|
||||
ModelsFetchOutcome, SelectedModelFetchStrategy,
|
||||
};
|
||||
pub use transport::{
|
||||
build_antigravity_fetch_available_models_plan, build_antigravity_load_code_assist_plan,
|
||||
|
||||
@@ -1346,7 +1346,7 @@ fn parse_antigravity_models_response(body: &Value) -> Result<(Vec<Value>, Option
|
||||
let mut quota_by_model = serde_json::Map::new();
|
||||
for (model_id, model_data) in models_object {
|
||||
let model_id = model_id.trim();
|
||||
if model_id.is_empty() || ANTIGRAVITY_BLOCKED_MODELS.contains(&model_id) {
|
||||
if !antigravity_model_id_is_routable(model_id) {
|
||||
continue;
|
||||
}
|
||||
let model_object = model_data.as_object().cloned().unwrap_or_default();
|
||||
@@ -1382,6 +1382,14 @@ fn parse_antigravity_models_response(body: &Value) -> Result<(Vec<Value>, Option
|
||||
Ok((models, upstream_metadata))
|
||||
}
|
||||
|
||||
pub fn antigravity_model_id_is_routable(model_id: &str) -> bool {
|
||||
let model_id = model_id.trim();
|
||||
!model_id.is_empty()
|
||||
&& !ANTIGRAVITY_BLOCKED_MODELS
|
||||
.iter()
|
||||
.any(|blocked| blocked.eq_ignore_ascii_case(model_id))
|
||||
}
|
||||
|
||||
fn parse_kiro_available_models_response(
|
||||
body: &Value,
|
||||
) -> Result<(Vec<Value>, Option<Value>), String> {
|
||||
|
||||
Reference in New Issue
Block a user