@google/adk 1.4.0 → 1.6.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/a2a/a2a_remote_agent.js +12 -2
- package/dist/cjs/a2a/agent_to_a2a.js +18 -3
- package/dist/cjs/a2a/auth.js +65 -0
- package/dist/cjs/a2a/event_converter_utils.js +47 -18
- package/dist/cjs/a2a/metadata_converter_utils.js +1 -1
- package/dist/cjs/agents/base_agent.js +39 -0
- package/dist/cjs/agents/functions.js +26 -28
- package/dist/cjs/agents/llm_agent.js +4 -2
- package/dist/cjs/agents/loop_agent.js +15 -3
- package/dist/cjs/agents/processors/basic_llm_request_processor.js +3 -2
- package/dist/cjs/agents/processors/content_processor_utils.js +2 -1
- package/dist/cjs/agents/processors/content_request_processor.js +2 -21
- package/dist/cjs/agents/processors/instructions_llm_request_processor.js +3 -1
- package/dist/cjs/agents/routed_agent.js +31 -0
- package/dist/cjs/agents/run_config.js +3 -2
- package/dist/cjs/artifacts/in_memory_artifact_service.js +17 -9
- package/dist/cjs/auth/credential_service/in_memory_credential_service.js +14 -3
- package/dist/cjs/code_executors/unsafe_local_code_executor.js +23 -12
- package/dist/cjs/common.js +35 -0
- package/dist/cjs/context/agent_controlled_context_compactor.js +2 -11
- package/dist/cjs/context/anchored_context_compactor.js +127 -0
- package/dist/cjs/context/compaction_utils.js +64 -0
- package/dist/cjs/context/token_based_context_compactor.js +13 -44
- package/dist/cjs/events/compacted_event.js +9 -3
- package/dist/cjs/events/event.js +28 -0
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/integrations/agent_registry/agent_registry_mcp_toolset.js +9 -1
- package/dist/cjs/memory/in_memory_memory_service.js +13 -2
- package/dist/cjs/memory/vertex_ai_memory_bank_service.js +3 -0
- package/dist/cjs/plugins/base_plugin.js +4 -2
- package/dist/cjs/plugins/global_instruction_plugin.js +97 -0
- package/dist/cjs/runner/runner.js +69 -23
- package/dist/cjs/sessions/base_session_service.js +8 -3
- package/dist/cjs/sessions/in_memory_session_service.js +8 -8
- package/dist/cjs/sessions/vertex_ai_session_service.js +22 -10
- package/dist/cjs/skills/loader.js +40 -6
- package/dist/cjs/tools/enterprise_web_search_tool.js +81 -0
- package/dist/cjs/tools/example_tool.js +68 -0
- package/dist/cjs/tools/get_user_choice_tool.js +53 -0
- package/dist/cjs/tools/load_web_page.js +250 -0
- package/dist/cjs/tools/mcp/load_mcp_resource_tool.js +140 -0
- package/dist/cjs/tools/mcp/mcp_session_manager.js +35 -21
- package/dist/cjs/tools/mcp/mcp_toolset.js +63 -0
- package/dist/cjs/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +13 -10
- package/dist/cjs/tools/request_input_tool.js +54 -0
- package/dist/cjs/tools/skill/run_skill_inline_script_tool.js +54 -4
- package/dist/cjs/tools/skill/skill_toolset.js +4 -2
- package/dist/cjs/utils/branch_trie.js +41 -0
- package/dist/cjs/utils/crypto_shim.js +43 -0
- package/dist/cjs/utils/env_aware_utils.js +15 -13
- package/dist/cjs/utils/error_utils.js +120 -0
- package/dist/cjs/utils/file_utils.js +5 -2
- package/dist/cjs/utils/output_schema_utils.js +43 -0
- package/dist/cjs/utils/streaming_utils.js +5 -5
- package/dist/cjs/utils/vertex_ai_utils.js +3 -0
- package/dist/cjs/version.js +1 -1
- package/dist/esm/a2a/a2a_remote_agent.js +12 -2
- package/dist/esm/a2a/agent_to_a2a.js +18 -3
- package/dist/esm/a2a/auth.js +37 -0
- package/dist/esm/a2a/event_converter_utils.js +47 -18
- package/dist/esm/a2a/metadata_converter_utils.js +1 -1
- package/dist/esm/agents/base_agent.js +39 -0
- package/dist/esm/agents/functions.js +27 -24
- package/dist/esm/agents/llm_agent.js +6 -4
- package/dist/esm/agents/loop_agent.js +15 -3
- package/dist/esm/agents/processors/basic_llm_request_processor.js +3 -2
- package/dist/esm/agents/processors/content_processor_utils.js +2 -1
- package/dist/esm/agents/processors/content_request_processor.js +2 -21
- package/dist/esm/agents/processors/instructions_llm_request_processor.js +3 -1
- package/dist/esm/agents/routed_agent.js +31 -0
- package/dist/esm/agents/run_config.js +3 -2
- package/dist/esm/artifacts/in_memory_artifact_service.js +17 -9
- package/dist/esm/auth/credential_service/in_memory_credential_service.js +14 -3
- package/dist/esm/code_executors/unsafe_local_code_executor.js +22 -11
- package/dist/esm/common.js +29 -1
- package/dist/esm/context/agent_controlled_context_compactor.js +2 -11
- package/dist/esm/context/anchored_context_compactor.js +99 -0
- package/dist/esm/context/compaction_utils.js +38 -0
- package/dist/esm/context/token_based_context_compactor.js +16 -44
- package/dist/esm/events/compacted_event.js +7 -2
- package/dist/esm/events/event.js +24 -0
- package/dist/esm/index.js +8 -1
- package/dist/esm/integrations/agent_registry/agent_registry_mcp_toolset.js +9 -1
- package/dist/esm/memory/in_memory_memory_service.js +13 -2
- package/dist/esm/memory/vertex_ai_memory_bank_service.js +7 -1
- package/dist/esm/plugins/base_plugin.js +4 -2
- package/dist/esm/plugins/global_instruction_plugin.js +69 -0
- package/dist/esm/runner/runner.js +69 -23
- package/dist/esm/sessions/base_session_service.js +8 -3
- package/dist/esm/sessions/in_memory_session_service.js +8 -8
- package/dist/esm/sessions/vertex_ai_session_service.js +26 -11
- package/dist/esm/skills/loader.js +40 -6
- package/dist/esm/tools/enterprise_web_search_tool.js +55 -0
- package/dist/esm/tools/example_tool.js +42 -0
- package/dist/esm/tools/get_user_choice_tool.js +25 -0
- package/dist/esm/tools/load_web_page.js +221 -0
- package/dist/esm/tools/mcp/load_mcp_resource_tool.js +114 -0
- package/dist/esm/tools/mcp/mcp_session_manager.js +35 -21
- package/dist/esm/tools/mcp/mcp_toolset.js +63 -0
- package/dist/esm/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +13 -10
- package/dist/esm/tools/request_input_tool.js +26 -0
- package/dist/esm/tools/skill/run_skill_inline_script_tool.js +53 -4
- package/dist/esm/tools/skill/skill_toolset.js +4 -2
- package/dist/esm/utils/branch_trie.js +13 -0
- package/dist/esm/utils/crypto_shim.js +15 -0
- package/dist/esm/utils/env_aware_utils.js +15 -13
- package/dist/esm/utils/error_utils.js +92 -0
- package/dist/esm/utils/file_utils.js +5 -2
- package/dist/esm/utils/output_schema_utils.js +15 -0
- package/dist/esm/utils/streaming_utils.js +1 -1
- package/dist/esm/utils/vertex_ai_utils.js +2 -0
- package/dist/esm/version.js +1 -1
- package/dist/types/a2a/a2a_remote_agent.d.ts +5 -1
- package/dist/types/a2a/agent_to_a2a.d.ts +38 -0
- package/dist/types/a2a/auth.d.ts +30 -0
- package/dist/types/a2a/event_converter_utils.d.ts +4 -1
- package/dist/types/agents/base_agent.d.ts +29 -1
- package/dist/types/agents/functions.d.ts +1 -9
- package/dist/types/agents/llm_agent.d.ts +5 -1
- package/dist/types/agents/loop_agent.d.ts +2 -2
- package/dist/types/agents/routed_agent.d.ts +24 -1
- package/dist/types/agents/run_config.d.ts +1 -1
- package/dist/types/auth/credential_service/in_memory_credential_service.d.ts +11 -0
- package/dist/types/code_executors/unsafe_local_code_executor.d.ts +5 -1
- package/dist/types/common.d.ts +11 -2
- package/dist/types/context/agent_controlled_context_compactor.d.ts +0 -1
- package/dist/types/context/anchored_context_compactor.d.ts +35 -0
- package/dist/types/context/compaction_utils.d.ts +23 -0
- package/dist/types/context/token_based_context_compactor.d.ts +0 -1
- package/dist/types/events/compacted_event.d.ts +10 -0
- package/dist/types/events/event.d.ts +13 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/memory/in_memory_memory_service.d.ts +11 -0
- package/dist/types/plugins/base_plugin.d.ts +4 -2
- package/dist/types/plugins/global_instruction_plugin.d.ts +38 -0
- package/dist/types/runner/runner.d.ts +1 -1
- package/dist/types/sessions/base_session_service.d.ts +8 -0
- package/dist/types/sessions/in_memory_session_service.d.ts +9 -0
- package/dist/types/sessions/vertex_ai_session_service.d.ts +19 -1
- package/dist/types/skills/loader.d.ts +5 -0
- package/dist/types/tools/enterprise_web_search_tool.d.ts +26 -0
- package/dist/types/tools/example_tool.d.ts +21 -0
- package/dist/types/tools/get_user_choice_tool.d.ts +14 -0
- package/dist/types/tools/load_web_page.d.ts +33 -0
- package/dist/types/tools/mcp/load_mcp_resource_tool.d.ts +26 -0
- package/dist/types/tools/mcp/mcp_toolset.d.ts +27 -0
- package/dist/types/tools/request_input_tool.d.ts +15 -0
- package/dist/types/tools/skill/run_skill_inline_script_tool.d.ts +25 -0
- package/dist/types/tools/skill/skill_toolset.d.ts +9 -0
- package/dist/types/utils/branch_trie.d.ts +14 -0
- package/dist/types/utils/crypto_shim.d.ts +16 -0
- package/dist/types/utils/env_aware_utils.d.ts +23 -0
- package/dist/types/utils/error_utils.d.ts +18 -0
- package/dist/types/utils/output_schema_utils.d.ts +18 -0
- package/dist/types/utils/vertex_ai_utils.d.ts +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/web/a2a/a2a_remote_agent.js +12 -2
- package/dist/web/a2a/agent_to_a2a.js +18 -3
- package/dist/web/a2a/auth.js +37 -0
- package/dist/web/a2a/event_converter_utils.js +47 -18
- package/dist/web/a2a/metadata_converter_utils.js +1 -1
- package/dist/web/agents/base_agent.js +39 -0
- package/dist/web/agents/functions.js +27 -24
- package/dist/web/agents/llm_agent.js +6 -4
- package/dist/web/agents/loop_agent.js +27 -3
- package/dist/web/agents/processors/basic_llm_request_processor.js +3 -2
- package/dist/web/agents/processors/content_processor_utils.js +2 -1
- package/dist/web/agents/processors/content_request_processor.js +2 -21
- package/dist/web/agents/processors/instructions_llm_request_processor.js +3 -1
- package/dist/web/agents/routed_agent.js +31 -0
- package/dist/web/agents/run_config.js +8 -3
- package/dist/web/artifacts/in_memory_artifact_service.js +17 -9
- package/dist/web/auth/credential_service/in_memory_credential_service.js +14 -3
- package/dist/web/code_executors/unsafe_local_code_executor.js +22 -11
- package/dist/web/common.js +29 -1
- package/dist/web/context/agent_controlled_context_compactor.js +2 -11
- package/dist/web/context/anchored_context_compactor.js +117 -0
- package/dist/web/context/compaction_utils.js +38 -0
- package/dist/web/context/token_based_context_compactor.js +16 -44
- package/dist/web/events/compacted_event.js +7 -2
- package/dist/web/events/event.js +24 -0
- package/dist/web/index.js +8 -1
- package/dist/web/integrations/agent_registry/agent_registry_mcp_toolset.js +9 -1
- package/dist/web/memory/in_memory_memory_service.js +13 -2
- package/dist/web/memory/vertex_ai_memory_bank_service.js +7 -1
- package/dist/web/plugins/base_plugin.js +4 -2
- package/dist/web/plugins/global_instruction_plugin.js +67 -0
- package/dist/web/runner/runner.js +65 -22
- package/dist/web/sessions/base_session_service.js +8 -3
- package/dist/web/sessions/in_memory_session_service.js +8 -8
- package/dist/web/sessions/vertex_ai_session_service.js +24 -11
- package/dist/web/skills/loader.js +40 -6
- package/dist/web/tools/enterprise_web_search_tool.js +55 -0
- package/dist/web/tools/example_tool.js +42 -0
- package/dist/web/tools/get_user_choice_tool.js +25 -0
- package/dist/web/tools/load_web_page.js +221 -0
- package/dist/web/tools/mcp/load_mcp_resource_tool.js +107 -0
- package/dist/web/tools/mcp/mcp_session_manager.js +35 -21
- package/dist/web/tools/mcp/mcp_toolset.js +63 -0
- package/dist/web/tools/openapi_tool/openapi_spec_parser/tool_auth_handler.js +13 -10
- package/dist/web/tools/request_input_tool.js +26 -0
- package/dist/web/tools/skill/run_skill_inline_script_tool.js +51 -4
- package/dist/web/tools/skill/skill_toolset.js +4 -2
- package/dist/web/utils/branch_trie.js +13 -0
- package/dist/web/utils/crypto_shim.js +15 -0
- package/dist/web/utils/env_aware_utils.js +15 -13
- package/dist/web/utils/error_utils.js +92 -0
- package/dist/web/utils/file_utils.js +5 -2
- package/dist/web/utils/output_schema_utils.js +15 -0
- package/dist/web/utils/streaming_utils.js +1 -1
- package/dist/web/utils/vertex_ai_utils.js +2 -0
- package/dist/web/version.js +1 -1
- package/package.json +1 -1
|
@@ -5,27 +5,29 @@ const require = topLevelCreateRequire(import.meta.url);
|
|
|
5
5
|
* Copyright 2025 Google LLC
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
|
+
import { randomUUID as nodeRandomUUID } from "node:crypto";
|
|
8
9
|
function isBrowser() {
|
|
9
10
|
return typeof window !== "undefined";
|
|
10
11
|
}
|
|
11
|
-
const UUID_MASK = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx";
|
|
12
12
|
function randomUUID() {
|
|
13
|
-
var _a;
|
|
13
|
+
var _a, _b;
|
|
14
14
|
if ((_a = globalThis.crypto) == null ? void 0 : _a.randomUUID) {
|
|
15
15
|
return globalThis.crypto.randomUUID();
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
if ((_b = globalThis.crypto) == null ? void 0 : _b.getRandomValues) {
|
|
18
|
+
const bytes = globalThis.crypto.getRandomValues(new Uint8Array(16));
|
|
19
|
+
bytes[6] = bytes[6] & 15 | 64;
|
|
20
|
+
bytes[8] = bytes[8] & 63 | 128;
|
|
21
|
+
const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, "0"));
|
|
22
|
+
return [
|
|
23
|
+
hex.slice(0, 4),
|
|
24
|
+
hex.slice(4, 6),
|
|
25
|
+
hex.slice(6, 8),
|
|
26
|
+
hex.slice(8, 10),
|
|
27
|
+
hex.slice(10, 16)
|
|
28
|
+
].map((group) => group.join("")).join("-");
|
|
27
29
|
}
|
|
28
|
-
return
|
|
30
|
+
return nodeRandomUUID();
|
|
29
31
|
}
|
|
30
32
|
function base64Encode(data) {
|
|
31
33
|
if (isBrowser()) {
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2026 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
const MAX_RESPONSE_BODY_LENGTH = 1e3;
|
|
9
|
+
const TRUNCATION_MARKER = "... [truncated]";
|
|
10
|
+
const UNKNOWN_ERROR = "Unknown error";
|
|
11
|
+
const MIN_HTTP_STATUS = 100;
|
|
12
|
+
const MAX_HTTP_STATUS = 599;
|
|
13
|
+
function asRecord(value) {
|
|
14
|
+
return value !== null && typeof value === "object" ? value : void 0;
|
|
15
|
+
}
|
|
16
|
+
function firstString(...values) {
|
|
17
|
+
for (const value of values) {
|
|
18
|
+
if (typeof value === "string") {
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return void 0;
|
|
23
|
+
}
|
|
24
|
+
function truncateBody(body) {
|
|
25
|
+
return body.length > MAX_RESPONSE_BODY_LENGTH ? body.slice(0, MAX_RESPONSE_BODY_LENGTH) + TRUNCATION_MARKER : body;
|
|
26
|
+
}
|
|
27
|
+
function baseMessage(err) {
|
|
28
|
+
if (err instanceof Error) {
|
|
29
|
+
return err.message;
|
|
30
|
+
}
|
|
31
|
+
if (typeof err === "string") {
|
|
32
|
+
return err;
|
|
33
|
+
}
|
|
34
|
+
return String(err);
|
|
35
|
+
}
|
|
36
|
+
function extractHttpDetails(err) {
|
|
37
|
+
var _a, _b;
|
|
38
|
+
const record = asRecord(err);
|
|
39
|
+
if (record === void 0) {
|
|
40
|
+
return void 0;
|
|
41
|
+
}
|
|
42
|
+
const response = asRecord(record["response"]);
|
|
43
|
+
const rawStatus = (_b = (_a = record["status"]) != null ? _a : record["code"]) != null ? _b : response == null ? void 0 : response["status"];
|
|
44
|
+
const status = typeof rawStatus === "number" && rawStatus >= MIN_HTTP_STATUS && rawStatus <= MAX_HTTP_STATUS ? rawStatus : void 0;
|
|
45
|
+
const statusText = firstString(
|
|
46
|
+
record["statusText"],
|
|
47
|
+
response == null ? void 0 : response["statusText"]
|
|
48
|
+
);
|
|
49
|
+
const body = firstString(
|
|
50
|
+
response == null ? void 0 : response["data"],
|
|
51
|
+
response == null ? void 0 : response["body"],
|
|
52
|
+
response == null ? void 0 : response["text"]
|
|
53
|
+
);
|
|
54
|
+
if (status === void 0 && body === void 0) {
|
|
55
|
+
return void 0;
|
|
56
|
+
}
|
|
57
|
+
const head = status === void 0 ? "HTTP error" : "HTTP ".concat(status).concat(statusText === void 0 ? "" : " ".concat(statusText));
|
|
58
|
+
return body === void 0 ? head : "".concat(head, ": ").concat(truncateBody(body));
|
|
59
|
+
}
|
|
60
|
+
function formatErrorRecursive(err, seen) {
|
|
61
|
+
var _a;
|
|
62
|
+
if (err === null || err === void 0) {
|
|
63
|
+
return UNKNOWN_ERROR;
|
|
64
|
+
}
|
|
65
|
+
if (typeof err === "object") {
|
|
66
|
+
if (seen.has(err)) {
|
|
67
|
+
return baseMessage(err);
|
|
68
|
+
}
|
|
69
|
+
seen.add(err);
|
|
70
|
+
}
|
|
71
|
+
if (err instanceof AggregateError && err.errors.length > 0) {
|
|
72
|
+
return err.errors.map((sub) => formatErrorRecursive(sub, seen)).join(" | ");
|
|
73
|
+
}
|
|
74
|
+
const http = extractHttpDetails(err);
|
|
75
|
+
const base = baseMessage(err);
|
|
76
|
+
const cause = (_a = asRecord(err)) == null ? void 0 : _a["cause"];
|
|
77
|
+
const causeMessage = cause !== void 0 ? formatErrorRecursive(cause, seen) : void 0;
|
|
78
|
+
let message = base.length > 0 ? base : UNKNOWN_ERROR;
|
|
79
|
+
if (http !== void 0) {
|
|
80
|
+
message = "".concat(message, " (").concat(http, ")");
|
|
81
|
+
}
|
|
82
|
+
if (causeMessage !== void 0 && http === void 0 && !message.includes(causeMessage)) {
|
|
83
|
+
message = "".concat(message, ": ").concat(causeMessage);
|
|
84
|
+
}
|
|
85
|
+
return message;
|
|
86
|
+
}
|
|
87
|
+
function formatError(err) {
|
|
88
|
+
return formatErrorRecursive(err, /* @__PURE__ */ new Set());
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
formatError
|
|
92
|
+
};
|
|
@@ -26,12 +26,15 @@ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
|
26
26
|
*/
|
|
27
27
|
import * as fs from "node:fs/promises";
|
|
28
28
|
import * as path from "node:path";
|
|
29
|
+
function isInsideDir(resolvedPath, resolvedBaseDir) {
|
|
30
|
+
return resolvedPath === resolvedBaseDir || resolvedPath.startsWith(resolvedBaseDir + path.sep);
|
|
31
|
+
}
|
|
29
32
|
async function materializeFiles(files, dir = process.cwd()) {
|
|
30
33
|
const resolvedBaseDir = path.resolve(dir);
|
|
31
34
|
const createdFiles = [];
|
|
32
35
|
for (const file of files) {
|
|
33
36
|
const fullPath = path.resolve(dir, file.name);
|
|
34
|
-
if (!fullPath
|
|
37
|
+
if (!isInsideDir(fullPath, resolvedBaseDir)) {
|
|
35
38
|
throw new Error(
|
|
36
39
|
"Path traversal detected: ".concat(file.name, " resolves outside of ").concat(dir)
|
|
37
40
|
);
|
|
@@ -53,7 +56,7 @@ async function materializeFiles(files, dir = process.cwd()) {
|
|
|
53
56
|
break;
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
|
-
if (!finalPath
|
|
59
|
+
if (!isInsideDir(finalPath, resolvedBaseDir)) {
|
|
57
60
|
throw new Error(
|
|
58
61
|
"Path traversal detected: ".concat(file.name, " resolves outside of ").concat(dir)
|
|
59
62
|
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {createRequire as topLevelCreateRequire} from 'module';
|
|
2
|
+
const require = topLevelCreateRequire(import.meta.url);
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2026 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
7
|
+
*/
|
|
8
|
+
import { isGemini2OrAbove } from "./model_name.js";
|
|
9
|
+
import { getGoogleLlmVariant, GoogleLLMVariant } from "./variant_utils.js";
|
|
10
|
+
function canUseOutputSchemaWithTools(modelString) {
|
|
11
|
+
return getGoogleLlmVariant() === GoogleLLMVariant.VERTEX_AI && isGemini2OrAbove(modelString);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
canUseOutputSchemaWithTools
|
|
15
|
+
};
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
FinishReason
|
|
76
76
|
} from "@google/genai";
|
|
77
77
|
import { JSONPath } from "jsonpath-plus";
|
|
78
|
-
import { generateClientFunctionCallId } from "../
|
|
78
|
+
import { generateClientFunctionCallId } from "../events/event.js";
|
|
79
79
|
import { FeatureName, isFeatureEnabled } from "../features/feature_registry.js";
|
|
80
80
|
import { createLlmResponse } from "../models/llm_response.js";
|
|
81
81
|
const UNSAFE_PROPERTY_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
|
|
@@ -6,6 +6,7 @@ const require = topLevelCreateRequire(import.meta.url);
|
|
|
6
6
|
* SPDX-License-Identifier: Apache-2.0
|
|
7
7
|
*/
|
|
8
8
|
import { getBooleanEnvVar } from "./env_aware_utils.js";
|
|
9
|
+
const EXPRESS_MODE_UNSUPPORTED_MESSAGE = "Vertex AI Express Mode (expressModeApiKey / GOOGLE_API_KEY) is not supported: the @google-cloud/vertexai Agent Engine client cannot send an API key. Provide projectId and location (with Application Default Credentials), or inject a preconfigured client.";
|
|
9
10
|
function getExpressModeApiKey(project, location, expressModeApiKey) {
|
|
10
11
|
if ((project || location) && expressModeApiKey) {
|
|
11
12
|
throw new Error(
|
|
@@ -18,5 +19,6 @@ function getExpressModeApiKey(project, location, expressModeApiKey) {
|
|
|
18
19
|
return void 0;
|
|
19
20
|
}
|
|
20
21
|
export {
|
|
22
|
+
EXPRESS_MODE_UNSUPPORTED_MESSAGE,
|
|
21
23
|
getExpressModeApiKey
|
|
22
24
|
};
|
package/dist/web/version.js
CHANGED