@paean-ai/adk 0.2.28 → 0.2.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +10 -10
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/models/google_llm.js +23 -16
- package/dist/esm/index.js +10 -10
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/models/google_llm.js +23 -16
- package/dist/types/models/google_llm.d.ts +13 -6
- package/dist/web/index.js +1 -1
- package/dist/web/index.js.map +3 -3
- package/dist/web/models/google_llm.js +23 -16
- package/package.json +1 -1
|
@@ -61,7 +61,8 @@ class Gemini extends BaseLlm {
|
|
|
61
61
|
project,
|
|
62
62
|
location,
|
|
63
63
|
headers,
|
|
64
|
-
apiEndpoint
|
|
64
|
+
apiEndpoint,
|
|
65
|
+
vertexApiEndpoint
|
|
65
66
|
}) {
|
|
66
67
|
if (!model) {
|
|
67
68
|
model = "gemini-2.5-flash";
|
|
@@ -79,9 +80,15 @@ class Gemini extends BaseLlm {
|
|
|
79
80
|
if (!this.apiEndpoint && canReadEnv) {
|
|
80
81
|
this.apiEndpoint = process.env["GEMINI_API_ENDPOINT"];
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
this.vertexApiEndpoint = vertexApiEndpoint;
|
|
84
|
+
if (!this.vertexApiEndpoint && canReadEnv) {
|
|
85
|
+
this.vertexApiEndpoint = process.env["GEMINI_VERTEX_API_ENDPOINT"];
|
|
86
|
+
}
|
|
87
|
+
if (!this.vertexApiEndpoint && this.isGemini3Preview && !useAiStudioMode) {
|
|
88
|
+
this.vertexApiEndpoint = GEMINI3_PREVIEW_API_ENDPOINT;
|
|
89
|
+
logger.info(
|
|
90
|
+
"Using Gemini 3 preview endpoint: ".concat(this.vertexApiEndpoint)
|
|
91
|
+
);
|
|
85
92
|
}
|
|
86
93
|
let useVertexAI = !!vertexai;
|
|
87
94
|
if (!useVertexAI && canReadEnv) {
|
|
@@ -406,15 +413,14 @@ class Gemini extends BaseLlm {
|
|
|
406
413
|
});
|
|
407
414
|
} else {
|
|
408
415
|
const httpOptions = { headers: combinedHeaders };
|
|
409
|
-
if (this.
|
|
416
|
+
if (this.isGemini3Preview && this.vertexApiEndpoint) {
|
|
417
|
+
const isBuiltIn = this.vertexApiEndpoint === GEMINI3_PREVIEW_API_ENDPOINT;
|
|
418
|
+
httpOptions.baseUrl = isBuiltIn ? this.vertexApiEndpoint : "".concat(this.vertexApiEndpoint, "/v1/publishers/google");
|
|
419
|
+
httpOptions.apiVersion = "";
|
|
420
|
+
logger.debug("Gemini 3 preview endpoint: ".concat(httpOptions.baseUrl));
|
|
421
|
+
} else if (this.apiEndpoint) {
|
|
410
422
|
httpOptions.baseUrl = this.apiEndpoint;
|
|
411
|
-
logger.debug("
|
|
412
|
-
if (this.isGemini3Preview) {
|
|
413
|
-
httpOptions.apiVersion = "";
|
|
414
|
-
logger.info(
|
|
415
|
-
"Gemini 3 preview mode: using direct API path without version prefix"
|
|
416
|
-
);
|
|
417
|
-
}
|
|
423
|
+
logger.debug("API endpoint: ".concat(httpOptions.baseUrl));
|
|
418
424
|
}
|
|
419
425
|
this._apiClient = new GoogleGenAI({
|
|
420
426
|
apiKey: this.apiKey,
|
|
@@ -442,11 +448,12 @@ class Gemini extends BaseLlm {
|
|
|
442
448
|
headers: this.trackingHeaders,
|
|
443
449
|
apiVersion: this.liveApiVersion
|
|
444
450
|
};
|
|
445
|
-
if (this.
|
|
451
|
+
if (this.isGemini3Preview && this.vertexApiEndpoint) {
|
|
452
|
+
const isBuiltIn = this.vertexApiEndpoint === GEMINI3_PREVIEW_API_ENDPOINT;
|
|
453
|
+
httpOptions.baseUrl = isBuiltIn ? this.vertexApiEndpoint : "".concat(this.vertexApiEndpoint, "/v1/publishers/google");
|
|
454
|
+
httpOptions.apiVersion = "";
|
|
455
|
+
} else if (this.apiEndpoint) {
|
|
446
456
|
httpOptions.baseUrl = this.apiEndpoint;
|
|
447
|
-
if (this.isGemini3Preview) {
|
|
448
|
-
httpOptions.apiVersion = "";
|
|
449
|
-
}
|
|
450
457
|
}
|
|
451
458
|
this._liveApiClient = new GoogleGenAI({
|
|
452
459
|
apiKey: this.apiKey,
|