@google/adk 0.2.5 → 0.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/a2a/part_converter_utils.js +210 -0
- package/dist/cjs/agents/active_streaming_tool.js +1 -1
- package/dist/cjs/agents/base_agent.js +46 -24
- package/dist/cjs/agents/base_llm_processor.js +1 -1
- package/dist/cjs/agents/callback_context.js +5 -2
- package/dist/cjs/agents/content_processor_utils.js +16 -8
- package/dist/cjs/agents/functions.js +81 -30
- package/dist/cjs/agents/instructions.js +1 -1
- package/dist/cjs/agents/invocation_context.js +1 -1
- package/dist/cjs/agents/live_request_queue.js +1 -1
- package/dist/cjs/agents/llm_agent.js +106 -62
- package/dist/cjs/agents/loop_agent.js +3 -2
- package/dist/cjs/agents/parallel_agent.js +4 -5
- package/dist/cjs/agents/readonly_context.js +13 -1
- package/dist/cjs/agents/run_config.js +2 -1
- package/dist/cjs/agents/sequential_agent.js +1 -1
- package/dist/cjs/agents/transcription_entry.js +1 -1
- package/dist/cjs/artifacts/base_artifact_service.js +1 -1
- package/dist/cjs/artifacts/file_artifact_service.js +491 -0
- package/dist/cjs/artifacts/gcs_artifact_service.js +145 -58
- package/dist/cjs/artifacts/in_memory_artifact_service.js +72 -10
- package/dist/cjs/artifacts/registry.js +55 -0
- package/dist/cjs/auth/auth_credential.js +1 -1
- package/dist/cjs/auth/auth_handler.js +4 -2
- package/dist/cjs/auth/auth_schemes.js +1 -1
- package/dist/cjs/auth/auth_tool.js +1 -1
- package/dist/cjs/auth/credential_service/base_credential_service.js +1 -1
- package/dist/cjs/auth/credential_service/in_memory_credential_service.js +1 -1
- package/dist/cjs/auth/exchanger/base_credential_exchanger.js +1 -1
- package/dist/cjs/auth/exchanger/credential_exchanger_registry.js +1 -1
- package/dist/cjs/code_executors/base_code_executor.js +4 -2
- package/dist/cjs/code_executors/built_in_code_executor.js +8 -4
- package/dist/cjs/code_executors/code_execution_utils.js +1 -1
- package/dist/cjs/code_executors/code_executor_context.js +6 -6
- package/dist/cjs/common.js +18 -1
- package/dist/cjs/events/event.js +34 -7
- package/dist/cjs/events/event_actions.js +2 -2
- package/dist/cjs/events/structured_events.js +105 -0
- package/dist/cjs/examples/base_example_provider.js +1 -1
- package/dist/cjs/examples/example.js +1 -1
- package/dist/cjs/examples/example_util.js +1 -1
- package/dist/cjs/index.js +54 -83
- package/dist/cjs/index_web.js +1 -1
- package/dist/cjs/memory/base_memory_service.js +1 -1
- package/dist/cjs/memory/in_memory_memory_service.js +4 -2
- package/dist/cjs/memory/memory_entry.js +1 -1
- package/dist/cjs/models/apigee_llm.js +182 -0
- package/dist/cjs/models/base_llm.js +9 -5
- package/dist/cjs/models/base_llm_connection.js +1 -1
- package/dist/cjs/models/gemini_llm_connection.js +2 -1
- package/dist/cjs/models/google_llm.js +73 -54
- package/dist/cjs/models/llm_request.js +1 -1
- package/dist/cjs/models/llm_response.js +1 -1
- package/dist/cjs/models/registry.js +3 -1
- package/dist/cjs/plugins/base_plugin.js +13 -1
- package/dist/cjs/plugins/logging_plugin.js +51 -14
- package/dist/cjs/plugins/plugin_manager.js +57 -25
- package/dist/cjs/plugins/security_plugin.js +2 -2
- package/dist/cjs/runner/in_memory_runner.js +1 -1
- package/dist/cjs/runner/runner.js +142 -96
- package/dist/cjs/sessions/base_session_service.js +53 -3
- package/dist/cjs/sessions/database_session_service.js +364 -0
- package/dist/cjs/sessions/db/operations.js +114 -0
- package/dist/cjs/sessions/db/schema.js +204 -0
- package/dist/cjs/sessions/in_memory_session_service.js +60 -34
- package/dist/cjs/sessions/registry.js +49 -0
- package/dist/cjs/sessions/session.js +1 -1
- package/dist/cjs/sessions/state.js +1 -1
- package/dist/cjs/telemetry/google_cloud.js +8 -10
- package/dist/cjs/telemetry/setup.js +16 -8
- package/dist/cjs/telemetry/tracing.js +38 -16
- package/dist/cjs/tools/agent_tool.js +9 -5
- package/dist/cjs/tools/base_tool.js +5 -3
- package/dist/cjs/tools/base_toolset.js +1 -1
- package/dist/cjs/tools/forwarding_artifact_service.js +18 -2
- package/dist/cjs/tools/function_tool.js +2 -3
- package/dist/cjs/tools/google_search_tool.js +2 -3
- package/dist/cjs/tools/long_running_tool.js +1 -1
- package/dist/cjs/tools/mcp/mcp_session_manager.js +17 -11
- package/dist/cjs/tools/mcp/mcp_tool.js +2 -4
- package/dist/cjs/tools/mcp/mcp_toolset.js +2 -2
- package/dist/cjs/tools/tool_confirmation.js +1 -1
- package/dist/cjs/tools/tool_context.js +1 -1
- package/dist/cjs/utils/client_labels.js +1 -1
- package/dist/cjs/utils/env_aware_utils.js +11 -2
- package/dist/cjs/utils/gemini_schema_util.js +10 -5
- package/dist/cjs/utils/logger.js +48 -4
- package/dist/cjs/utils/model_name.js +1 -1
- package/dist/cjs/utils/object_notation_utils.js +78 -0
- package/dist/cjs/utils/simple_zod_to_json.js +101 -142
- package/dist/cjs/utils/variant_utils.js +3 -9
- package/dist/cjs/version.js +2 -2
- package/dist/esm/a2a/part_converter_utils.js +171 -0
- package/dist/esm/agents/base_agent.js +50 -24
- package/dist/esm/agents/callback_context.js +4 -1
- package/dist/esm/agents/content_processor_utils.js +25 -9
- package/dist/esm/agents/functions.js +84 -29
- package/dist/esm/agents/llm_agent.js +110 -62
- package/dist/esm/agents/loop_agent.js +2 -1
- package/dist/esm/agents/parallel_agent.js +3 -4
- package/dist/esm/agents/readonly_context.js +12 -0
- package/dist/esm/agents/run_config.js +1 -0
- package/dist/esm/artifacts/file_artifact_service.js +451 -0
- package/dist/esm/artifacts/gcs_artifact_service.js +144 -57
- package/dist/esm/artifacts/in_memory_artifact_service.js +69 -8
- package/dist/esm/artifacts/registry.js +28 -0
- package/dist/esm/auth/auth_handler.js +3 -1
- package/dist/esm/code_executors/base_code_executor.js +3 -1
- package/dist/esm/code_executors/built_in_code_executor.js +7 -3
- package/dist/esm/code_executors/code_executor_context.js +5 -5
- package/dist/esm/common.js +12 -2
- package/dist/esm/events/event.js +30 -5
- package/dist/esm/events/event_actions.js +1 -1
- package/dist/esm/events/structured_events.js +74 -0
- package/dist/esm/index.js +18 -88
- package/dist/esm/memory/in_memory_memory_service.js +3 -1
- package/dist/esm/models/apigee_llm.js +152 -0
- package/dist/esm/models/base_llm.js +8 -4
- package/dist/esm/models/gemini_llm_connection.js +1 -0
- package/dist/esm/models/google_llm.js +75 -53
- package/dist/esm/models/registry.js +2 -0
- package/dist/esm/plugins/base_plugin.js +12 -0
- package/dist/esm/plugins/logging_plugin.js +55 -14
- package/dist/esm/plugins/plugin_manager.js +56 -24
- package/dist/esm/plugins/security_plugin.js +1 -1
- package/dist/esm/runner/runner.js +145 -96
- package/dist/esm/sessions/base_session_service.js +49 -1
- package/dist/esm/sessions/database_session_service.js +350 -0
- package/dist/esm/sessions/db/operations.js +87 -0
- package/dist/esm/sessions/db/schema.js +172 -0
- package/dist/esm/sessions/in_memory_session_service.js +61 -33
- package/dist/esm/sessions/registry.js +25 -0
- package/dist/esm/telemetry/google_cloud.js +7 -9
- package/dist/esm/telemetry/setup.js +23 -9
- package/dist/esm/telemetry/tracing.js +37 -15
- package/dist/esm/tools/agent_tool.js +8 -4
- package/dist/esm/tools/base_tool.js +4 -2
- package/dist/esm/tools/forwarding_artifact_service.js +17 -1
- package/dist/esm/tools/function_tool.js +1 -2
- package/dist/esm/tools/google_search_tool.js +2 -5
- package/dist/esm/tools/long_running_tool.js +3 -1
- package/dist/esm/tools/mcp/mcp_session_manager.js +22 -12
- package/dist/esm/tools/mcp/mcp_tool.js +1 -3
- package/dist/esm/tools/mcp/mcp_toolset.js +1 -1
- package/dist/esm/utils/env_aware_utils.js +9 -1
- package/dist/esm/utils/gemini_schema_util.js +9 -4
- package/dist/esm/utils/logger.js +43 -2
- package/dist/esm/utils/object_notation_utils.js +47 -0
- package/dist/esm/utils/simple_zod_to_json.js +102 -141
- package/dist/esm/utils/variant_utils.js +1 -7
- package/dist/esm/version.js +1 -1
- package/dist/types/a2a/part_converter_utils.d.ts +47 -0
- package/dist/types/agents/base_agent.d.ts +2 -1
- package/dist/types/agents/callback_context.d.ts +1 -1
- package/dist/types/agents/llm_agent.d.ts +12 -12
- package/dist/types/agents/loop_agent.d.ts +1 -1
- package/dist/types/agents/parallel_agent.d.ts +1 -1
- package/dist/types/agents/readonly_context.d.ts +8 -0
- package/dist/types/agents/run_config.d.ts +6 -0
- package/dist/types/artifacts/base_artifact_service.d.ts +31 -0
- package/dist/types/artifacts/file_artifact_service.d.ts +43 -0
- package/dist/types/artifacts/gcs_artifact_service.d.ts +3 -1
- package/dist/types/artifacts/in_memory_artifact_service.d.ts +8 -5
- package/dist/types/artifacts/registry.d.ts +7 -0
- package/dist/types/code_executors/built_in_code_executor.d.ts +1 -1
- package/dist/types/code_executors/code_executor_context.d.ts +2 -4
- package/dist/types/common.d.ts +13 -3
- package/dist/types/events/event.d.ts +15 -1
- package/dist/types/events/event_actions.d.ts +1 -1
- package/dist/types/events/structured_events.d.ts +106 -0
- package/dist/types/index.d.ts +7 -3
- package/dist/types/models/apigee_llm.d.ts +59 -0
- package/dist/types/models/base_llm_connection.d.ts +1 -1
- package/dist/types/models/google_llm.d.ts +5 -2
- package/dist/types/models/llm_response.d.ts +1 -1
- package/dist/types/plugins/logging_plugin.d.ts +12 -12
- package/dist/types/plugins/plugin_manager.d.ts +12 -12
- package/dist/types/plugins/security_plugin.d.ts +1 -1
- package/dist/types/runner/runner.d.ts +16 -1
- package/dist/types/sessions/base_session_service.d.ts +20 -0
- package/dist/types/sessions/database_session_service.d.ts +31 -0
- package/dist/types/sessions/db/operations.d.ts +29 -0
- package/dist/types/sessions/db/schema.d.ts +45 -0
- package/dist/types/sessions/in_memory_session_service.d.ts +9 -6
- package/dist/types/sessions/registry.d.ts +7 -0
- package/dist/types/telemetry/setup.d.ts +1 -1
- package/dist/types/telemetry/tracing.d.ts +7 -6
- package/dist/types/tools/agent_tool.d.ts +1 -1
- package/dist/types/tools/base_tool.d.ts +1 -1
- package/dist/types/tools/base_toolset.d.ts +2 -1
- package/dist/types/tools/forwarding_artifact_service.d.ts +4 -2
- package/dist/types/tools/function_tool.d.ts +4 -3
- package/dist/types/tools/google_search_tool.d.ts +3 -3
- package/dist/types/tools/mcp/mcp_session_manager.d.ts +10 -3
- package/dist/types/tools/mcp/mcp_toolset.d.ts +1 -2
- package/dist/types/utils/env_aware_utils.d.ts +7 -0
- package/dist/types/utils/gemini_schema_util.d.ts +4 -12
- package/dist/types/utils/logger.d.ts +11 -10
- package/dist/types/utils/object_notation_utils.d.ts +21 -0
- package/dist/types/utils/simple_zod_to_json.d.ts +5 -4
- package/dist/types/version.d.ts +1 -1
- package/dist/web/a2a/part_converter_utils.js +171 -0
- package/dist/web/agents/base_agent.js +96 -35
- package/dist/web/agents/callback_context.js +4 -1
- package/dist/web/agents/content_processor_utils.js +25 -9
- package/dist/web/agents/functions.js +84 -29
- package/dist/web/agents/llm_agent.js +166 -83
- package/dist/web/agents/loop_agent.js +2 -1
- package/dist/web/agents/parallel_agent.js +3 -4
- package/dist/web/agents/readonly_context.js +12 -0
- package/dist/web/agents/run_config.js +2 -1
- package/dist/web/artifacts/file_artifact_service.js +506 -0
- package/dist/web/artifacts/gcs_artifact_service.js +139 -54
- package/dist/web/artifacts/in_memory_artifact_service.js +69 -8
- package/dist/web/artifacts/registry.js +28 -0
- package/dist/web/auth/auth_handler.js +3 -1
- package/dist/web/code_executors/base_code_executor.js +3 -1
- package/dist/web/code_executors/built_in_code_executor.js +7 -3
- package/dist/web/code_executors/code_executor_context.js +5 -5
- package/dist/web/common.js +12 -2
- package/dist/web/events/event.js +30 -5
- package/dist/web/events/event_actions.js +1 -1
- package/dist/web/events/structured_events.js +74 -0
- package/dist/web/index.js +18 -8
- package/dist/web/memory/in_memory_memory_service.js +3 -1
- package/dist/web/models/apigee_llm.js +219 -0
- package/dist/web/models/base_llm.js +8 -4
- package/dist/web/models/gemini_llm_connection.js +1 -0
- package/dist/web/models/google_llm.js +75 -50
- package/dist/web/models/registry.js +2 -0
- package/dist/web/plugins/base_plugin.js +12 -0
- package/dist/web/plugins/logging_plugin.js +55 -14
- package/dist/web/plugins/plugin_manager.js +56 -24
- package/dist/web/plugins/security_plugin.js +1 -1
- package/dist/web/runner/runner.js +192 -108
- package/dist/web/sessions/base_session_service.js +49 -1
- package/dist/web/sessions/database_session_service.js +368 -0
- package/dist/web/sessions/db/operations.js +87 -0
- package/dist/web/sessions/db/schema.js +172 -0
- package/dist/web/sessions/in_memory_session_service.js +61 -33
- package/dist/web/sessions/registry.js +25 -0
- package/dist/web/telemetry/google_cloud.js +7 -9
- package/dist/web/telemetry/setup.js +23 -9
- package/dist/web/telemetry/tracing.js +37 -15
- package/dist/web/tools/agent_tool.js +8 -4
- package/dist/web/tools/base_tool.js +4 -2
- package/dist/web/tools/forwarding_artifact_service.js +17 -1
- package/dist/web/tools/function_tool.js +1 -2
- package/dist/web/tools/google_search_tool.js +2 -5
- package/dist/web/tools/long_running_tool.js +3 -1
- package/dist/web/tools/mcp/mcp_session_manager.js +22 -12
- package/dist/web/tools/mcp/mcp_tool.js +1 -3
- package/dist/web/tools/mcp/mcp_toolset.js +1 -1
- package/dist/web/utils/env_aware_utils.js +9 -1
- package/dist/web/utils/gemini_schema_util.js +9 -4
- package/dist/web/utils/logger.js +43 -2
- package/dist/web/utils/object_notation_utils.js +47 -0
- package/dist/web/utils/simple_zod_to_json.js +102 -155
- package/dist/web/utils/variant_utils.js +1 -7
- package/dist/web/version.js +1 -1
- package/package.json +16 -5
- package/dist/cjs/index.js.map +0 -7
- package/dist/esm/index.js.map +0 -7
- package/dist/web/index.js.map +0 -7
|
@@ -3,6 +3,9 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
|
3
3
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
4
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name);
|
|
6
|
+
var __typeError = (msg) => {
|
|
7
|
+
throw TypeError(msg);
|
|
8
|
+
};
|
|
6
9
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
10
|
var __spreadValues = (a, b) => {
|
|
8
11
|
for (var prop in b || (b = {}))
|
|
@@ -30,6 +33,34 @@ var __asyncGenerator = (__this, __arguments, generator) => {
|
|
|
30
33
|
}, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {};
|
|
31
34
|
return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it;
|
|
32
35
|
};
|
|
36
|
+
var __yieldStar = (value) => {
|
|
37
|
+
var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {};
|
|
38
|
+
if (obj == null) {
|
|
39
|
+
obj = value[__knownSymbol("iterator")]();
|
|
40
|
+
method = (k) => it[k] = (x) => obj[k](x);
|
|
41
|
+
} else {
|
|
42
|
+
obj = obj.call(value);
|
|
43
|
+
method = (k) => it[k] = (v) => {
|
|
44
|
+
if (isAwait) {
|
|
45
|
+
isAwait = false;
|
|
46
|
+
if (k === "throw") throw v;
|
|
47
|
+
return v;
|
|
48
|
+
}
|
|
49
|
+
isAwait = true;
|
|
50
|
+
return {
|
|
51
|
+
done: false,
|
|
52
|
+
value: new __await(new Promise((resolve) => {
|
|
53
|
+
var x = obj[k](v);
|
|
54
|
+
if (!(x instanceof Object)) __typeError("Object expected");
|
|
55
|
+
resolve(x);
|
|
56
|
+
}), 1)
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => {
|
|
61
|
+
throw x;
|
|
62
|
+
}, "return" in obj && method("return"), it;
|
|
63
|
+
};
|
|
33
64
|
var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn) => (fn = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it);
|
|
34
65
|
/**
|
|
35
66
|
* @license
|
|
@@ -37,6 +68,7 @@ var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")])
|
|
|
37
68
|
* SPDX-License-Identifier: Apache-2.0
|
|
38
69
|
*/
|
|
39
70
|
var _a, _b;
|
|
71
|
+
import { context, trace } from "@opentelemetry/api";
|
|
40
72
|
import { cloneDeep } from "lodash-es";
|
|
41
73
|
import { z } from "zod";
|
|
42
74
|
import {
|
|
@@ -65,12 +97,18 @@ import {
|
|
|
65
97
|
} from "../models/llm_request.js";
|
|
66
98
|
import { LLMRegistry } from "../models/registry.js";
|
|
67
99
|
import { State } from "../sessions/state.js";
|
|
68
|
-
import {
|
|
100
|
+
import { isBaseTool } from "../tools/base_tool.js";
|
|
69
101
|
import { FunctionTool } from "../tools/function_tool.js";
|
|
70
102
|
import { ToolConfirmation } from "../tools/tool_confirmation.js";
|
|
71
103
|
import { ToolContext } from "../tools/tool_context.js";
|
|
72
104
|
import { base64Decode } from "../utils/env_aware_utils.js";
|
|
73
105
|
import { logger } from "../utils/logger.js";
|
|
106
|
+
import {
|
|
107
|
+
runAsyncGeneratorWithOtelContext,
|
|
108
|
+
traceCallLlm,
|
|
109
|
+
tracer
|
|
110
|
+
} from "../telemetry/tracing.js";
|
|
111
|
+
import { isZodObject, zodObjectToSchema } from "../utils/simple_zod_to_json.js";
|
|
74
112
|
import { BaseAgent } from "./base_agent.js";
|
|
75
113
|
import {
|
|
76
114
|
BaseLlmRequestProcessor
|
|
@@ -93,13 +131,14 @@ import { injectSessionState } from "./instructions.js";
|
|
|
93
131
|
import { ReadonlyContext } from "./readonly_context.js";
|
|
94
132
|
import { StreamingMode } from "./run_config.js";
|
|
95
133
|
const ADK_AGENT_NAME_LABEL_KEY = "adk_agent_name";
|
|
96
|
-
async function convertToolUnionToTools(toolUnion,
|
|
97
|
-
if (toolUnion
|
|
134
|
+
async function convertToolUnionToTools(toolUnion, context2) {
|
|
135
|
+
if (isBaseTool(toolUnion)) {
|
|
98
136
|
return [toolUnion];
|
|
99
137
|
}
|
|
100
|
-
return await toolUnion.getTools(
|
|
138
|
+
return await toolUnion.getTools(context2);
|
|
101
139
|
}
|
|
102
140
|
class BasicLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
141
|
+
// eslint-disable-next-line require-yield
|
|
103
142
|
runAsync(invocationContext, llmRequest) {
|
|
104
143
|
return __asyncGenerator(this, null, function* () {
|
|
105
144
|
var _a2;
|
|
@@ -126,6 +165,7 @@ class BasicLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
|
126
165
|
}
|
|
127
166
|
const BASIC_LLM_REQUEST_PROCESSOR = new BasicLlmRequestProcessor();
|
|
128
167
|
class IdentityLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
168
|
+
// eslint-disable-next-line require-yield
|
|
129
169
|
runAsync(invocationContext, llmRequest) {
|
|
130
170
|
return __asyncGenerator(this, null, function* () {
|
|
131
171
|
const agent = invocationContext.agent;
|
|
@@ -142,10 +182,11 @@ class InstructionsLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
|
142
182
|
/**
|
|
143
183
|
* Handles instructions and global instructions for LLM flow.
|
|
144
184
|
*/
|
|
185
|
+
// eslint-disable-next-line require-yield
|
|
145
186
|
runAsync(invocationContext, llmRequest) {
|
|
146
187
|
return __asyncGenerator(this, null, function* () {
|
|
147
188
|
const agent = invocationContext.agent;
|
|
148
|
-
if (!(agent
|
|
189
|
+
if (!isLlmAgent(agent) || !isLlmAgent(agent.rootAgent)) {
|
|
149
190
|
return;
|
|
150
191
|
}
|
|
151
192
|
const rootAgent = agent.rootAgent;
|
|
@@ -180,6 +221,7 @@ class InstructionsLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
|
180
221
|
}
|
|
181
222
|
const INSTRUCTIONS_LLM_REQUEST_PROCESSOR = new InstructionsLlmRequestProcessor();
|
|
182
223
|
class ContentRequestProcessor {
|
|
224
|
+
// eslint-disable-next-line require-yield
|
|
183
225
|
runAsync(invocationContext, llmRequest) {
|
|
184
226
|
return __asyncGenerator(this, null, function* () {
|
|
185
227
|
const agent = invocationContext.agent;
|
|
@@ -223,9 +265,10 @@ class AgentTransferLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
|
223
265
|
}
|
|
224
266
|
});
|
|
225
267
|
}
|
|
268
|
+
// eslint-disable-next-line require-yield
|
|
226
269
|
runAsync(invocationContext, llmRequest) {
|
|
227
270
|
return __asyncGenerator(this, null, function* () {
|
|
228
|
-
if (!(invocationContext.agent
|
|
271
|
+
if (!isLlmAgent(invocationContext.agent)) {
|
|
229
272
|
return;
|
|
230
273
|
}
|
|
231
274
|
const transferTargets = this.getTransferTargets(invocationContext.agent);
|
|
@@ -274,7 +317,7 @@ class AgentTransferLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
|
274
317
|
const AGENT_TRANSFER_LLM_REQUEST_PROCESSOR = new AgentTransferLlmRequestProcessor();
|
|
275
318
|
class RequestConfirmationLlmRequestProcessor extends BaseLlmRequestProcessor {
|
|
276
319
|
/** Handles tool confirmation information to build the LLM request. */
|
|
277
|
-
runAsync(invocationContext
|
|
320
|
+
runAsync(invocationContext) {
|
|
278
321
|
return __asyncGenerator(this, null, function* () {
|
|
279
322
|
const agent = invocationContext.agent;
|
|
280
323
|
if (!isLlmAgent(agent)) {
|
|
@@ -396,7 +439,7 @@ const REQUEST_CONFIRMATION_LLM_REQUEST_PROCESSOR = new RequestConfirmationLlmReq
|
|
|
396
439
|
class CodeExecutionRequestProcessor extends BaseLlmRequestProcessor {
|
|
397
440
|
runAsync(invocationContext, llmRequest) {
|
|
398
441
|
return __asyncGenerator(this, null, function* () {
|
|
399
|
-
if (!(invocationContext.agent
|
|
442
|
+
if (!isLlmAgent(invocationContext.agent)) {
|
|
400
443
|
return;
|
|
401
444
|
}
|
|
402
445
|
if (!invocationContext.agent.codeExecutor) {
|
|
@@ -422,7 +465,7 @@ class CodeExecutionRequestProcessor extends BaseLlmRequestProcessor {
|
|
|
422
465
|
}
|
|
423
466
|
for (const content of llmRequest.contents) {
|
|
424
467
|
const delimeters = invocationContext.agent.codeExecutor.codeBlockDelimiters.length ? invocationContext.agent.codeExecutor.codeBlockDelimiters[0] : ["", ""];
|
|
425
|
-
|
|
468
|
+
convertCodeExecutionParts(
|
|
426
469
|
content,
|
|
427
470
|
delimeters,
|
|
428
471
|
invocationContext.agent.codeExecutor.executionResultDelimiters
|
|
@@ -613,7 +656,7 @@ function runPostProcessor(invocationContext, llmResponse) {
|
|
|
613
656
|
codeExecutorContext,
|
|
614
657
|
codeExecutionResult
|
|
615
658
|
));
|
|
616
|
-
llmResponse.content =
|
|
659
|
+
llmResponse.content = void 0;
|
|
617
660
|
});
|
|
618
661
|
}
|
|
619
662
|
function extractAndReplaceInlineFiles(codeExecutorContext, llmRequest) {
|
|
@@ -730,8 +773,8 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
730
773
|
this.disallowTransferToParent = (_d = config.disallowTransferToParent) != null ? _d : false;
|
|
731
774
|
this.disallowTransferToPeers = (_e = config.disallowTransferToPeers) != null ? _e : false;
|
|
732
775
|
this.includeContents = (_f = config.includeContents) != null ? _f : "default";
|
|
733
|
-
this.inputSchema = config.inputSchema;
|
|
734
|
-
this.outputSchema = config.outputSchema;
|
|
776
|
+
this.inputSchema = isZodObject(config.inputSchema) ? zodObjectToSchema(config.inputSchema) : config.inputSchema;
|
|
777
|
+
this.outputSchema = isZodObject(config.outputSchema) ? zodObjectToSchema(config.outputSchema) : config.outputSchema;
|
|
735
778
|
this.outputKey = config.outputKey;
|
|
736
779
|
this.beforeModelCallback = config.beforeModelCallback;
|
|
737
780
|
this.afterModelCallback = config.afterModelCallback;
|
|
@@ -776,16 +819,6 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
776
819
|
this.disallowTransferToParent = true;
|
|
777
820
|
this.disallowTransferToPeers = true;
|
|
778
821
|
}
|
|
779
|
-
if (this.subAgents && this.subAgents.length > 0) {
|
|
780
|
-
throw new Error(
|
|
781
|
-
"Invalid config for agent ".concat(this.name, ": if outputSchema is set, subAgents must be empty to disable agent transfer.")
|
|
782
|
-
);
|
|
783
|
-
}
|
|
784
|
-
if (this.tools && this.tools.length > 0) {
|
|
785
|
-
throw new Error(
|
|
786
|
-
"Invalid config for agent ".concat(this.name, ": if outputSchema is set, tools must be empty")
|
|
787
|
-
);
|
|
788
|
-
}
|
|
789
822
|
}
|
|
790
823
|
}
|
|
791
824
|
/**
|
|
@@ -817,12 +850,12 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
817
850
|
* @param context The context to retrieve the session state.
|
|
818
851
|
* @returns The resolved instruction field.
|
|
819
852
|
*/
|
|
820
|
-
async canonicalInstruction(
|
|
853
|
+
async canonicalInstruction(context2) {
|
|
821
854
|
if (typeof this.instruction === "string") {
|
|
822
855
|
return { instruction: this.instruction, requireStateInjection: true };
|
|
823
856
|
}
|
|
824
857
|
return {
|
|
825
|
-
instruction: await this.instruction(
|
|
858
|
+
instruction: await this.instruction(context2),
|
|
826
859
|
requireStateInjection: false
|
|
827
860
|
};
|
|
828
861
|
}
|
|
@@ -833,12 +866,15 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
833
866
|
* @param context The context to retrieve the session state.
|
|
834
867
|
* @returns The resolved globalInstruction field.
|
|
835
868
|
*/
|
|
836
|
-
async canonicalGlobalInstruction(
|
|
869
|
+
async canonicalGlobalInstruction(context2) {
|
|
837
870
|
if (typeof this.globalInstruction === "string") {
|
|
838
|
-
return {
|
|
871
|
+
return {
|
|
872
|
+
instruction: this.globalInstruction,
|
|
873
|
+
requireStateInjection: true
|
|
874
|
+
};
|
|
839
875
|
}
|
|
840
876
|
return {
|
|
841
|
-
instruction: await this.globalInstruction(
|
|
877
|
+
instruction: await this.globalInstruction(context2),
|
|
842
878
|
requireStateInjection: false
|
|
843
879
|
};
|
|
844
880
|
}
|
|
@@ -847,10 +883,10 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
847
883
|
*
|
|
848
884
|
* This method is only for use by Agent Development Kit.
|
|
849
885
|
*/
|
|
850
|
-
async canonicalTools(
|
|
886
|
+
async canonicalTools(context2) {
|
|
851
887
|
const resolvedTools = [];
|
|
852
888
|
for (const toolUnion of this.tools) {
|
|
853
|
-
const tools = await convertToolUnionToTools(toolUnion,
|
|
889
|
+
const tools = await convertToolUnionToTools(toolUnion, context2);
|
|
854
890
|
resolvedTools.push(...tools);
|
|
855
891
|
}
|
|
856
892
|
return resolvedTools;
|
|
@@ -954,12 +990,12 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
954
990
|
}
|
|
955
991
|
event.actions.stateDelta[this.outputKey] = result;
|
|
956
992
|
}
|
|
957
|
-
runAsyncImpl(
|
|
993
|
+
runAsyncImpl(context2) {
|
|
958
994
|
return __asyncGenerator(this, null, function* () {
|
|
959
995
|
while (true) {
|
|
960
996
|
let lastEvent = void 0;
|
|
961
997
|
try {
|
|
962
|
-
for (var iter = __forAwait(this.runOneStepAsync(
|
|
998
|
+
for (var iter = __forAwait(this.runOneStepAsync(context2)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
963
999
|
const event = temp.value;
|
|
964
1000
|
lastEvent = event;
|
|
965
1001
|
this.maybeSaveOutputToState(event);
|
|
@@ -985,10 +1021,10 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
985
1021
|
}
|
|
986
1022
|
});
|
|
987
1023
|
}
|
|
988
|
-
runLiveImpl(
|
|
1024
|
+
runLiveImpl(context2) {
|
|
989
1025
|
return __asyncGenerator(this, null, function* () {
|
|
990
1026
|
try {
|
|
991
|
-
for (var iter = __forAwait(this.runLiveFlow(
|
|
1027
|
+
for (var iter = __forAwait(this.runLiveFlow(context2)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
992
1028
|
const event = temp.value;
|
|
993
1029
|
this.maybeSaveOutputToState(event);
|
|
994
1030
|
yield event;
|
|
@@ -1003,7 +1039,7 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1003
1039
|
throw error[0];
|
|
1004
1040
|
}
|
|
1005
1041
|
}
|
|
1006
|
-
if (
|
|
1042
|
+
if (context2.endInvocation) {
|
|
1007
1043
|
return;
|
|
1008
1044
|
}
|
|
1009
1045
|
});
|
|
@@ -1011,7 +1047,8 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1011
1047
|
// --------------------------------------------------------------------------
|
|
1012
1048
|
// #START LlmFlow Logic
|
|
1013
1049
|
// --------------------------------------------------------------------------
|
|
1014
|
-
|
|
1050
|
+
// eslint-disable-next-line require-yield
|
|
1051
|
+
runLiveFlow(_invocationContext) {
|
|
1015
1052
|
return __asyncGenerator(this, null, function* () {
|
|
1016
1053
|
yield new __await(Promise.resolve());
|
|
1017
1054
|
throw new Error("LlmAgent.runLiveFlow not implemented");
|
|
@@ -1062,51 +1099,72 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1062
1099
|
author: this.name,
|
|
1063
1100
|
branch: invocationContext.branch
|
|
1064
1101
|
});
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1102
|
+
const span = tracer.startSpan("call_llm");
|
|
1103
|
+
const ctx = trace.setSpan(context.active(), span);
|
|
1104
|
+
yield* __yieldStar(runAsyncGeneratorWithOtelContext(
|
|
1105
|
+
ctx,
|
|
1106
|
+
this,
|
|
1107
|
+
function() {
|
|
1108
|
+
return __asyncGenerator(this, null, function* () {
|
|
1109
|
+
const responsesGenerator = function() {
|
|
1110
|
+
return __asyncGenerator(this, null, function* () {
|
|
1111
|
+
try {
|
|
1112
|
+
for (var iter3 = __forAwait(this.callLlmAsync(
|
|
1113
|
+
invocationContext,
|
|
1114
|
+
llmRequest,
|
|
1115
|
+
modelResponseEvent
|
|
1116
|
+
)), more3, temp3, error3; more3 = !(temp3 = yield new __await(iter3.next())).done; more3 = false) {
|
|
1117
|
+
const llmResponse = temp3.value;
|
|
1118
|
+
try {
|
|
1119
|
+
for (var iter2 = __forAwait(this.postprocess(
|
|
1120
|
+
invocationContext,
|
|
1121
|
+
llmRequest,
|
|
1122
|
+
llmResponse,
|
|
1123
|
+
modelResponseEvent
|
|
1124
|
+
)), more2, temp2, error2; more2 = !(temp2 = yield new __await(iter2.next())).done; more2 = false) {
|
|
1125
|
+
const event = temp2.value;
|
|
1126
|
+
modelResponseEvent.id = createNewEventId();
|
|
1127
|
+
modelResponseEvent.timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
1128
|
+
yield event;
|
|
1129
|
+
}
|
|
1130
|
+
} catch (temp2) {
|
|
1131
|
+
error2 = [temp2];
|
|
1132
|
+
} finally {
|
|
1133
|
+
try {
|
|
1134
|
+
more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2)));
|
|
1135
|
+
} finally {
|
|
1136
|
+
if (error2)
|
|
1137
|
+
throw error2[0];
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
} catch (temp3) {
|
|
1142
|
+
error3 = [temp3];
|
|
1143
|
+
} finally {
|
|
1144
|
+
try {
|
|
1145
|
+
more3 && (temp3 = iter3.return) && (yield new __await(temp3.call(iter3)));
|
|
1146
|
+
} finally {
|
|
1147
|
+
if (error3)
|
|
1148
|
+
throw error3[0];
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
});
|
|
1152
|
+
};
|
|
1153
|
+
yield* __yieldStar(this.runAndHandleError(
|
|
1154
|
+
responsesGenerator.call(this),
|
|
1074
1155
|
invocationContext,
|
|
1075
1156
|
llmRequest,
|
|
1076
|
-
llmResponse,
|
|
1077
1157
|
modelResponseEvent
|
|
1078
|
-
))
|
|
1079
|
-
|
|
1080
|
-
modelResponseEvent.id = createNewEventId();
|
|
1081
|
-
modelResponseEvent.timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
1082
|
-
yield event;
|
|
1083
|
-
}
|
|
1084
|
-
} catch (temp2) {
|
|
1085
|
-
error2 = [temp2];
|
|
1086
|
-
} finally {
|
|
1087
|
-
try {
|
|
1088
|
-
more2 && (temp2 = iter2.return) && (yield new __await(temp2.call(iter2)));
|
|
1089
|
-
} finally {
|
|
1090
|
-
if (error2)
|
|
1091
|
-
throw error2[0];
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
} catch (temp3) {
|
|
1096
|
-
error3 = [temp3];
|
|
1097
|
-
} finally {
|
|
1098
|
-
try {
|
|
1099
|
-
more3 && (temp3 = iter3.return) && (yield new __await(temp3.call(iter3)));
|
|
1100
|
-
} finally {
|
|
1101
|
-
if (error3)
|
|
1102
|
-
throw error3[0];
|
|
1158
|
+
));
|
|
1159
|
+
});
|
|
1103
1160
|
}
|
|
1104
|
-
|
|
1161
|
+
));
|
|
1162
|
+
span.end();
|
|
1105
1163
|
});
|
|
1106
1164
|
}
|
|
1107
1165
|
postprocess(invocationContext, llmRequest, llmResponse, modelResponseEvent) {
|
|
1108
1166
|
return __asyncGenerator(this, null, function* () {
|
|
1109
|
-
var _a2;
|
|
1167
|
+
var _a2, _b2;
|
|
1110
1168
|
for (const processor of this.responseProcessors) {
|
|
1111
1169
|
try {
|
|
1112
1170
|
for (var iter = __forAwait(processor.runAsync(
|
|
@@ -1144,6 +1202,10 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1144
1202
|
if (!((_a2 = getFunctionCalls(mergedEvent)) == null ? void 0 : _a2.length)) {
|
|
1145
1203
|
return;
|
|
1146
1204
|
}
|
|
1205
|
+
if ((_b2 = invocationContext.runConfig) == null ? void 0 : _b2.pauseOnToolCalls) {
|
|
1206
|
+
invocationContext.endInvocation = true;
|
|
1207
|
+
return;
|
|
1208
|
+
}
|
|
1147
1209
|
const functionResponseEvent = yield new __await(handleFunctionCallsAsync({
|
|
1148
1210
|
invocationContext,
|
|
1149
1211
|
functionCallEvent: mergedEvent,
|
|
@@ -1168,6 +1230,8 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1168
1230
|
});
|
|
1169
1231
|
if (toolConfirmationEvent) {
|
|
1170
1232
|
yield toolConfirmationEvent;
|
|
1233
|
+
invocationContext.endInvocation = true;
|
|
1234
|
+
return;
|
|
1171
1235
|
}
|
|
1172
1236
|
yield functionResponseEvent;
|
|
1173
1237
|
const nextAgentName = functionResponseEvent.actions.transferToAgent;
|
|
@@ -1239,13 +1303,14 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1239
1303
|
((_e = invocationContext.runConfig) == null ? void 0 : _e.streamingMode) === StreamingMode.SSE
|
|
1240
1304
|
);
|
|
1241
1305
|
try {
|
|
1242
|
-
for (var iter = __forAwait(
|
|
1243
|
-
responsesGenerator,
|
|
1244
|
-
invocationContext,
|
|
1245
|
-
llmRequest,
|
|
1246
|
-
modelResponseEvent
|
|
1247
|
-
)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
1306
|
+
for (var iter = __forAwait(responsesGenerator), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
1248
1307
|
const llmResponse = temp.value;
|
|
1308
|
+
traceCallLlm({
|
|
1309
|
+
invocationContext,
|
|
1310
|
+
eventId: modelResponseEvent.id,
|
|
1311
|
+
llmRequest,
|
|
1312
|
+
llmResponse
|
|
1313
|
+
});
|
|
1249
1314
|
const alteredLlmResponse = yield new __await(this.handleAfterModelCallback(
|
|
1250
1315
|
invocationContext,
|
|
1251
1316
|
llmResponse,
|
|
@@ -1344,11 +1409,29 @@ class LlmAgent extends (_b = BaseAgent, _a = LLM_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
1344
1409
|
if (onModelErrorCallbackResponse) {
|
|
1345
1410
|
yield onModelErrorCallbackResponse;
|
|
1346
1411
|
} else {
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1412
|
+
let errorCode = "UNKNOWN_ERROR";
|
|
1413
|
+
let errorMessage = modelError.message;
|
|
1414
|
+
try {
|
|
1415
|
+
const errorResponse = JSON.parse(modelError.message);
|
|
1416
|
+
if (errorResponse == null ? void 0 : errorResponse.error) {
|
|
1417
|
+
errorCode = String(errorResponse.error.code || "UNKNOWN_ERROR");
|
|
1418
|
+
errorMessage = errorResponse.error.message || errorMessage;
|
|
1419
|
+
}
|
|
1420
|
+
} catch (e) {
|
|
1421
|
+
}
|
|
1422
|
+
if (modelResponseEvent.actions) {
|
|
1423
|
+
yield createEvent({
|
|
1424
|
+
invocationId: invocationContext.invocationId,
|
|
1425
|
+
author: this.name,
|
|
1426
|
+
errorCode,
|
|
1427
|
+
errorMessage
|
|
1428
|
+
});
|
|
1429
|
+
} else {
|
|
1430
|
+
yield {
|
|
1431
|
+
errorCode,
|
|
1432
|
+
errorMessage
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1352
1435
|
}
|
|
1353
1436
|
} else {
|
|
1354
1437
|
logger.error("Unknown error during response generation", modelError);
|
|
@@ -69,7 +69,8 @@ class LoopAgent extends (_b = BaseAgent, _a = LOOP_AGENT_SIGNATURE_SYMBOL, _b) {
|
|
|
69
69
|
return;
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
|
-
|
|
72
|
+
// eslint-disable-next-line require-yield
|
|
73
|
+
runLiveImpl(_context) {
|
|
73
74
|
return __asyncGenerator(this, null, function* () {
|
|
74
75
|
throw new Error("This is not supported yet for LoopAgent.");
|
|
75
76
|
});
|
|
@@ -38,9 +38,7 @@ class ParallelAgent extends (_b = BaseAgent, _a = PARALLEL_AGENT_SIGNATURE_SYMBO
|
|
|
38
38
|
runAsyncImpl(context) {
|
|
39
39
|
return __asyncGenerator(this, null, function* () {
|
|
40
40
|
const agentRuns = this.subAgents.map(
|
|
41
|
-
(subAgent) => subAgent.runAsync(
|
|
42
|
-
createBranchCtxForSubAgent(this, subAgent, context)
|
|
43
|
-
)
|
|
41
|
+
(subAgent) => subAgent.runAsync(createBranchCtxForSubAgent(this, subAgent, context))
|
|
44
42
|
);
|
|
45
43
|
try {
|
|
46
44
|
for (var iter = __forAwait(mergeAgentRuns(agentRuns)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) {
|
|
@@ -59,7 +57,8 @@ class ParallelAgent extends (_b = BaseAgent, _a = PARALLEL_AGENT_SIGNATURE_SYMBO
|
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
}
|
|
62
|
-
|
|
60
|
+
// eslint-disable-next-line require-yield
|
|
61
|
+
runLiveImpl(_context) {
|
|
63
62
|
return __asyncGenerator(this, null, function* () {
|
|
64
63
|
throw new Error("This is not supported yet for ParallelAgent.");
|
|
65
64
|
});
|
|
@@ -20,6 +20,18 @@ class ReadonlyContext {
|
|
|
20
20
|
get invocationId() {
|
|
21
21
|
return this.invocationContext.invocationId;
|
|
22
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* The user ID of the current session.
|
|
25
|
+
*/
|
|
26
|
+
get userId() {
|
|
27
|
+
return this.invocationContext.userId;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The ID of the current session.
|
|
31
|
+
*/
|
|
32
|
+
get sessionId() {
|
|
33
|
+
return this.invocationContext.session.id;
|
|
34
|
+
}
|
|
23
35
|
/**
|
|
24
36
|
* The current agent name.
|
|
25
37
|
*/
|
|
@@ -32,7 +32,8 @@ function createRunConfig(params = {}) {
|
|
|
32
32
|
supportCfc: false,
|
|
33
33
|
enableAffectiveDialog: false,
|
|
34
34
|
streamingMode: "none" /* NONE */,
|
|
35
|
-
maxLlmCalls: validateMaxLlmCalls(params.maxLlmCalls || 500)
|
|
35
|
+
maxLlmCalls: validateMaxLlmCalls(params.maxLlmCalls || 500),
|
|
36
|
+
pauseOnToolCalls: false
|
|
36
37
|
}, params);
|
|
37
38
|
}
|
|
38
39
|
function validateMaxLlmCalls(value) {
|