Add a built-in Google Cloud Vertex AI provider (#56265)

- 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.

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
(cherry picked from commit 3fd148a20c)
This commit is contained in:
Celia Chen
2026-10-22 22:26:09 +00:00
parent fd591b6049
commit 6d52d01c88
32 changed files with 1329 additions and 60 deletions
@@ -43,6 +43,13 @@ class AmazonBedrockAccount(BaseModel):
] = False
class GcpAccount(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
type: Annotated[Literal["gcp"], Field(title="GcpAccountType")]
class AccountRoutingOverride(Enum):
no_constraint = "NO_CONSTRAINT"
us = "us"
@@ -6840,11 +6847,11 @@ class ChatgptAccount(BaseModel):
type: Annotated[Literal["chatgpt"], Field(title="ChatgptAccountType")]
class Account(RootModel[ApiKeyAccount | ChatgptAccount | AmazonBedrockAccount]):
class Account(RootModel[ApiKeyAccount | ChatgptAccount | AmazonBedrockAccount | GcpAccount]):
model_config = ConfigDict(
populate_by_name=True,
)
root: ApiKeyAccount | ChatgptAccount | AmazonBedrockAccount
root: ApiKeyAccount | ChatgptAccount | AmazonBedrockAccount | GcpAccount
class AccountLoginCompletedNotification(BaseModel):