@google/adk 2.3.0 → 2.4.0
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/agents/agent_engine_client.js +172 -0
- package/dist/cjs/agents/base_agent.js +20 -4
- package/dist/cjs/agents/functions.js +28 -0
- package/dist/cjs/agents/instructions.js +2 -1
- package/dist/cjs/agents/llm_agent.js +19 -6
- package/dist/cjs/agents/processors/basic_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/code_execution_request_processor.js +8 -0
- package/dist/cjs/agents/processors/content_processor_utils.js +38 -10
- package/dist/cjs/agents/processors/content_request_processor.js +34 -2
- package/dist/cjs/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/cjs/agents/processors/nl_planning_processor.js +12 -3
- package/dist/cjs/cli/utils/logs.js +6 -6
- package/dist/cjs/code_executors/container_code_executor.js +27 -16
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +6 -1
- package/dist/cjs/common.js +9 -20
- package/dist/cjs/errors/input_validation_error.js +3 -2
- package/dist/cjs/index.js +9 -2
- package/dist/cjs/plugins/base_plugin.js +13 -23
- package/dist/cjs/sessions/base_session_service.js +14 -8
- package/dist/cjs/sessions/database_session_service.js +50 -28
- package/dist/cjs/sessions/stale_session_error.js +59 -0
- package/dist/cjs/skills/loader.js +52 -18
- package/dist/cjs/telemetry/setup.js +0 -1
- package/dist/cjs/telemetry/tracing.js +53 -10
- package/dist/cjs/tools/apihub_tool/apihub_toolset.js +18 -23
- package/dist/cjs/tools/application_integration_tool/application_integration_toolset.js +120 -42
- package/dist/cjs/tools/application_integration_tool/clients/connections_client.js +163 -95
- package/dist/cjs/tools/application_integration_tool/clients/integration_client.js +13 -9
- package/dist/cjs/tools/application_integration_tool/integration_connector_tool.js +184 -0
- package/dist/cjs/tools/google_api_tool/google_api_tool.js +4 -1
- package/dist/cjs/tools/google_api_tool/google_api_toolset.js +173 -0
- package/dist/cjs/tools/google_api_tool/google_api_toolsets.js +124 -0
- package/dist/cjs/tools/google_api_tool/googleapi_to_openapi_converter.js +2 -2
- package/dist/cjs/tools/google_api_tool/index.js +20 -23
- package/dist/cjs/tools/load_artifacts_tool.js +12 -6
- package/dist/cjs/tools/load_memory_tool.js +12 -10
- package/dist/cjs/tools/mcp/mcp_toolset.js +1 -14
- package/dist/cjs/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
- package/dist/cjs/tools/openapi_tool/openapi_toolset.js +7 -13
- package/dist/cjs/tools/openapi_tool/rest_api_tool.js +17 -1
- package/dist/cjs/tools/toolbox_toolset.js +174 -0
- package/dist/cjs/tools/webmcp/webmcp_toolset.js +1 -14
- package/dist/cjs/utils/client_labels.js +19 -2
- package/dist/cjs/utils/failover_utils.js +1 -1
- package/dist/cjs/utils/gemini_schema_util.js +24 -6
- package/dist/cjs/utils/logger_node.js +4 -0
- package/dist/cjs/utils/output_schema_utils.js +5 -2
- package/dist/cjs/utils/task.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/agents/agent_engine_client.js +144 -0
- package/dist/esm/agents/base_agent.js +20 -4
- package/dist/esm/agents/functions.js +28 -0
- package/dist/esm/agents/instructions.js +2 -1
- package/dist/esm/agents/llm_agent.js +19 -6
- package/dist/esm/agents/processors/basic_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/code_execution_request_processor.js +8 -0
- package/dist/esm/agents/processors/content_processor_utils.js +38 -10
- package/dist/esm/agents/processors/content_request_processor.js +34 -2
- package/dist/esm/agents/processors/instructions_llm_request_processor.js +1 -1
- package/dist/esm/agents/processors/nl_planning_processor.js +12 -3
- package/dist/esm/cli/utils/logs.js +4 -4
- package/dist/esm/code_executors/container_code_executor.js +27 -16
- package/dist/esm/code_executors/unsafe_local_code_executor.js +6 -1
- package/dist/esm/common.js +10 -13
- package/dist/esm/errors/input_validation_error.js +3 -2
- package/dist/esm/index.js +17 -3
- package/dist/esm/plugins/base_plugin.js +13 -23
- package/dist/esm/sessions/base_session_service.js +12 -7
- package/dist/esm/sessions/database_session_service.js +49 -28
- package/dist/esm/sessions/stale_session_error.js +31 -0
- package/dist/esm/skills/loader.js +51 -17
- package/dist/esm/telemetry/setup.js +1 -2
- package/dist/esm/telemetry/tracing.js +57 -11
- package/dist/esm/tools/apihub_tool/apihub_toolset.js +17 -22
- package/dist/esm/tools/application_integration_tool/application_integration_toolset.js +124 -42
- package/dist/esm/tools/application_integration_tool/clients/connections_client.js +163 -95
- package/dist/esm/tools/application_integration_tool/clients/integration_client.js +13 -9
- package/dist/esm/tools/application_integration_tool/integration_connector_tool.js +158 -0
- package/dist/esm/tools/google_api_tool/google_api_tool.js +4 -1
- package/dist/esm/tools/google_api_tool/google_api_toolset.js +146 -0
- package/dist/esm/tools/google_api_tool/google_api_toolsets.js +94 -0
- package/dist/esm/tools/google_api_tool/googleapi_to_openapi_converter.js +2 -2
- package/dist/esm/tools/google_api_tool/index.js +18 -20
- package/dist/esm/tools/load_artifacts_tool.js +10 -5
- package/dist/esm/tools/load_memory_tool.js +12 -10
- package/dist/esm/tools/mcp/mcp_toolset.js +1 -14
- package/dist/esm/tools/openapi_tool/auth/credential_exchangers/oauth2_exchanger.js +2 -2
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.js +20 -6
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/operation_parser.js +17 -6
- package/dist/esm/tools/openapi_tool/openapi_toolset.js +6 -12
- package/dist/esm/tools/openapi_tool/rest_api_tool.js +17 -1
- package/dist/esm/tools/toolbox_toolset.js +148 -0
- package/dist/esm/tools/webmcp/webmcp_toolset.js +1 -14
- package/dist/esm/utils/client_labels.js +19 -2
- package/dist/esm/utils/failover_utils.js +1 -1
- package/dist/esm/utils/gemini_schema_util.js +23 -6
- package/dist/esm/utils/logger_node.js +4 -0
- package/dist/esm/utils/output_schema_utils.js +5 -2
- package/dist/esm/utils/task.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/agents/agent_engine_client.d.ts +37 -0
- package/dist/types/agents/base_agent.d.ts +12 -0
- package/dist/types/agents/llm_agent.d.ts +5 -1
- package/dist/types/agents/processors/content_processor_utils.d.ts +4 -2
- package/dist/types/agents/processors/nl_planning_processor.d.ts +2 -1
- package/dist/types/cli/utils/logs.d.ts +1 -1
- package/dist/types/code_executors/container_code_executor.d.ts +17 -5
- package/dist/types/common.d.ts +5 -9
- package/dist/types/errors/input_validation_error.d.ts +2 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/plugins/base_plugin.d.ts +0 -10
- package/dist/types/sessions/base_session_service.d.ts +5 -0
- package/dist/types/sessions/database_session_service.d.ts +17 -1
- package/dist/types/sessions/stale_session_error.d.ts +21 -0
- package/dist/types/skills/loader.d.ts +3 -2
- package/dist/types/telemetry/tracing.d.ts +17 -3
- package/dist/types/tools/apihub_tool/apihub_toolset.d.ts +14 -21
- package/dist/types/tools/application_integration_tool/application_integration_toolset.d.ts +32 -9
- package/dist/types/tools/application_integration_tool/clients/connections_client.d.ts +22 -8
- package/dist/types/tools/application_integration_tool/clients/integration_client.d.ts +3 -3
- package/dist/types/tools/application_integration_tool/integration_connector_tool.d.ts +70 -0
- package/dist/types/tools/base_toolset.d.ts +6 -5
- package/dist/types/tools/google_api_tool/google_api_tool.d.ts +10 -3
- package/dist/types/tools/google_api_tool/google_api_toolset.d.ts +55 -0
- package/dist/types/tools/google_api_tool/google_api_toolsets.d.ts +48 -0
- package/dist/types/tools/google_api_tool/googleapi_to_openapi_converter.d.ts +5 -4
- package/dist/types/tools/google_api_tool/index.d.ts +4 -5
- package/dist/types/tools/load_artifacts_tool.d.ts +14 -1
- package/dist/types/tools/load_memory_tool.d.ts +23 -1
- package/dist/types/tools/openapi_tool/openapi_spec_parser/openapi_spec_parser.d.ts +12 -0
- package/dist/types/tools/openapi_tool/openapi_spec_parser/operation_parser.d.ts +8 -0
- package/dist/types/tools/openapi_tool/openapi_toolset.d.ts +5 -0
- package/dist/types/tools/openapi_tool/rest_api_tool.d.ts +10 -0
- package/dist/types/tools/toolbox_toolset.d.ts +159 -0
- package/dist/types/utils/client_labels.d.ts +2 -1
- package/dist/types/utils/gemini_schema_util.d.ts +8 -0
- package/dist/types/utils/output_schema_utils.d.ts +3 -2
- package/dist/types/utils/simple_zod_to_json.d.ts +1 -2
- package/dist/types/version.d.ts +1 -1
- package/dist/web/index_web.js +74 -66
- package/dist/web/index_web.js.map +4 -4
- package/package.json +34 -27
- package/dist/cjs/agents/remote_agent.js +0 -187
- package/dist/cjs/tools/crewai_tool.js +0 -132
- package/dist/cjs/tools/google_api_tool/google_api_tool_set.js +0 -226
- package/dist/cjs/tools/google_api_tool/google_api_tool_sets.js +0 -58
- package/dist/cjs/tools/langchain_tool.js +0 -172
- package/dist/cjs/tools/toolbox_tool.js +0 -108
- package/dist/esm/agents/remote_agent.js +0 -164
- package/dist/esm/tools/crewai_tool.js +0 -107
- package/dist/esm/tools/google_api_tool/google_api_tool_set.js +0 -188
- package/dist/esm/tools/google_api_tool/google_api_tool_sets.js +0 -24
- package/dist/esm/tools/langchain_tool.js +0 -148
- package/dist/esm/tools/toolbox_tool.js +0 -80
- package/dist/types/agents/remote_agent.d.ts +0 -68
- package/dist/types/tools/crewai_tool.d.ts +0 -85
- package/dist/types/tools/google_api_tool/google_api_tool_set.d.ts +0 -78
- package/dist/types/tools/google_api_tool/google_api_tool_sets.d.ts +0 -33
- package/dist/types/tools/langchain_tool.d.ts +0 -103
- package/dist/types/tools/toolbox_tool.d.ts +0 -73
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
10
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
11
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
13
|
+
var __export = (target, all) => {
|
|
14
|
+
for (var name in all)
|
|
15
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from))
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
21
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var agent_engine_client_exports = {};
|
|
27
|
+
__export(agent_engine_client_exports, {
|
|
28
|
+
AgentEngineClient: () => AgentEngineClient,
|
|
29
|
+
AgentExecutionError: () => AgentExecutionError
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(agent_engine_client_exports);
|
|
32
|
+
var import_aiplatform = require("@google-cloud/aiplatform");
|
|
33
|
+
/**
|
|
34
|
+
* @license
|
|
35
|
+
* Copyright 2026 Google LLC
|
|
36
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
37
|
+
*/
|
|
38
|
+
const _AgentExecutionError = class _AgentExecutionError extends Error {
|
|
39
|
+
constructor(message, cause) {
|
|
40
|
+
super(message);
|
|
41
|
+
this.cause = cause;
|
|
42
|
+
this.name = "AgentExecutionError";
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
__name(_AgentExecutionError, "AgentExecutionError");
|
|
46
|
+
let AgentExecutionError = _AgentExecutionError;
|
|
47
|
+
function buildInputStruct(config) {
|
|
48
|
+
var _a;
|
|
49
|
+
const value = import_aiplatform.helpers.toValue(config);
|
|
50
|
+
return (_a = value == null ? void 0 : value.structValue) != null ? _a : void 0;
|
|
51
|
+
}
|
|
52
|
+
__name(buildInputStruct, "buildInputStruct");
|
|
53
|
+
function parseOutput(output) {
|
|
54
|
+
return import_aiplatform.helpers.fromValue(output);
|
|
55
|
+
}
|
|
56
|
+
__name(parseOutput, "parseOutput");
|
|
57
|
+
function parseFragment(line) {
|
|
58
|
+
const trimmed = line.trim();
|
|
59
|
+
if (!trimmed) return void 0;
|
|
60
|
+
const payload = trimmed.startsWith("data:") ? trimmed.slice(5).trim() : trimmed;
|
|
61
|
+
if (payload === "[DONE]") return void 0;
|
|
62
|
+
try {
|
|
63
|
+
return JSON.parse(payload);
|
|
64
|
+
} catch (e) {
|
|
65
|
+
throw new AgentExecutionError(
|
|
66
|
+
`Failed to parse stream fragment: ${payload}`,
|
|
67
|
+
e
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
__name(parseFragment, "parseFragment");
|
|
72
|
+
async function* parseStream(stream) {
|
|
73
|
+
let buffer = "";
|
|
74
|
+
for await (const chunk of stream) {
|
|
75
|
+
const chunkData = chunk == null ? void 0 : chunk.data;
|
|
76
|
+
if (chunkData === void 0) {
|
|
77
|
+
if (typeof chunk === "object" && chunk !== null) {
|
|
78
|
+
yield chunk;
|
|
79
|
+
}
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const dataStr = chunkData instanceof Uint8Array ? new TextDecoder().decode(chunkData) : String(chunkData);
|
|
83
|
+
buffer += dataStr;
|
|
84
|
+
const lines = buffer.split("\n");
|
|
85
|
+
buffer = lines.pop() || "";
|
|
86
|
+
for (const line of lines) {
|
|
87
|
+
const fragment = parseFragment(line);
|
|
88
|
+
if (fragment !== void 0) {
|
|
89
|
+
yield fragment;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
const last = parseFragment(buffer);
|
|
94
|
+
if (last !== void 0) {
|
|
95
|
+
yield last;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
__name(parseStream, "parseStream");
|
|
99
|
+
const _AgentEngineClient = class _AgentEngineClient {
|
|
100
|
+
constructor(config) {
|
|
101
|
+
this.client = new import_aiplatform.v1.ReasoningEngineExecutionServiceClient({
|
|
102
|
+
apiEndpoint: `${config.location}-aiplatform.googleapis.com`
|
|
103
|
+
});
|
|
104
|
+
this.reasoningEnginePath = this.client.reasoningEnginePath(
|
|
105
|
+
config.project,
|
|
106
|
+
config.location,
|
|
107
|
+
config.reasoningEngineId
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Creates a remote session.
|
|
112
|
+
*
|
|
113
|
+
* @returns The `create_session` payload returned by the Agent Engine. When
|
|
114
|
+
* `config.sessionId` is omitted the engine generates one, and this is the
|
|
115
|
+
* only place the caller can read it back from.
|
|
116
|
+
*/
|
|
117
|
+
async createSession(config) {
|
|
118
|
+
try {
|
|
119
|
+
const [response] = await this.client.queryReasoningEngine({
|
|
120
|
+
name: this.reasoningEnginePath,
|
|
121
|
+
classMethod: "create_session",
|
|
122
|
+
input: buildInputStruct(config)
|
|
123
|
+
});
|
|
124
|
+
return response.output ? parseOutput(response.output) : void 0;
|
|
125
|
+
} catch (err) {
|
|
126
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
127
|
+
throw new AgentExecutionError(
|
|
128
|
+
`Failed to create session: ${message}`,
|
|
129
|
+
err
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async query(config) {
|
|
134
|
+
try {
|
|
135
|
+
const [response] = await this.client.queryReasoningEngine({
|
|
136
|
+
name: this.reasoningEnginePath,
|
|
137
|
+
classMethod: "query",
|
|
138
|
+
input: buildInputStruct(config)
|
|
139
|
+
});
|
|
140
|
+
return response.output ? parseOutput(response.output) : void 0;
|
|
141
|
+
} catch (err) {
|
|
142
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
143
|
+
throw new AgentExecutionError(`Failed to execute query: ${message}`, err);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async *streamQuery(config) {
|
|
147
|
+
try {
|
|
148
|
+
const stream = this.client.streamQueryReasoningEngine({
|
|
149
|
+
name: this.reasoningEnginePath,
|
|
150
|
+
classMethod: "query",
|
|
151
|
+
input: buildInputStruct(config)
|
|
152
|
+
});
|
|
153
|
+
yield* parseStream(stream);
|
|
154
|
+
} catch (err) {
|
|
155
|
+
if (err instanceof AgentExecutionError) {
|
|
156
|
+
throw err;
|
|
157
|
+
}
|
|
158
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
159
|
+
throw new AgentExecutionError(
|
|
160
|
+
`Failed to execute stream query: ${message}`,
|
|
161
|
+
err
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
__name(_AgentEngineClient, "AgentEngineClient");
|
|
167
|
+
let AgentEngineClient = _AgentEngineClient;
|
|
168
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
169
|
+
0 && (module.exports = {
|
|
170
|
+
AgentEngineClient,
|
|
171
|
+
AgentExecutionError
|
|
172
|
+
});
|
|
@@ -259,6 +259,22 @@ const _BaseAgent = class _BaseAgent extends (_b = import_base_node.BaseNode, _a
|
|
|
259
259
|
agent: this
|
|
260
260
|
});
|
|
261
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* The resolved beforeAgentCallback field as a list of SingleAgentCallback.
|
|
264
|
+
*
|
|
265
|
+
* This method is only for use by Agent Development Kit.
|
|
266
|
+
*/
|
|
267
|
+
get canonicalBeforeAgentCallbacks() {
|
|
268
|
+
return this.beforeAgentCallback;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The resolved afterAgentCallback field as a list of SingleAgentCallback.
|
|
272
|
+
*
|
|
273
|
+
* This method is only for use by Agent Development Kit.
|
|
274
|
+
*/
|
|
275
|
+
get canonicalAfterAgentCallbacks() {
|
|
276
|
+
return this.afterAgentCallback;
|
|
277
|
+
}
|
|
262
278
|
/**
|
|
263
279
|
* Runs the before agent callback if it exists.
|
|
264
280
|
*
|
|
@@ -268,11 +284,11 @@ const _BaseAgent = class _BaseAgent extends (_b = import_base_node.BaseNode, _a
|
|
|
268
284
|
*/
|
|
269
285
|
async handleBeforeAgentCallback(invocationContext) {
|
|
270
286
|
var _a2;
|
|
271
|
-
if (this.
|
|
287
|
+
if (this.canonicalBeforeAgentCallbacks.length === 0) {
|
|
272
288
|
return void 0;
|
|
273
289
|
}
|
|
274
290
|
const callbackContext = new import_context.Context({ invocationContext });
|
|
275
|
-
for (const callback of this.
|
|
291
|
+
for (const callback of this.canonicalBeforeAgentCallbacks) {
|
|
276
292
|
const content = await callback(callbackContext);
|
|
277
293
|
if ((_a2 = invocationContext.abortSignal) == null ? void 0 : _a2.aborted) {
|
|
278
294
|
return;
|
|
@@ -307,11 +323,11 @@ const _BaseAgent = class _BaseAgent extends (_b = import_base_node.BaseNode, _a
|
|
|
307
323
|
*/
|
|
308
324
|
async handleAfterAgentCallback(invocationContext) {
|
|
309
325
|
var _a2;
|
|
310
|
-
if (this.
|
|
326
|
+
if (this.canonicalAfterAgentCallbacks.length === 0) {
|
|
311
327
|
return void 0;
|
|
312
328
|
}
|
|
313
329
|
const callbackContext = new import_context.Context({ invocationContext });
|
|
314
|
-
for (const callback of this.
|
|
330
|
+
for (const callback of this.canonicalAfterAgentCallbacks) {
|
|
315
331
|
const content = await callback(callbackContext);
|
|
316
332
|
if ((_a2 = invocationContext.abortSignal) == null ? void 0 : _a2.aborted) {
|
|
317
333
|
return;
|
|
@@ -172,21 +172,49 @@ async function callToolAsync(tool, args, toolContext) {
|
|
|
172
172
|
(0, import_tracing.traceToolCall)({
|
|
173
173
|
tool,
|
|
174
174
|
args,
|
|
175
|
+
span,
|
|
175
176
|
functionResponseEvent: buildResponseEvent(
|
|
176
177
|
tool,
|
|
177
178
|
result,
|
|
178
179
|
toolContext,
|
|
179
180
|
toolContext.invocationContext
|
|
180
181
|
),
|
|
182
|
+
errorType: getToolResponseErrorType(result),
|
|
181
183
|
invocationContext: toolContext.invocationContext
|
|
182
184
|
});
|
|
183
185
|
return result;
|
|
186
|
+
} catch (error) {
|
|
187
|
+
(0, import_tracing.traceToolCall)({
|
|
188
|
+
tool,
|
|
189
|
+
args,
|
|
190
|
+
span,
|
|
191
|
+
error,
|
|
192
|
+
invocationContext: toolContext.invocationContext
|
|
193
|
+
});
|
|
194
|
+
throw error;
|
|
184
195
|
} finally {
|
|
185
196
|
span.end();
|
|
186
197
|
}
|
|
187
198
|
});
|
|
188
199
|
}
|
|
189
200
|
__name(callToolAsync, "callToolAsync");
|
|
201
|
+
function getToolResponseErrorType(result) {
|
|
202
|
+
var _a2;
|
|
203
|
+
if (result === null || typeof result !== "object" || Array.isArray(result)) {
|
|
204
|
+
return void 0;
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
if (!Object.hasOwn(result, "error")) {
|
|
208
|
+
return void 0;
|
|
209
|
+
}
|
|
210
|
+
const response = result;
|
|
211
|
+
const errorType = (_a2 = response.errorType) != null ? _a2 : response.error_type;
|
|
212
|
+
return typeof errorType === "string" ? errorType : void 0;
|
|
213
|
+
} catch {
|
|
214
|
+
return void 0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
__name(getToolResponseErrorType, "getToolResponseErrorType");
|
|
190
218
|
function buildResponseEvent(tool, functionResult, toolContext, invocationContext) {
|
|
191
219
|
let responseResult;
|
|
192
220
|
if (typeof functionResult !== "object" || functionResult == null) {
|
|
@@ -29,6 +29,7 @@ __export(instructions_exports, {
|
|
|
29
29
|
});
|
|
30
30
|
module.exports = __toCommonJS(instructions_exports);
|
|
31
31
|
var import_state = require("../sessions/state.js");
|
|
32
|
+
var import_load_artifacts_tool = require("../tools/load_artifacts_tool.js");
|
|
32
33
|
/**
|
|
33
34
|
* @license
|
|
34
35
|
* Copyright 2025 Google LLC
|
|
@@ -62,7 +63,7 @@ async function resolveKey(key, isOptional, rawMatch, readonlyContext) {
|
|
|
62
63
|
}
|
|
63
64
|
throw new Error(`Artifact ${fileName} not found.`);
|
|
64
65
|
}
|
|
65
|
-
return formatValue(artifact, true);
|
|
66
|
+
return formatValue((0, import_load_artifacts_tool.asSafePartForLlm)(artifact, fileName), true);
|
|
66
67
|
}
|
|
67
68
|
if (isValidStateName(key)) {
|
|
68
69
|
if (key in invocationContext.session.state) {
|
|
@@ -43,6 +43,7 @@ var import_base_llm = require("../models/base_llm.js");
|
|
|
43
43
|
var import_registry = require("../models/registry.js");
|
|
44
44
|
var import_built_in_planner = require("../planners/built_in_planner.js");
|
|
45
45
|
var import_base_tool = require("../tools/base_tool.js");
|
|
46
|
+
var import_base_toolset = require("../tools/base_toolset.js");
|
|
46
47
|
var import_logger = require("../utils/logger.js");
|
|
47
48
|
var import_output_schema_utils = require("../utils/output_schema_utils.js");
|
|
48
49
|
var import_context = require("./context.js");
|
|
@@ -658,7 +659,7 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
658
659
|
}
|
|
659
660
|
}
|
|
660
661
|
async *runLivePreprocess(invocationContext, llmRequest) {
|
|
661
|
-
var _a2, _b2;
|
|
662
|
+
var _a2, _b2, _c;
|
|
662
663
|
for (const processor of this.requestProcessors) {
|
|
663
664
|
for await (const event of processor.runAsync(
|
|
664
665
|
invocationContext,
|
|
@@ -672,6 +673,12 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
672
673
|
}
|
|
673
674
|
for (const toolUnion of this.tools) {
|
|
674
675
|
const toolContext = new import_context.Context({ invocationContext });
|
|
676
|
+
if ((0, import_base_toolset.isBaseToolset)(toolUnion)) {
|
|
677
|
+
await toolUnion.processLlmRequest(toolContext, llmRequest);
|
|
678
|
+
if ((_b2 = invocationContext.abortSignal) == null ? void 0 : _b2.aborted) {
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
675
682
|
const tools = (await convertToolUnionToTools(
|
|
676
683
|
toolUnion,
|
|
677
684
|
new import_readonly_context.ReadonlyContext(invocationContext)
|
|
@@ -680,7 +687,7 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
680
687
|
);
|
|
681
688
|
for (const tool of tools) {
|
|
682
689
|
await tool.processLlmRequest({ toolContext, llmRequest });
|
|
683
|
-
if ((
|
|
690
|
+
if ((_c = invocationContext.abortSignal) == null ? void 0 : _c.aborted) {
|
|
684
691
|
return;
|
|
685
692
|
}
|
|
686
693
|
}
|
|
@@ -903,7 +910,7 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
903
910
|
yield functionResponseEvent;
|
|
904
911
|
}
|
|
905
912
|
async *runOneStepAsync(invocationContext) {
|
|
906
|
-
var _a2, _b2, _c;
|
|
913
|
+
var _a2, _b2, _c, _d;
|
|
907
914
|
const llmRequest = {
|
|
908
915
|
contents: [],
|
|
909
916
|
toolsDict: {},
|
|
@@ -923,7 +930,7 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
923
930
|
const allTools = [...this.tools];
|
|
924
931
|
if (this.mode === "task") {
|
|
925
932
|
allTools.push(this.finishTaskTool);
|
|
926
|
-
} else if (this.outputSchema && allTools.length > 0 && !(0, import_output_schema_utils.canUseOutputSchemaWithTools)(this.canonicalModel
|
|
933
|
+
} else if (this.outputSchema && allTools.length > 0 && !(0, import_output_schema_utils.canUseOutputSchemaWithTools)(this.canonicalModel)) {
|
|
927
934
|
const setModelResponseTool = new import_function_tool.FunctionTool({
|
|
928
935
|
name: "set_model_response",
|
|
929
936
|
description: "Call this tool to submit your final response conforming to the output schema. Use this tool only when you have collected all the information and are ready to return the final answer.",
|
|
@@ -947,6 +954,12 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
947
954
|
invocationContext,
|
|
948
955
|
eventActions: modelResponseEvent.actions
|
|
949
956
|
});
|
|
957
|
+
if ((0, import_base_toolset.isBaseToolset)(toolUnion)) {
|
|
958
|
+
await toolUnion.processLlmRequest(toolContext, llmRequest);
|
|
959
|
+
if ((_b2 = invocationContext.abortSignal) == null ? void 0 : _b2.aborted) {
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
950
963
|
const tools = (await convertToolUnionToTools(
|
|
951
964
|
toolUnion,
|
|
952
965
|
new import_readonly_context.ReadonlyContext(invocationContext)
|
|
@@ -955,12 +968,12 @@ const _LlmAgent = class _LlmAgent extends (_b = import_base_agent.BaseAgent, _a
|
|
|
955
968
|
});
|
|
956
969
|
for (const tool of tools) {
|
|
957
970
|
await tool.processLlmRequest({ toolContext, llmRequest });
|
|
958
|
-
if ((
|
|
971
|
+
if ((_c = invocationContext.abortSignal) == null ? void 0 : _c.aborted) {
|
|
959
972
|
return;
|
|
960
973
|
}
|
|
961
974
|
}
|
|
962
975
|
}
|
|
963
|
-
if (invocationContext.endInvocation || ((
|
|
976
|
+
if (invocationContext.endInvocation || ((_d = invocationContext.abortSignal) == null ? void 0 : _d.aborted)) {
|
|
964
977
|
return;
|
|
965
978
|
}
|
|
966
979
|
const span = import_tracing.tracer.startSpan("call_llm");
|
|
@@ -55,7 +55,7 @@ const _BasicLlmRequestProcessor = class _BasicLlmRequestProcessor extends import
|
|
|
55
55
|
}
|
|
56
56
|
llmRequest.model = agent.canonicalModel.model;
|
|
57
57
|
llmRequest.config = { ...(_a = agent.generateContentConfig) != null ? _a : {} };
|
|
58
|
-
if (agent.outputSchema && agent.mode !== "task" && (!((_b = agent.tools) == null ? void 0 : _b.length) || (0, import_output_schema_utils.canUseOutputSchemaWithTools)(agent.canonicalModel
|
|
58
|
+
if (agent.outputSchema && agent.mode !== "task" && (!((_b = agent.tools) == null ? void 0 : _b.length) || (0, import_output_schema_utils.canUseOutputSchemaWithTools)(agent.canonicalModel))) {
|
|
59
59
|
(0, import_llm_request.setOutputSchema)(llmRequest, agent.outputSchema);
|
|
60
60
|
}
|
|
61
61
|
if (invocationContext.runConfig) {
|
|
@@ -83,6 +83,14 @@ const DATA_FILE_UTIL_MAP = {
|
|
|
83
83
|
const DATA_FILE_HELPER_LIB = `
|
|
84
84
|
import pandas as pd
|
|
85
85
|
|
|
86
|
+
def crop(s: str, max_chars: int = 64) -> str:
|
|
87
|
+
"""Crops a string to max_chars characters."""
|
|
88
|
+
if len(s) <= max_chars:
|
|
89
|
+
return s
|
|
90
|
+
if max_chars >= 3:
|
|
91
|
+
return s[:max_chars - 3] + '...'
|
|
92
|
+
return s[:max_chars]
|
|
93
|
+
|
|
86
94
|
def explore_df(df: pd.DataFrame) -> None:
|
|
87
95
|
"""Prints some information about a pandas DataFrame."""
|
|
88
96
|
|
|
@@ -56,7 +56,7 @@ function removeClientFunctionCallId(content) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
__name(removeClientFunctionCallId, "removeClientFunctionCallId");
|
|
59
|
-
function getContents(events, agentName, currentBranch, currentIsolationScope) {
|
|
59
|
+
function getContents(events, agentName, currentBranch, currentIsolationScope, preserveFunctionCallIds = false) {
|
|
60
60
|
const filteredEvents = [];
|
|
61
61
|
for (const event of events) {
|
|
62
62
|
if (!(0, import_compaction_utils.isEventVisibleInIsolationScope)(event, currentIsolationScope)) {
|
|
@@ -69,16 +69,23 @@ function getContents(events, agentName, currentBranch, currentIsolationScope) {
|
|
|
69
69
|
if (!shouldIncludeEventInContext(event, currentBranch, currentIsolationScope)) {
|
|
70
70
|
continue;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
72
|
+
if (isEventFromAnotherAgent(agentName, event)) {
|
|
73
|
+
const converted = convertForeignEvent(event);
|
|
74
|
+
if (converted) {
|
|
75
|
+
filteredEvents.push(converted);
|
|
76
|
+
}
|
|
77
|
+
} else {
|
|
78
|
+
filteredEvents.push(event);
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
let resultEvents = rearrangeEventsForLatestFunctionResponse(filteredEvents);
|
|
77
82
|
resultEvents = rearrangeEventsForAsyncFunctionResponsesInHistory(resultEvents);
|
|
78
83
|
const contents = [];
|
|
79
84
|
for (const event of resultEvents) {
|
|
80
85
|
const content = (0, import_lodash_es.cloneDeep)(event.content);
|
|
81
|
-
|
|
86
|
+
if (!preserveFunctionCallIds) {
|
|
87
|
+
removeClientFunctionCallId(content);
|
|
88
|
+
}
|
|
82
89
|
contents.push(content);
|
|
83
90
|
}
|
|
84
91
|
return contents;
|
|
@@ -111,18 +118,20 @@ function isRequestInputEvent(event) {
|
|
|
111
118
|
return false;
|
|
112
119
|
}
|
|
113
120
|
__name(isRequestInputEvent, "isRequestInputEvent");
|
|
114
|
-
function getCurrentTurnContents(events, agentName, currentBranch, currentIsolationScope) {
|
|
121
|
+
function getCurrentTurnContents(events, agentName, currentBranch, currentIsolationScope, preserveFunctionCallIds = false) {
|
|
122
|
+
var _a;
|
|
115
123
|
for (let i = events.length - 1; i >= 0; i--) {
|
|
116
124
|
const event = events[i];
|
|
117
125
|
if (!shouldIncludeEventInContext(event, currentBranch, currentIsolationScope)) {
|
|
118
126
|
continue;
|
|
119
127
|
}
|
|
120
|
-
if (event.author === "user" || isEventFromAnotherAgent(agentName, event)) {
|
|
128
|
+
if (event.author === "user" || isEventFromAnotherAgent(agentName, event) && ((_a = event.content.parts) == null ? void 0 : _a.some(isVisibleForeignPart))) {
|
|
121
129
|
return getContents(
|
|
122
130
|
events.slice(turnStart(events, i)),
|
|
123
131
|
agentName,
|
|
124
132
|
currentBranch,
|
|
125
|
-
currentIsolationScope
|
|
133
|
+
currentIsolationScope,
|
|
134
|
+
preserveFunctionCallIds
|
|
126
135
|
);
|
|
127
136
|
}
|
|
128
137
|
}
|
|
@@ -187,6 +196,13 @@ function isEventFromAnotherAgent(agentName, event) {
|
|
|
187
196
|
return !!agentName && event.author !== agentName && event.author !== "user";
|
|
188
197
|
}
|
|
189
198
|
__name(isEventFromAnotherAgent, "isEventFromAnotherAgent");
|
|
199
|
+
function isVisibleForeignPart(part) {
|
|
200
|
+
if (part.functionCall || part.functionResponse) {
|
|
201
|
+
return true;
|
|
202
|
+
}
|
|
203
|
+
return !part.thought && part.text !== "";
|
|
204
|
+
}
|
|
205
|
+
__name(isVisibleForeignPart, "isVisibleForeignPart");
|
|
190
206
|
function convertForeignEvent(event) {
|
|
191
207
|
var _a, _b, _c, _d, _e, _f;
|
|
192
208
|
if (!((_b = (_a = event.content) == null ? void 0 : _a.parts) == null ? void 0 : _b.length)) {
|
|
@@ -201,7 +217,10 @@ function convertForeignEvent(event) {
|
|
|
201
217
|
]
|
|
202
218
|
};
|
|
203
219
|
for (const part of event.content.parts) {
|
|
204
|
-
if (
|
|
220
|
+
if (!isVisibleForeignPart(part)) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
if (part.text) {
|
|
205
224
|
(_c = content.parts) == null ? void 0 : _c.push({
|
|
206
225
|
text: `[${event.author}] said: ${part.text}`
|
|
207
226
|
});
|
|
@@ -218,9 +237,18 @@ function convertForeignEvent(event) {
|
|
|
218
237
|
)}`
|
|
219
238
|
});
|
|
220
239
|
} else {
|
|
221
|
-
|
|
240
|
+
const {
|
|
241
|
+
thought: _thought,
|
|
242
|
+
thoughtSignature: _thoughtSignature,
|
|
243
|
+
...rest
|
|
244
|
+
} = part;
|
|
245
|
+
(_f = content.parts) == null ? void 0 : _f.push((0, import_lodash_es.cloneDeep)(rest));
|
|
222
246
|
}
|
|
223
247
|
}
|
|
248
|
+
const preambleOnly = content.parts.length === 1;
|
|
249
|
+
if (preambleOnly) {
|
|
250
|
+
return void 0;
|
|
251
|
+
}
|
|
224
252
|
return (0, import_event.createEvent)({
|
|
225
253
|
invocationId: event.invocationId,
|
|
226
254
|
author: "user",
|
|
@@ -30,6 +30,7 @@ __export(content_request_processor_exports, {
|
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(content_request_processor_exports);
|
|
32
32
|
var import_compaction_utils = require("../../context/compaction_utils.js");
|
|
33
|
+
var import_base_llm = require("../../models/base_llm.js");
|
|
33
34
|
var import_llm_agent = require("../llm_agent.js");
|
|
34
35
|
var import_content_processor_utils = require("./content_processor_utils.js");
|
|
35
36
|
/**
|
|
@@ -37,6 +38,31 @@ var import_content_processor_utils = require("./content_processor_utils.js");
|
|
|
37
38
|
* Copyright 2025 Google LLC
|
|
38
39
|
* SPDX-License-Identifier: Apache-2.0
|
|
39
40
|
*/
|
|
41
|
+
const CLAUDE_MODEL_SYMBOL = /* @__PURE__ */ Symbol.for("google.adk.claudeModel");
|
|
42
|
+
const CLAUDE_MODEL_NAME_PATTERN = /^claude-/i;
|
|
43
|
+
function isClaudeModelInstance(model) {
|
|
44
|
+
return CLAUDE_MODEL_SYMBOL in model && model[CLAUDE_MODEL_SYMBOL] === true || CLAUDE_MODEL_NAME_PATTERN.test(model.model);
|
|
45
|
+
}
|
|
46
|
+
__name(isClaudeModelInstance, "isClaudeModelInstance");
|
|
47
|
+
function shouldPreserveFunctionCallIds(agent, llmRequest) {
|
|
48
|
+
if (llmRequest.model && CLAUDE_MODEL_NAME_PATTERN.test(llmRequest.model)) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
let current = agent;
|
|
52
|
+
while (current) {
|
|
53
|
+
if ((0, import_llm_agent.isLlmAgent)(current)) {
|
|
54
|
+
if ((0, import_base_llm.isBaseLlm)(current.model)) {
|
|
55
|
+
return isClaudeModelInstance(current.model);
|
|
56
|
+
}
|
|
57
|
+
if (typeof current.model === "string" && current.model.length > 0) {
|
|
58
|
+
return CLAUDE_MODEL_NAME_PATTERN.test(current.model);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
current = current.parentAgent;
|
|
62
|
+
}
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
__name(shouldPreserveFunctionCallIds, "shouldPreserveFunctionCallIds");
|
|
40
66
|
const _ContentRequestProcessor = class _ContentRequestProcessor {
|
|
41
67
|
/**
|
|
42
68
|
* Fills {@link LlmRequest.contents} based on the session event history and
|
|
@@ -55,19 +81,25 @@ const _ContentRequestProcessor = class _ContentRequestProcessor {
|
|
|
55
81
|
invocationContext.session.events,
|
|
56
82
|
invocationContext.isolationScope
|
|
57
83
|
);
|
|
84
|
+
const preserveFunctionCallIds = shouldPreserveFunctionCallIds(
|
|
85
|
+
agent,
|
|
86
|
+
llmRequest
|
|
87
|
+
);
|
|
58
88
|
if (agent.includeContents === "default") {
|
|
59
89
|
llmRequest.contents = (0, import_content_processor_utils.getContents)(
|
|
60
90
|
events,
|
|
61
91
|
agent.name,
|
|
62
92
|
invocationContext.branch,
|
|
63
|
-
invocationContext.isolationScope
|
|
93
|
+
invocationContext.isolationScope,
|
|
94
|
+
preserveFunctionCallIds
|
|
64
95
|
);
|
|
65
96
|
} else {
|
|
66
97
|
llmRequest.contents = (0, import_content_processor_utils.getCurrentTurnContents)(
|
|
67
98
|
events,
|
|
68
99
|
agent.name,
|
|
69
100
|
invocationContext.branch,
|
|
70
|
-
invocationContext.isolationScope
|
|
101
|
+
invocationContext.isolationScope,
|
|
102
|
+
preserveFunctionCallIds
|
|
71
103
|
);
|
|
72
104
|
}
|
|
73
105
|
return;
|
|
@@ -78,7 +78,7 @@ const _InstructionsLlmRequestProcessor = class _InstructionsLlmRequestProcessor
|
|
|
78
78
|
}
|
|
79
79
|
(0, import_llm_request.appendInstructions)(llmRequest, [instructionWithState]);
|
|
80
80
|
}
|
|
81
|
-
if (agent.outputSchema && ((_a = agent.tools) == null ? void 0 : _a.length) && !(0, import_output_schema_utils.canUseOutputSchemaWithTools)(agent.canonicalModel
|
|
81
|
+
if (agent.outputSchema && ((_a = agent.tools) == null ? void 0 : _a.length) && !(0, import_output_schema_utils.canUseOutputSchemaWithTools)(agent.canonicalModel)) {
|
|
82
82
|
(0, import_llm_request.appendInstructions)(llmRequest, [
|
|
83
83
|
'To output the final result, you must call the "set_model_response" function with the appropriate values. Do not output anything else.'
|
|
84
84
|
]);
|
|
@@ -31,6 +31,7 @@ __export(nl_planning_processor_exports, {
|
|
|
31
31
|
NlPlanningResponseProcessor: () => NlPlanningResponseProcessor
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(nl_planning_processor_exports);
|
|
34
|
+
var import_event = require("../../events/event.js");
|
|
34
35
|
var import_llm_request = require("../../models/llm_request.js");
|
|
35
36
|
var import_base_planner = require("../../planners/base_planner.js");
|
|
36
37
|
var import_built_in_planner = require("../../planners/built_in_planner.js");
|
|
@@ -85,20 +86,28 @@ const _NlPlanningRequestProcessor = class _NlPlanningRequestProcessor extends im
|
|
|
85
86
|
__name(_NlPlanningRequestProcessor, "NlPlanningRequestProcessor");
|
|
86
87
|
let NlPlanningRequestProcessor = _NlPlanningRequestProcessor;
|
|
87
88
|
const _NlPlanningResponseProcessor = class _NlPlanningResponseProcessor extends import_base_llm_processor.BaseLlmResponseProcessor {
|
|
88
|
-
// eslint-disable-next-line require-yield -- this processor only rewrites the response and has no event to emit
|
|
89
89
|
async *runAsync(invocationContext, llmResponse) {
|
|
90
|
-
var _a, _b;
|
|
90
|
+
var _a, _b, _c;
|
|
91
91
|
const planner = getPlanner(invocationContext);
|
|
92
92
|
if (!planner || !((_b = (_a = llmResponse.content) == null ? void 0 : _a.parts) == null ? void 0 : _b.length)) {
|
|
93
93
|
return;
|
|
94
94
|
}
|
|
95
|
+
const callbackContext = new import_context.Context({ invocationContext });
|
|
95
96
|
const processedParts = planner.processPlanningResponse(
|
|
96
|
-
|
|
97
|
+
callbackContext,
|
|
97
98
|
llmResponse.content.parts
|
|
98
99
|
);
|
|
99
100
|
if (processedParts !== void 0) {
|
|
100
101
|
llmResponse.content = { ...llmResponse.content, parts: processedParts };
|
|
101
102
|
}
|
|
103
|
+
if (callbackContext.state.hasDelta()) {
|
|
104
|
+
yield (0, import_event.createEvent)({
|
|
105
|
+
invocationId: invocationContext.invocationId,
|
|
106
|
+
author: (_c = invocationContext.agent) == null ? void 0 : _c.name,
|
|
107
|
+
branch: invocationContext.branch,
|
|
108
|
+
actions: callbackContext.eventActions
|
|
109
|
+
});
|
|
110
|
+
}
|
|
102
111
|
}
|
|
103
112
|
};
|
|
104
113
|
__name(_NlPlanningResponseProcessor, "NlPlanningResponseProcessor");
|
|
@@ -36,8 +36,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
36
36
|
var logs_exports = {};
|
|
37
37
|
__export(logs_exports, {
|
|
38
38
|
LOGGING_FORMAT: () => LOGGING_FORMAT,
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
logToTmpFolder: () => logToTmpFolder,
|
|
40
|
+
setupAdkLogger: () => setupAdkLogger
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(logs_exports);
|
|
43
43
|
var fs = __toESM(require("node:fs"), 1);
|
|
@@ -99,7 +99,7 @@ function createWriterLogger(initialLevel, writeLine) {
|
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
101
|
__name(createWriterLogger, "createWriterLogger");
|
|
102
|
-
function
|
|
102
|
+
function setupAdkLogger(level = import_logger.LogLevel.INFO) {
|
|
103
103
|
(0, import_logger.setLogLevel)(level);
|
|
104
104
|
(0, import_logger.setLogger)(
|
|
105
105
|
createWriterLogger(level, (line) => {
|
|
@@ -108,7 +108,7 @@ function logToStderr(level = import_logger.LogLevel.INFO) {
|
|
|
108
108
|
})
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
|
-
__name(
|
|
111
|
+
__name(setupAdkLogger, "setupAdkLogger");
|
|
112
112
|
function logToTmpFolder(options = {}) {
|
|
113
113
|
const {
|
|
114
114
|
level = import_logger.LogLevel.INFO,
|
|
@@ -145,6 +145,6 @@ __name(logToTmpFolder, "logToTmpFolder");
|
|
|
145
145
|
// Annotate the CommonJS export names for ESM import in node:
|
|
146
146
|
0 && (module.exports = {
|
|
147
147
|
LOGGING_FORMAT,
|
|
148
|
-
|
|
149
|
-
|
|
148
|
+
logToTmpFolder,
|
|
149
|
+
setupAdkLogger
|
|
150
150
|
});
|