fix(ai): treat gcp vertex marker as ADC auth (#3221)

This commit is contained in:
deepkilo
2026-04-15 16:20:45 +02:00
committed by GitHub
parent c2c185a5e6
commit 3a13fa80c8
2 changed files with 21 additions and 1 deletions

View File

@@ -45,6 +45,7 @@ export interface GoogleVertexOptions extends StreamOptions {
}
const API_VERSION = "v1";
const GCP_VERTEX_CREDENTIALS_MARKER = "gcp-vertex-credentials";
const THINKING_LEVEL_MAP: Record<GoogleThinkingLevel, ThinkingLevel> = {
THINKING_LEVEL_UNSPECIFIED: ThinkingLevel.THINKING_LEVEL_UNSPECIFIED,
@@ -370,7 +371,7 @@ function createClientWithApiKey(
function resolveApiKey(options?: GoogleVertexOptions): string | undefined {
const apiKey = options?.apiKey?.trim() || process.env.GOOGLE_CLOUD_API_KEY?.trim();
if (!apiKey || isPlaceholderApiKey(apiKey)) {
if (!apiKey || apiKey === GCP_VERTEX_CREDENTIALS_MARKER || isPlaceholderApiKey(apiKey)) {
return undefined;
}
return apiKey;