@google/adk 0.2.4 → 0.2.5

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.
Files changed (92) hide show
  1. package/dist/cjs/agents/base_agent.js +9 -3
  2. package/dist/cjs/agents/invocation_context.js +3 -1
  3. package/dist/cjs/agents/llm_agent.js +129 -75
  4. package/dist/cjs/agents/loop_agent.js +16 -5
  5. package/dist/cjs/agents/parallel_agent.js +17 -3
  6. package/dist/cjs/agents/readonly_context.js +4 -1
  7. package/dist/cjs/agents/sequential_agent.js +34 -12
  8. package/dist/cjs/code_executors/base_code_executor.js +12 -2
  9. package/dist/cjs/code_executors/built_in_code_executor.js +15 -3
  10. package/dist/cjs/common.js +41 -0
  11. package/dist/cjs/examples/base_example_provider.js +18 -2
  12. package/dist/cjs/examples/example_util.js +1 -1
  13. package/dist/cjs/index.js +11 -11
  14. package/dist/cjs/index.js.map +4 -4
  15. package/dist/cjs/plugins/base_plugin.js +59 -49
  16. package/dist/cjs/plugins/security_plugin.js +4 -1
  17. package/dist/cjs/runner/runner.js +34 -24
  18. package/dist/cjs/tools/agent_tool.js +18 -9
  19. package/dist/cjs/tools/base_tool.js +16 -6
  20. package/dist/cjs/tools/function_tool.js +14 -5
  21. package/dist/cjs/tools/google_search_tool.js +8 -3
  22. package/dist/cjs/tools/tool_context.js +4 -9
  23. package/dist/cjs/utils/gemini_schema_util.js +1 -0
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/agents/base_agent.js +9 -3
  26. package/dist/esm/agents/invocation_context.js +3 -1
  27. package/dist/esm/agents/llm_agent.js +165 -83
  28. package/dist/esm/agents/loop_agent.js +14 -4
  29. package/dist/esm/agents/parallel_agent.js +15 -2
  30. package/dist/esm/agents/readonly_context.js +4 -1
  31. package/dist/esm/agents/sequential_agent.js +33 -12
  32. package/dist/esm/code_executors/base_code_executor.js +10 -1
  33. package/dist/esm/code_executors/built_in_code_executor.js +13 -2
  34. package/dist/esm/common.js +53 -10
  35. package/dist/esm/examples/base_example_provider.js +16 -1
  36. package/dist/esm/examples/example_util.js +4 -2
  37. package/dist/esm/index.js +11 -11
  38. package/dist/esm/index.js.map +4 -4
  39. package/dist/esm/plugins/base_plugin.js +59 -49
  40. package/dist/esm/plugins/security_plugin.js +4 -1
  41. package/dist/esm/runner/runner.js +43 -27
  42. package/dist/esm/tools/agent_tool.js +17 -9
  43. package/dist/esm/tools/base_tool.js +14 -5
  44. package/dist/esm/tools/function_tool.js +13 -7
  45. package/dist/esm/tools/google_search_tool.js +9 -3
  46. package/dist/esm/tools/tool_context.js +4 -9
  47. package/dist/esm/utils/gemini_schema_util.js +1 -0
  48. package/dist/esm/version.js +1 -1
  49. package/dist/types/agents/base_agent.d.ts +14 -3
  50. package/dist/types/agents/invocation_context.d.ts +4 -2
  51. package/dist/types/agents/llm_agent.d.ts +42 -30
  52. package/dist/types/agents/loop_agent.d.ts +16 -0
  53. package/dist/types/agents/parallel_agent.d.ts +16 -0
  54. package/dist/types/agents/sequential_agent.d.ts +17 -1
  55. package/dist/types/auth/auth_schemes.d.ts +5 -2
  56. package/dist/types/code_executors/base_code_executor.d.ts +14 -0
  57. package/dist/types/code_executors/built_in_code_executor.d.ts +19 -0
  58. package/dist/types/common.d.ts +38 -14
  59. package/dist/types/examples/base_example_provider.d.ts +16 -0
  60. package/dist/types/plugins/base_plugin.d.ts +50 -40
  61. package/dist/types/runner/runner.d.ts +17 -9
  62. package/dist/types/tools/agent_tool.d.ts +14 -0
  63. package/dist/types/tools/base_tool.d.ts +14 -0
  64. package/dist/types/tools/function_tool.d.ts +14 -1
  65. package/dist/types/tools/google_search_tool.d.ts +3 -4
  66. package/dist/types/tools/tool_context.d.ts +1 -1
  67. package/dist/types/version.d.ts +1 -1
  68. package/dist/web/agents/base_agent.js +9 -3
  69. package/dist/web/agents/invocation_context.js +3 -1
  70. package/dist/web/agents/llm_agent.js +165 -83
  71. package/dist/web/agents/loop_agent.js +14 -4
  72. package/dist/web/agents/parallel_agent.js +15 -2
  73. package/dist/web/agents/readonly_context.js +4 -1
  74. package/dist/web/agents/sequential_agent.js +33 -12
  75. package/dist/web/code_executors/base_code_executor.js +10 -1
  76. package/dist/web/code_executors/built_in_code_executor.js +13 -2
  77. package/dist/web/common.js +53 -10
  78. package/dist/web/examples/base_example_provider.js +16 -1
  79. package/dist/web/examples/example_util.js +4 -2
  80. package/dist/web/index.js +1 -1
  81. package/dist/web/index.js.map +4 -4
  82. package/dist/web/plugins/base_plugin.js +59 -49
  83. package/dist/web/plugins/security_plugin.js +4 -1
  84. package/dist/web/runner/runner.js +44 -28
  85. package/dist/web/tools/agent_tool.js +17 -9
  86. package/dist/web/tools/base_tool.js +14 -5
  87. package/dist/web/tools/function_tool.js +13 -7
  88. package/dist/web/tools/google_search_tool.js +9 -3
  89. package/dist/web/tools/tool_context.js +4 -9
  90. package/dist/web/utils/gemini_schema_util.js +1 -0
  91. package/dist/web/version.js +1 -1
  92. package/package.json +2 -2
@@ -24,7 +24,8 @@ var __copyProps = (to, from, except, desc) => {
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var sequential_agent_exports = {};
26
26
  __export(sequential_agent_exports, {
27
- SequentialAgent: () => SequentialAgent
27
+ SequentialAgent: () => SequentialAgent,
28
+ isSequentialAgent: () => isSequentialAgent
28
29
  });
29
30
  module.exports = __toCommonJS(sequential_agent_exports);
30
31
  var import_function_tool = require("../tools/function_tool.js");
@@ -36,8 +37,22 @@ var import_readonly_context = require("./readonly_context.js");
36
37
  * Copyright 2025 Google LLC
37
38
  * SPDX-License-Identifier: Apache-2.0
38
39
  */
40
+ var _a, _b;
39
41
  const TASK_COMPLETED_TOOL_NAME = "task_completed";
40
- class SequentialAgent extends import_base_agent.BaseAgent {
42
+ const SEQUENTIAL_AGENT_SIGNATURE_SYMBOL = Symbol.for(
43
+ "google.adk.sequentialAgent"
44
+ );
45
+ function isSequentialAgent(obj) {
46
+ return typeof obj === "object" && obj !== null && SEQUENTIAL_AGENT_SIGNATURE_SYMBOL in obj && obj[SEQUENTIAL_AGENT_SIGNATURE_SYMBOL] === true;
47
+ }
48
+ class SequentialAgent extends (_b = import_base_agent.BaseAgent, _a = SEQUENTIAL_AGENT_SIGNATURE_SYMBOL, _b) {
49
+ constructor() {
50
+ super(...arguments);
51
+ /**
52
+ * A unique symbol to identify ADK sequential agent class.
53
+ */
54
+ this[_a] = true;
55
+ }
41
56
  async *runAsyncImpl(context) {
42
57
  for (const subAgent of this.subAgents) {
43
58
  for await (const event of subAgent.runAsync(context)) {
@@ -54,19 +69,25 @@ class SequentialAgent extends import_base_agent.BaseAgent {
54
69
  * the model can call this function to signal that it's finished the task and
55
70
  * we can move on to the next agent.
56
71
  *
57
- * @param context: The invocation context of the agent.
72
+ * @param context The invocation context of the agent.
58
73
  */
59
74
  async *runLiveImpl(context) {
60
75
  for (const subAgent of this.subAgents) {
61
- if (subAgent instanceof import_llm_agent.LlmAgent) {
62
- const agentTools = await subAgent.canonicalTools(new import_readonly_context.ReadonlyContext(context));
63
- const taskCompletedToolAlreadyAdded = agentTools.some((tool) => tool.name === TASK_COMPLETED_TOOL_NAME);
76
+ if ((0, import_llm_agent.isLlmAgent)(subAgent)) {
77
+ const agentTools = await subAgent.canonicalTools(
78
+ new import_readonly_context.ReadonlyContext(context)
79
+ );
80
+ const taskCompletedToolAlreadyAdded = agentTools.some(
81
+ (tool) => tool.name === TASK_COMPLETED_TOOL_NAME
82
+ );
64
83
  if (!taskCompletedToolAlreadyAdded) {
65
- subAgent.tools.push(new import_function_tool.FunctionTool({
66
- name: TASK_COMPLETED_TOOL_NAME,
67
- description: `Signals that the model has successfully completed the user's question or task.`,
68
- execute: () => "Task completion signaled."
69
- }));
84
+ subAgent.tools.push(
85
+ new import_function_tool.FunctionTool({
86
+ name: TASK_COMPLETED_TOOL_NAME,
87
+ description: `Signals that the model has successfully completed the user's question or task.`,
88
+ execute: () => "Task completion signaled."
89
+ })
90
+ );
70
91
  subAgent.instruction += `If you finished the user's request according to its description, call the ${TASK_COMPLETED_TOOL_NAME} function to exit so the next agents can take over. When calling this function, do not generate any text other than the function call.`;
71
92
  }
72
93
  }
@@ -80,5 +101,6 @@ class SequentialAgent extends import_base_agent.BaseAgent {
80
101
  }
81
102
  // Annotate the CommonJS export names for ESM import in node:
82
103
  0 && (module.exports = {
83
- SequentialAgent
104
+ SequentialAgent,
105
+ isSequentialAgent
84
106
  });
@@ -24,7 +24,8 @@ var __copyProps = (to, from, except, desc) => {
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var base_code_executor_exports = {};
26
26
  __export(base_code_executor_exports, {
27
- BaseCodeExecutor: () => BaseCodeExecutor
27
+ BaseCodeExecutor: () => BaseCodeExecutor,
28
+ isBaseCodeExecutor: () => isBaseCodeExecutor
28
29
  });
29
30
  module.exports = __toCommonJS(base_code_executor_exports);
30
31
  /**
@@ -32,8 +33,16 @@ module.exports = __toCommonJS(base_code_executor_exports);
32
33
  * Copyright 2025 Google LLC
33
34
  * SPDX-License-Identifier: Apache-2.0
34
35
  */
36
+ var _a;
37
+ const BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL = Symbol.for("google.adk.baseCodeExecutor");
38
+ function isBaseCodeExecutor(obj) {
39
+ return typeof obj === "object" && obj !== null && BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL in obj && obj[BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL] === true;
40
+ }
41
+ _a = BASE_CODE_EXECUTOR_SIGNATURE_SYMBOL;
35
42
  class BaseCodeExecutor {
36
43
  constructor() {
44
+ /** A unique symbol to identify BaseCodeExecutor class. */
45
+ this[_a] = true;
37
46
  /**
38
47
  * If true, extract and process data files from the model request
39
48
  * and attach them to the code executor.
@@ -72,5 +81,6 @@ class BaseCodeExecutor {
72
81
  }
73
82
  // Annotate the CommonJS export names for ESM import in node:
74
83
  0 && (module.exports = {
75
- BaseCodeExecutor
84
+ BaseCodeExecutor,
85
+ isBaseCodeExecutor
76
86
  });
@@ -24,7 +24,8 @@ var __copyProps = (to, from, except, desc) => {
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var built_in_code_executor_exports = {};
26
26
  __export(built_in_code_executor_exports, {
27
- BuiltInCodeExecutor: () => BuiltInCodeExecutor
27
+ BuiltInCodeExecutor: () => BuiltInCodeExecutor,
28
+ isBuiltInCodeExecutor: () => isBuiltInCodeExecutor
28
29
  });
29
30
  module.exports = __toCommonJS(built_in_code_executor_exports);
30
31
  var import_model_name = require("../utils/model_name.js");
@@ -34,7 +35,17 @@ var import_base_code_executor = require("./base_code_executor.js");
34
35
  * Copyright 2025 Google LLC
35
36
  * SPDX-License-Identifier: Apache-2.0
36
37
  */
37
- class BuiltInCodeExecutor extends import_base_code_executor.BaseCodeExecutor {
38
+ var _a, _b;
39
+ const BUILT_IN_CODE_EXECUTOR_SIGNATURE_SYMBOL = Symbol.for("google.adk.builtInCodeExecutor");
40
+ function isBuiltInCodeExecutor(obj) {
41
+ return typeof obj === "object" && obj !== null && BUILT_IN_CODE_EXECUTOR_SIGNATURE_SYMBOL in obj && obj[BUILT_IN_CODE_EXECUTOR_SIGNATURE_SYMBOL] === true;
42
+ }
43
+ class BuiltInCodeExecutor extends (_b = import_base_code_executor.BaseCodeExecutor, _a = BUILT_IN_CODE_EXECUTOR_SIGNATURE_SYMBOL, _b) {
44
+ constructor() {
45
+ super(...arguments);
46
+ /** A unique symbol to identify BuiltInCodeExecutor class. */
47
+ this[_a] = true;
48
+ }
38
49
  executeCode(params) {
39
50
  return Promise.resolve({
40
51
  stdout: "",
@@ -54,5 +65,6 @@ class BuiltInCodeExecutor extends import_base_code_executor.BaseCodeExecutor {
54
65
  }
55
66
  // Annotate the CommonJS export names for ESM import in node:
56
67
  0 && (module.exports = {
57
- BuiltInCodeExecutor
68
+ BuiltInCodeExecutor,
69
+ isBuiltInCodeExecutor
58
70
  });
@@ -25,9 +25,15 @@ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "defau
25
25
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
26
26
  var common_exports = {};
27
27
  __export(common_exports, {
28
+ ActiveStreamingTool: () => import_active_streaming_tool.ActiveStreamingTool,
28
29
  AgentTool: () => import_agent_tool.AgentTool,
30
+ AuthCredentialTypes: () => import_auth_credential.AuthCredentialTypes,
29
31
  BaseAgent: () => import_base_agent.BaseAgent,
32
+ BaseCodeExecutor: () => import_base_code_executor.BaseCodeExecutor,
33
+ BaseExampleProvider: () => import_base_example_provider.BaseExampleProvider,
30
34
  BaseLlm: () => import_base_llm.BaseLlm,
35
+ BaseLlmRequestProcessor: () => import_base_llm_processor.BaseLlmRequestProcessor,
36
+ BaseLlmResponseProcessor: () => import_base_llm_processor.BaseLlmResponseProcessor,
31
37
  BasePlugin: () => import_base_plugin.BasePlugin,
32
38
  BaseTool: () => import_base_tool.BaseTool,
33
39
  BaseToolset: () => import_base_toolset.BaseToolset,
@@ -36,6 +42,8 @@ __export(common_exports, {
36
42
  FunctionTool: () => import_function_tool.FunctionTool,
37
43
  GOOGLE_SEARCH: () => import_google_search_tool.GOOGLE_SEARCH,
38
44
  Gemini: () => import_google_llm.Gemini,
45
+ GoogleLLMVariant: () => import_variant_utils.GoogleLLMVariant,
46
+ GoogleSearchTool: () => import_google_search_tool.GoogleSearchTool,
39
47
  InMemoryArtifactService: () => import_in_memory_artifact_service.InMemoryArtifactService,
40
48
  InMemoryMemoryService: () => import_in_memory_memory_service.InMemoryMemoryService,
41
49
  InMemoryPolicyEngine: () => import_security_plugin.InMemoryPolicyEngine,
@@ -53,6 +61,7 @@ __export(common_exports, {
53
61
  PluginManager: () => import_plugin_manager.PluginManager,
54
62
  PolicyOutcome: () => import_security_plugin.PolicyOutcome,
55
63
  REQUEST_CONFIRMATION_FUNCTION_CALL_NAME: () => import_security_plugin.REQUEST_CONFIRMATION_FUNCTION_CALL_NAME,
64
+ ReadonlyContext: () => import_readonly_context.ReadonlyContext,
56
65
  Runner: () => import_runner.Runner,
57
66
  SecurityPlugin: () => import_security_plugin.SecurityPlugin,
58
67
  SequentialAgent: () => import_sequential_agent.SequentialAgent,
@@ -68,17 +77,27 @@ __export(common_exports, {
68
77
  getFunctionCalls: () => import_event.getFunctionCalls,
69
78
  getFunctionResponses: () => import_event.getFunctionResponses,
70
79
  hasTrailingCodeExecutionResult: () => import_event.hasTrailingCodeExecutionResult,
80
+ isAgentTool: () => import_agent_tool.isAgentTool,
71
81
  isBaseAgent: () => import_base_agent.isBaseAgent,
82
+ isBaseExampleProvider: () => import_base_example_provider.isBaseExampleProvider,
72
83
  isBaseLlm: () => import_base_llm.isBaseLlm,
84
+ isBaseTool: () => import_base_tool.isBaseTool,
73
85
  isFinalResponse: () => import_event.isFinalResponse,
86
+ isFunctionTool: () => import_function_tool.isFunctionTool,
74
87
  isGemini2OrAbove: () => import_model_name.isGemini2OrAbove,
88
+ isLlmAgent: () => import_llm_agent.isLlmAgent,
89
+ isLoopAgent: () => import_loop_agent.isLoopAgent,
90
+ isParallelAgent: () => import_parallel_agent.isParallelAgent,
91
+ isSequentialAgent: () => import_sequential_agent.isSequentialAgent,
75
92
  setLogLevel: () => import_logger.setLogLevel,
76
93
  stringifyContent: () => import_event.stringifyContent,
77
94
  version: () => import_version.version,
78
95
  zodObjectToSchema: () => import_simple_zod_to_json.zodObjectToSchema
79
96
  });
80
97
  module.exports = __toCommonJS(common_exports);
98
+ var import_active_streaming_tool = require("./agents/active_streaming_tool.js");
81
99
  var import_base_agent = require("./agents/base_agent.js");
100
+ var import_base_llm_processor = require("./agents/base_llm_processor.js");
82
101
  var import_callback_context = require("./agents/callback_context.js");
83
102
  var import_functions = require("./agents/functions.js");
84
103
  var import_invocation_context = require("./agents/invocation_context.js");
@@ -86,12 +105,16 @@ var import_live_request_queue = require("./agents/live_request_queue.js");
86
105
  var import_llm_agent = require("./agents/llm_agent.js");
87
106
  var import_loop_agent = require("./agents/loop_agent.js");
88
107
  var import_parallel_agent = require("./agents/parallel_agent.js");
108
+ var import_readonly_context = require("./agents/readonly_context.js");
89
109
  var import_run_config = require("./agents/run_config.js");
90
110
  var import_sequential_agent = require("./agents/sequential_agent.js");
91
111
  var import_in_memory_artifact_service = require("./artifacts/in_memory_artifact_service.js");
112
+ var import_auth_credential = require("./auth/auth_credential.js");
113
+ var import_base_code_executor = require("./code_executors/base_code_executor.js");
92
114
  var import_built_in_code_executor = require("./code_executors/built_in_code_executor.js");
93
115
  var import_event = require("./events/event.js");
94
116
  var import_event_actions = require("./events/event_actions.js");
117
+ var import_base_example_provider = require("./examples/base_example_provider.js");
95
118
  var import_in_memory_memory_service = require("./memory/in_memory_memory_service.js");
96
119
  var import_base_llm = require("./models/base_llm.js");
97
120
  var import_google_llm = require("./models/google_llm.js");
@@ -116,6 +139,7 @@ var import_tool_context = require("./tools/tool_context.js");
116
139
  var import_logger = require("./utils/logger.js");
117
140
  var import_model_name = require("./utils/model_name.js");
118
141
  var import_simple_zod_to_json = require("./utils/simple_zod_to_json.js");
142
+ var import_variant_utils = require("./utils/variant_utils.js");
119
143
  var import_version = require("./version.js");
120
144
  __reExport(common_exports, require("./artifacts/base_artifact_service.js"), module.exports);
121
145
  __reExport(common_exports, require("./memory/base_memory_service.js"), module.exports);
@@ -128,9 +152,15 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
128
152
  */
129
153
  // Annotate the CommonJS export names for ESM import in node:
130
154
  0 && (module.exports = {
155
+ ActiveStreamingTool,
131
156
  AgentTool,
157
+ AuthCredentialTypes,
132
158
  BaseAgent,
159
+ BaseCodeExecutor,
160
+ BaseExampleProvider,
133
161
  BaseLlm,
162
+ BaseLlmRequestProcessor,
163
+ BaseLlmResponseProcessor,
134
164
  BasePlugin,
135
165
  BaseTool,
136
166
  BaseToolset,
@@ -139,6 +169,8 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
139
169
  FunctionTool,
140
170
  GOOGLE_SEARCH,
141
171
  Gemini,
172
+ GoogleLLMVariant,
173
+ GoogleSearchTool,
142
174
  InMemoryArtifactService,
143
175
  InMemoryMemoryService,
144
176
  InMemoryPolicyEngine,
@@ -156,6 +188,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
156
188
  PluginManager,
157
189
  PolicyOutcome,
158
190
  REQUEST_CONFIRMATION_FUNCTION_CALL_NAME,
191
+ ReadonlyContext,
159
192
  Runner,
160
193
  SecurityPlugin,
161
194
  SequentialAgent,
@@ -171,10 +204,18 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
171
204
  getFunctionCalls,
172
205
  getFunctionResponses,
173
206
  hasTrailingCodeExecutionResult,
207
+ isAgentTool,
174
208
  isBaseAgent,
209
+ isBaseExampleProvider,
175
210
  isBaseLlm,
211
+ isBaseTool,
176
212
  isFinalResponse,
213
+ isFunctionTool,
177
214
  isGemini2OrAbove,
215
+ isLlmAgent,
216
+ isLoopAgent,
217
+ isParallelAgent,
218
+ isSequentialAgent,
178
219
  setLogLevel,
179
220
  stringifyContent,
180
221
  version,
@@ -24,7 +24,8 @@ var __copyProps = (to, from, except, desc) => {
24
24
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
25
25
  var base_example_provider_exports = {};
26
26
  __export(base_example_provider_exports, {
27
- BaseExampleProvider: () => BaseExampleProvider
27
+ BaseExampleProvider: () => BaseExampleProvider,
28
+ isBaseExampleProvider: () => isBaseExampleProvider
28
29
  });
29
30
  module.exports = __toCommonJS(base_example_provider_exports);
30
31
  /**
@@ -32,9 +33,24 @@ module.exports = __toCommonJS(base_example_provider_exports);
32
33
  * Copyright 2025 Google LLC
33
34
  * SPDX-License-Identifier: Apache-2.0
34
35
  */
36
+ var _a;
37
+ const BASE_EXAMPLE_PROVIDER_SIGNATURE_SYMBOL = Symbol.for(
38
+ "google.adk.baseExampleProvider"
39
+ );
40
+ function isBaseExampleProvider(obj) {
41
+ return typeof obj === "object" && obj !== null && BASE_EXAMPLE_PROVIDER_SIGNATURE_SYMBOL in obj && obj[BASE_EXAMPLE_PROVIDER_SIGNATURE_SYMBOL] === true;
42
+ }
43
+ _a = BASE_EXAMPLE_PROVIDER_SIGNATURE_SYMBOL;
35
44
  class BaseExampleProvider {
45
+ constructor() {
46
+ /**
47
+ * A unique symbol to identify ADK example provider classes.
48
+ */
49
+ this[_a] = true;
50
+ }
36
51
  }
37
52
  // Annotate the CommonJS export names for ESM import in node:
38
53
  0 && (module.exports = {
39
- BaseExampleProvider
54
+ BaseExampleProvider,
55
+ isBaseExampleProvider
40
56
  });
@@ -95,7 +95,7 @@ function buildExampleSi(examples, query, model) {
95
95
  if (Array.isArray(examples)) {
96
96
  return convertExamplesToText(examples, model);
97
97
  }
98
- if (examples instanceof import_base_example_provider.BaseExampleProvider) {
98
+ if ((0, import_base_example_provider.isBaseExampleProvider)(examples)) {
99
99
  return convertExamplesToText(examples.getExamples(query), model);
100
100
  }
101
101
  throw new Error("Invalid example configuration");