This commit is contained in:
joe.schwerdtner 2025-07-21 12:11:59 +02:00
parent caa4b529e4
commit 132f0dd36a
9 changed files with 1854 additions and 0 deletions

View file

@ -11,6 +11,7 @@ use crate::provider::{
cloud::{self, ZedDotDevSettings},
deepseek::DeepSeekSettings,
google::GoogleSettings,
google_vertex::GoogleVertexSettings,
lmstudio::LmStudioSettings,
mistral::MistralSettings,
ollama::OllamaSettings,
@ -31,6 +32,7 @@ pub struct AllLanguageModelSettings {
pub bedrock: AmazonBedrockSettings,
pub deepseek: DeepSeekSettings,
pub google: GoogleSettings,
pub google_vertex: GoogleVertexSettings,
pub lmstudio: LmStudioSettings,
pub mistral: MistralSettings,
pub ollama: OllamaSettings,
@ -47,6 +49,7 @@ pub struct AllLanguageModelSettingsContent {
pub bedrock: Option<AmazonBedrockSettingsContent>,
pub deepseek: Option<DeepseekSettingsContent>,
pub google: Option<GoogleSettingsContent>,
pub google_vertex: Option<GoogleVertexSettingsContent>,
pub lmstudio: Option<LmStudioSettingsContent>,
pub mistral: Option<MistralSettingsContent>,
pub ollama: Option<OllamaSettingsContent>,
@ -115,6 +118,14 @@ pub struct GoogleSettingsContent {
pub available_models: Option<Vec<provider::google::AvailableModel>>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
pub struct GoogleVertexSettingsContent {
pub api_url: Option<String>,
pub project_id: Option<String>, // ADDED
pub location_id: Option<String>, // ADDED
pub available_models: Option<Vec<provider::google_vertex::AvailableModel>>,
}
#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq, JsonSchema)]
pub struct XAiSettingsContent {
pub api_url: Option<String>,
@ -291,6 +302,26 @@ impl settings::Settings for AllLanguageModelSettings {
.as_ref()
.and_then(|s| s.available_models.clone()),
);
// Google Vertex AI
merge(
&mut settings.google_vertex.api_url,
value.google_vertex.as_ref().and_then(|s| s.api_url.clone()),
);
merge(
&mut settings.google_vertex.project_id,
value
.google_vertex
.as_ref()
.and_then(|s| s.project_id.clone()),
);
merge(
&mut settings.google_vertex.location_id,
value
.google_vertex
.as_ref()
.and_then(|s| s.location_id.clone()),
);
}
Ok(settings)