@google/adk 0.2.3 → 0.2.4
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/content_processor_utils.js +2 -12
- package/dist/cjs/agents/functions.js +3 -13
- package/dist/cjs/agents/llm_agent.js +3 -13
- package/dist/cjs/code_executors/code_execution_utils.js +2 -12
- package/dist/cjs/code_executors/code_executor_context.js +2 -12
- package/dist/cjs/index.js +11 -11
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/runner/runner.js +5 -4
- package/dist/cjs/sessions/in_memory_session_service.js +3 -13
- package/dist/cjs/version.js +1 -1
- package/dist/esm/agents/content_processor_utils.js +1 -1
- package/dist/esm/agents/functions.js +1 -1
- package/dist/esm/agents/llm_agent.js +1 -1
- package/dist/esm/code_executors/code_execution_utils.js +1 -1
- package/dist/esm/code_executors/code_executor_context.js +1 -1
- package/dist/esm/index.js +9 -9
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/runner/runner.js +5 -4
- package/dist/esm/sessions/in_memory_session_service.js +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/web/agents/content_processor_utils.js +1 -1
- package/dist/web/agents/functions.js +1 -1
- package/dist/web/agents/llm_agent.js +1 -1
- package/dist/web/code_executors/code_execution_utils.js +1 -1
- package/dist/web/code_executors/code_executor_context.js +1 -1
- package/dist/web/index.js +1 -1
- package/dist/web/index.js.map +3 -3
- package/dist/web/runner/runner.js +5 -4
- package/dist/web/sessions/in_memory_session_service.js +1 -1
- package/dist/web/version.js +1 -1
- package/package.json +2 -2
|
@@ -37,6 +37,7 @@ var import_event = require("../events/event.js");
|
|
|
37
37
|
var import_event_actions = require("../events/event_actions.js");
|
|
38
38
|
var import_plugin_manager = require("../plugins/plugin_manager.js");
|
|
39
39
|
var import_logger = require("../utils/logger.js");
|
|
40
|
+
var import_model_name = require("../utils/model_name.js");
|
|
40
41
|
/**
|
|
41
42
|
* @license
|
|
42
43
|
* Copyright 2025 Google LLC
|
|
@@ -87,12 +88,12 @@ class Runner {
|
|
|
87
88
|
}
|
|
88
89
|
if (runConfig.supportCfc && this.agent instanceof import_llm_agent.LlmAgent) {
|
|
89
90
|
const modelName = this.agent.canonicalModel.model;
|
|
90
|
-
if (!
|
|
91
|
+
if (!(0, import_model_name.isGemini2OrAbove)(modelName)) {
|
|
91
92
|
throw new Error(`CFC is not supported for model: ${modelName} in agent: ${this.agent.name}`);
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
if (!(this.agent.codeExecutor instanceof import_built_in_code_executor.BuiltInCodeExecutor)) {
|
|
95
|
+
this.agent.codeExecutor = new import_built_in_code_executor.BuiltInCodeExecutor();
|
|
96
|
+
}
|
|
96
97
|
}
|
|
97
98
|
const invocationContext = new import_invocation_context.InvocationContext({
|
|
98
99
|
artifactService: this.artifactService,
|
|
@@ -5,11 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
"use strict";
|
|
8
|
-
var __create = Object.create;
|
|
9
8
|
var __defProp = Object.defineProperty;
|
|
10
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
10
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
12
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
13
11
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
12
|
var __export = (target, all) => {
|
|
15
13
|
for (var name in all)
|
|
@@ -23,21 +21,13 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
23
21
|
}
|
|
24
22
|
return to;
|
|
25
23
|
};
|
|
26
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
27
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
28
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
29
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
30
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
31
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
32
|
-
mod
|
|
33
|
-
));
|
|
34
24
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
35
25
|
var in_memory_session_service_exports = {};
|
|
36
26
|
__export(in_memory_session_service_exports, {
|
|
37
27
|
InMemorySessionService: () => InMemorySessionService
|
|
38
28
|
});
|
|
39
29
|
module.exports = __toCommonJS(in_memory_session_service_exports);
|
|
40
|
-
var
|
|
30
|
+
var import_lodash_es = require("lodash-es");
|
|
41
31
|
var import_env_aware_utils = require("../utils/env_aware_utils.js");
|
|
42
32
|
var import_logger = require("../utils/logger.js");
|
|
43
33
|
var import_base_session_service = require("./base_session_service.js");
|
|
@@ -82,7 +72,7 @@ class InMemorySessionService extends import_base_session_service.BaseSessionServ
|
|
|
82
72
|
}
|
|
83
73
|
this.sessions[appName][userId][session.id] = session;
|
|
84
74
|
return Promise.resolve(
|
|
85
|
-
this.mergeState(appName, userId, (0,
|
|
75
|
+
this.mergeState(appName, userId, (0, import_lodash_es.cloneDeep)(session))
|
|
86
76
|
);
|
|
87
77
|
}
|
|
88
78
|
getSession({ appName, userId, sessionId, config }) {
|
|
@@ -90,7 +80,7 @@ class InMemorySessionService extends import_base_session_service.BaseSessionServ
|
|
|
90
80
|
return Promise.resolve(void 0);
|
|
91
81
|
}
|
|
92
82
|
const session = this.sessions[appName][userId][sessionId];
|
|
93
|
-
const copiedSession = (0,
|
|
83
|
+
const copiedSession = (0, import_lodash_es.cloneDeep)(session);
|
|
94
84
|
if (config) {
|
|
95
85
|
if (config.numRecentEvents) {
|
|
96
86
|
copiedSession.events = copiedSession.events.slice(-config.numRecentEvents);
|
package/dist/cjs/version.js
CHANGED
|
@@ -32,7 +32,7 @@ module.exports = __toCommonJS(version_exports);
|
|
|
32
32
|
* Copyright 2025 Google LLC
|
|
33
33
|
* SPDX-License-Identifier: Apache-2.0
|
|
34
34
|
*/
|
|
35
|
-
const version = "0.2.
|
|
35
|
+
const version = "0.2.4";
|
|
36
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
37
37
|
0 && (module.exports = {
|
|
38
38
|
version
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import cloneDeep from "lodash-es
|
|
6
|
+
import { cloneDeep } from "lodash-es";
|
|
7
7
|
import { createEvent, getFunctionCalls, getFunctionResponses } from "../events/event.js";
|
|
8
8
|
import { removeClientFunctionCallId, REQUEST_CONFIRMATION_FUNCTION_CALL_NAME, REQUEST_EUC_FUNCTION_CALL_NAME } from "./functions.js";
|
|
9
9
|
function getContents(events, agentName, currentBranch) {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { createUserContent } from "@google/genai";
|
|
7
|
-
import isEmpty from "lodash-es
|
|
7
|
+
import { isEmpty } from "lodash-es";
|
|
8
8
|
import { createEvent, getFunctionCalls } from "../events/event.js";
|
|
9
9
|
import { mergeEventActions } from "../events/event_actions.js";
|
|
10
10
|
import { ToolContext } from "../tools/tool_context.js";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import cloneDeep from "lodash-es
|
|
6
|
+
import { cloneDeep } from "lodash-es";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { BaseCodeExecutor } from "../code_executors/base_code_executor.js";
|
|
9
9
|
import { BuiltInCodeExecutor } from "../code_executors/built_in_code_executor.js";
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { Language, Outcome } from "@google/genai";
|
|
7
|
-
import cloneDeep from "lodash-es
|
|
7
|
+
import { cloneDeep } from "lodash-es";
|
|
8
8
|
import { base64Encode, isBase64Encoded } from "../utils/env_aware_utils.js";
|
|
9
9
|
function getEncodedFileContent(data) {
|
|
10
10
|
return isBase64Encoded(data) ? data : base64Encode(data);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import cloneDeep from "lodash-es
|
|
6
|
+
import { cloneDeep } from "lodash-es";
|
|
7
7
|
const CONTEXT_KEY = "_code_execution_context";
|
|
8
8
|
const SESSION_ID_KEY = "execution_session_id";
|
|
9
9
|
const PROCESSED_FILE_NAMES_KEY = "processed_input_files";
|