mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-04 16:37:46 +08:00
细化 Antigravity 测试模型项目元数据补全
This commit is contained in:
@@ -36,8 +36,8 @@ use crate::provider_key_auth::{
|
||||
use crate::provider_transport::antigravity::{
|
||||
build_antigravity_safe_v1internal_request, build_antigravity_static_identity_headers,
|
||||
classify_local_antigravity_request_support, AntigravityEnvelopeRequestType,
|
||||
AntigravityRequestEnvelopeSupport, AntigravityRequestSideSupport,
|
||||
AntigravityRequestSideUnsupportedReason,
|
||||
AntigravityRequestAuthUnsupportedReason, AntigravityRequestEnvelopeSupport,
|
||||
AntigravityRequestSideSupport, AntigravityRequestSideUnsupportedReason,
|
||||
};
|
||||
use crate::provider_transport::kiro::{
|
||||
build_kiro_generate_assistant_response_url, build_kiro_provider_headers,
|
||||
@@ -2061,7 +2061,7 @@ async fn provider_query_execute_openai_image_test_candidate(
|
||||
trace_id: &str,
|
||||
requested_model: &str,
|
||||
) -> Result<ProviderQueryExecutionOutcome, GatewayError> {
|
||||
let Some(transport) = state
|
||||
let Some(mut transport) = state
|
||||
.read_provider_transport_snapshot(&provider.id, &candidate.endpoint.id, &candidate.key.id)
|
||||
.await?
|
||||
else {
|
||||
@@ -2429,7 +2429,7 @@ async fn provider_query_execute_antigravity_test_candidate(
|
||||
trace_id: &str,
|
||||
requested_model: &str,
|
||||
) -> Result<ProviderQueryExecutionOutcome, GatewayError> {
|
||||
let Some(transport) = state
|
||||
let Some(mut transport) = state
|
||||
.read_provider_transport_snapshot(&provider.id, &candidate.endpoint.id, &candidate.key.id)
|
||||
.await?
|
||||
else {
|
||||
@@ -2463,11 +2463,34 @@ async fn provider_query_execute_antigravity_test_candidate(
|
||||
));
|
||||
};
|
||||
|
||||
let antigravity_spec = match classify_local_antigravity_request_support(
|
||||
let mut antigravity_support = classify_local_antigravity_request_support(
|
||||
&transport,
|
||||
&base_provider_request_body,
|
||||
AntigravityEnvelopeRequestType::EndpointTest,
|
||||
);
|
||||
if matches!(
|
||||
antigravity_support,
|
||||
AntigravityRequestSideSupport::Unsupported(
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(
|
||||
AntigravityRequestAuthUnsupportedReason::MissingProjectId
|
||||
)
|
||||
)
|
||||
) {
|
||||
if let Some(hydrated) = state
|
||||
.app()
|
||||
.hydrate_antigravity_project_metadata_for_transport(&transport)
|
||||
.await
|
||||
{
|
||||
transport = hydrated;
|
||||
antigravity_support = classify_local_antigravity_request_support(
|
||||
&transport,
|
||||
&base_provider_request_body,
|
||||
AntigravityEnvelopeRequestType::EndpointTest,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
let antigravity_spec = match antigravity_support {
|
||||
AntigravityRequestSideSupport::Supported(spec) => spec,
|
||||
AntigravityRequestSideSupport::Unsupported(reason) => {
|
||||
let reason = provider_query_antigravity_unsupported_reason(reason);
|
||||
|
||||
@@ -2,7 +2,8 @@ use super::DEFAULT_PROVIDER_QUERY_TEST_MESSAGE;
|
||||
use crate::handlers::admin::request::{AdminAppState, AdminGatewayProviderTransportSnapshot};
|
||||
use crate::provider_transport::antigravity::{
|
||||
classify_local_antigravity_request_support, AntigravityEnvelopeRequestType,
|
||||
AntigravityRequestSideSupport, AntigravityRequestSideUnsupportedReason,
|
||||
AntigravityRequestAuthUnsupportedReason, AntigravityRequestSideSupport,
|
||||
AntigravityRequestSideUnsupportedReason,
|
||||
};
|
||||
use crate::provider_transport::kiro::supports_local_kiro_request_transport_with_network;
|
||||
use serde_json::{json, Value};
|
||||
@@ -130,9 +131,21 @@ pub(super) fn provider_query_antigravity_unsupported_reason(
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedNetworkConfig => {
|
||||
"transport_network_config_unsupported"
|
||||
}
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(_) => {
|
||||
"transport_antigravity_auth_unsupported"
|
||||
}
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(
|
||||
AntigravityRequestAuthUnsupportedReason::WrongProviderType,
|
||||
) => "transport_provider_type_unsupported",
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(
|
||||
AntigravityRequestAuthUnsupportedReason::MissingAuthConfig,
|
||||
) => "transport_antigravity_auth_config_missing",
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(
|
||||
AntigravityRequestAuthUnsupportedReason::InvalidAuthConfigJson,
|
||||
) => "transport_antigravity_auth_config_invalid",
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(
|
||||
AntigravityRequestAuthUnsupportedReason::ComplexDynamicAuthConfig,
|
||||
) => "transport_antigravity_auth_config_unsupported",
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedAuth(
|
||||
AntigravityRequestAuthUnsupportedReason::MissingProjectId,
|
||||
) => "transport_antigravity_project_id_missing",
|
||||
AntigravityRequestSideUnsupportedReason::UnsupportedEnvelope(_) => {
|
||||
"transport_antigravity_envelope_unsupported"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user