mirror of
https://github.com/openai/codex.git
synced 2026-11-07 20:30:33 +00:00
Add a built-in Google Cloud Vertex AI provider (#56265)
## What changed - Support `model_provider = "gcp"` with a Vertex AI endpoint derived from `GOOGLE_CLOUD_PROJECT` and `GOOGLE_CLOUD_LOCATION`, defaulting to the `global` location. - Obtain credentials through `gcloud auth application-default print-access-token` by default, and allow `base_url`, `auth`, and `http_headers` overrides under `model_providers.gcp`. - Use a static model catalog tailored to Vertex AI, preserve function tools, namespaces, and client-side tool search, and support remote compaction V2. Disable unsupported reasoning summaries, Responses Lite, custom tools, web search, and image generation. - Expose a `gcp` account type through the app-server protocol and generated clients without resolving credentials during account reads or requiring OpenAI authentication. ## Testing Add coverage for endpoint resolution, configuration overrides, model catalog filtering, authenticated requests, unsupported request fields, missing credentials, account reporting across provider changes, and automatic remote compaction. GitOrigin-RevId: 97a3158269e6dbc2605e2cf576998e09817ea12a
This commit is contained in:
@@ -41,6 +41,11 @@ pub enum Account {
|
||||
#[serde(default)]
|
||||
uses_codex_managed_credentials: bool,
|
||||
},
|
||||
|
||||
/// Google Cloud Vertex AI with externally managed credentials.
|
||||
#[serde(rename = "gcp", rename_all = "camelCase")]
|
||||
#[ts(rename = "gcp", rename_all = "camelCase")]
|
||||
Gcp {},
|
||||
}
|
||||
|
||||
impl From<ProviderAccount> for Account {
|
||||
@@ -53,6 +58,7 @@ impl From<ProviderAccount> for Account {
|
||||
} => Self::AmazonBedrock {
|
||||
uses_codex_managed_credentials,
|
||||
},
|
||||
ProviderAccount::Gcp => Self::Gcp {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user