@paean-ai/adk 0.2.26 → 0.2.28

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.
@@ -495,6 +495,7 @@ class Gemini extends BaseLlm {
495
495
  return new GeminiLlmConnection(liveSession);
496
496
  }
497
497
  preprocessRequest(llmRequest) {
498
+ var _a;
498
499
  if (this.apiBackend === GoogleLLMVariant.GEMINI_API) {
499
500
  if (llmRequest.config) {
500
501
  llmRequest.config.labels = void 0;
@@ -508,6 +509,22 @@ class Gemini extends BaseLlm {
508
509
  }
509
510
  }
510
511
  }
512
+ if (((_a = llmRequest.config) == null ? void 0 : _a.tools) && llmRequest.config.tools.length > 1) {
513
+ const hasBuiltInSearch = llmRequest.config.tools.some(
514
+ (t) => "googleSearch" in t || "googleSearchRetrieval" in t
515
+ );
516
+ const hasFunctionDeclarations = llmRequest.config.tools.some(
517
+ (t) => "functionDeclarations" in t
518
+ );
519
+ if (hasBuiltInSearch && hasFunctionDeclarations) {
520
+ logger.warn(
521
+ "Gemini API (AI Studio) does not support combining built-in search tools with custom function declarations. Removing built-in search tool from this request."
522
+ );
523
+ llmRequest.config.tools = llmRequest.config.tools.filter(
524
+ (t) => !("googleSearch" in t) && !("googleSearchRetrieval" in t)
525
+ );
526
+ }
527
+ }
511
528
  }
512
529
  }
513
530
  }
@@ -16,7 +16,7 @@ function getBooleanEnvVar(envVar) {
16
16
  return false;
17
17
  }
18
18
  const envVarValue = (process.env[envVar] || "").toLowerCase();
19
- return ["true", "1"].includes(envVar.toLowerCase());
19
+ return ["true", "1"].includes(envVarValue);
20
20
  }
21
21
  export {
22
22
  GoogleLLMVariant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paean-ai/adk",
3
- "version": "0.2.26",
3
+ "version": "0.2.28",
4
4
  "description": "Google ADK JS (paean-ai fork with streaming fixes)",
5
5
  "author": "paean-ai",
6
6
  "license": "Apache-2.0",