@google/adk 0.2.2 → 0.2.3
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 +12 -2
- package/dist/cjs/agents/functions.js +13 -3
- package/dist/cjs/agents/llm_agent.js +13 -3
- package/dist/cjs/code_executors/built_in_code_executor.js +1 -1
- package/dist/cjs/code_executors/code_execution_utils.js +12 -2
- package/dist/cjs/code_executors/code_executor_context.js +12 -2
- package/dist/cjs/common.js +3 -0
- package/dist/cjs/index.js +11 -16
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/sessions/in_memory_session_service.js +13 -3
- package/dist/cjs/utils/model_name.js +24 -4
- 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/built_in_code_executor.js +2 -2
- 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/common.js +2 -0
- package/dist/esm/index.js +11 -16
- package/dist/esm/index.js.map +3 -3
- package/dist/esm/sessions/in_memory_session_service.js +1 -1
- package/dist/esm/utils/model_name.js +23 -3
- package/dist/esm/version.js +1 -1
- package/dist/types/common.d.ts +1 -0
- package/dist/types/utils/model_name.d.ts +1 -1
- package/dist/types/version.d.ts +2 -2
- 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/built_in_code_executor.js +2 -2
- 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/common.js +2 -0
- package/dist/web/index.js +1 -6
- package/dist/web/index.js.map +3 -3
- package/dist/web/sessions/in_memory_session_service.js +1 -1
- package/dist/web/utils/model_name.js +23 -3
- package/dist/web/version.js +1 -1
- package/package.json +3 -3
- package/dist/cjs/utils/deep_clone.js +0 -44
- package/dist/esm/utils/deep_clone.js +0 -14
- package/dist/types/utils/deep_clone.d.ts +0 -1
- package/dist/web/utils/deep_clone.js +0 -14
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import
|
|
6
|
+
import cloneDeep from "lodash-es/cloneDeep.js";
|
|
7
7
|
import { randomUUID } from "../utils/env_aware_utils.js";
|
|
8
8
|
import { logger } from "../utils/logger.js";
|
|
9
9
|
import { BaseSessionService } from "./base_session_service.js";
|
|
@@ -15,17 +15,37 @@ function isGeminiModel(modelString) {
|
|
|
15
15
|
const modelName = extractModelName(modelString);
|
|
16
16
|
return modelName.startsWith("gemini-");
|
|
17
17
|
}
|
|
18
|
+
function parseVersion(versionString) {
|
|
19
|
+
if (!/^\d+(\.\d+)*$/.test(versionString)) {
|
|
20
|
+
return { valid: false, major: 0, minor: 0, patch: 0 };
|
|
21
|
+
}
|
|
22
|
+
const parts = versionString.split(".").map((part) => parseInt(part, 10));
|
|
23
|
+
return {
|
|
24
|
+
valid: true,
|
|
25
|
+
major: parts[0],
|
|
26
|
+
minor: parts.length > 1 ? parts[1] : 0,
|
|
27
|
+
patch: parts.length > 2 ? parts[2] : 0
|
|
28
|
+
};
|
|
29
|
+
}
|
|
18
30
|
function isGemini1Model(modelString) {
|
|
19
31
|
const modelName = extractModelName(modelString);
|
|
20
32
|
return modelName.startsWith("gemini-1");
|
|
21
33
|
}
|
|
22
|
-
function
|
|
34
|
+
function isGemini2OrAbove(modelString) {
|
|
35
|
+
if (!modelString) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
23
38
|
const modelName = extractModelName(modelString);
|
|
24
|
-
|
|
39
|
+
if (!modelName.startsWith("gemini-")) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
const versionString = modelName.slice("gemini-".length).split("-", 1)[0];
|
|
43
|
+
const parsedVersion = parseVersion(versionString);
|
|
44
|
+
return parsedVersion.valid && parsedVersion.major >= 2;
|
|
25
45
|
}
|
|
26
46
|
export {
|
|
27
47
|
extractModelName,
|
|
28
48
|
isGemini1Model,
|
|
29
|
-
|
|
49
|
+
isGemini2OrAbove,
|
|
30
50
|
isGeminiModel
|
|
31
51
|
};
|
package/dist/web/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google/adk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "Google ADK JS",
|
|
5
5
|
"author": "Google",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"@google/genai": "1.32.0",
|
|
43
43
|
"@modelcontextprotocol/sdk": "^1.24.0",
|
|
44
44
|
"google-auth-library": "^10.3.0",
|
|
45
|
-
"lodash": "^4.17.
|
|
45
|
+
"lodash-es": "^4.17.22",
|
|
46
46
|
"zod": "3.25.76"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/lodash": "^4.17.
|
|
49
|
+
"@types/lodash-es": "^4.17.12",
|
|
50
50
|
"openapi-types": "^12.1.3"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2025 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 __export = (target, all) => {
|
|
13
|
-
for (var name in all)
|
|
14
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
-
var deep_clone_exports = {};
|
|
26
|
-
__export(deep_clone_exports, {
|
|
27
|
-
deepClone: () => deepClone
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(deep_clone_exports);
|
|
30
|
-
/**
|
|
31
|
-
* @license
|
|
32
|
-
* Copyright 2025 Google LLC
|
|
33
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
34
|
-
*/
|
|
35
|
-
function deepClone(obj) {
|
|
36
|
-
if (obj === void 0) {
|
|
37
|
-
return void 0;
|
|
38
|
-
}
|
|
39
|
-
return JSON.parse(JSON.stringify(obj));
|
|
40
|
-
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
deepClone
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function deepClone<T>(obj: T): T;
|