@google/adk 0.2.2 → 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.
Files changed (47) hide show
  1. package/dist/cjs/agents/content_processor_utils.js +2 -2
  2. package/dist/cjs/agents/functions.js +3 -3
  3. package/dist/cjs/agents/llm_agent.js +3 -3
  4. package/dist/cjs/code_executors/built_in_code_executor.js +1 -1
  5. package/dist/cjs/code_executors/code_execution_utils.js +2 -2
  6. package/dist/cjs/code_executors/code_executor_context.js +2 -2
  7. package/dist/cjs/common.js +3 -0
  8. package/dist/cjs/index.js +11 -16
  9. package/dist/cjs/index.js.map +3 -3
  10. package/dist/cjs/runner/runner.js +5 -4
  11. package/dist/cjs/sessions/in_memory_session_service.js +3 -3
  12. package/dist/cjs/utils/model_name.js +24 -4
  13. package/dist/cjs/version.js +2 -2
  14. package/dist/esm/agents/content_processor_utils.js +1 -1
  15. package/dist/esm/agents/functions.js +1 -1
  16. package/dist/esm/agents/llm_agent.js +1 -1
  17. package/dist/esm/code_executors/built_in_code_executor.js +2 -2
  18. package/dist/esm/code_executors/code_execution_utils.js +1 -1
  19. package/dist/esm/code_executors/code_executor_context.js +1 -1
  20. package/dist/esm/common.js +2 -0
  21. package/dist/esm/index.js +11 -16
  22. package/dist/esm/index.js.map +3 -3
  23. package/dist/esm/runner/runner.js +5 -4
  24. package/dist/esm/sessions/in_memory_session_service.js +1 -1
  25. package/dist/esm/utils/model_name.js +23 -3
  26. package/dist/esm/version.js +2 -2
  27. package/dist/types/common.d.ts +1 -0
  28. package/dist/types/utils/model_name.d.ts +1 -1
  29. package/dist/types/version.d.ts +2 -2
  30. package/dist/web/agents/content_processor_utils.js +1 -1
  31. package/dist/web/agents/functions.js +1 -1
  32. package/dist/web/agents/llm_agent.js +1 -1
  33. package/dist/web/code_executors/built_in_code_executor.js +2 -2
  34. package/dist/web/code_executors/code_execution_utils.js +1 -1
  35. package/dist/web/code_executors/code_executor_context.js +1 -1
  36. package/dist/web/common.js +2 -0
  37. package/dist/web/index.js +1 -6
  38. package/dist/web/index.js.map +3 -3
  39. package/dist/web/runner/runner.js +5 -4
  40. package/dist/web/sessions/in_memory_session_service.js +1 -1
  41. package/dist/web/utils/model_name.js +23 -3
  42. package/dist/web/version.js +2 -2
  43. package/package.json +4 -4
  44. package/dist/cjs/utils/deep_clone.js +0 -44
  45. package/dist/esm/utils/deep_clone.js +0 -14
  46. package/dist/types/utils/deep_clone.d.ts +0 -1
  47. package/dist/web/utils/deep_clone.js +0 -14
@@ -28,7 +28,7 @@ __export(content_processor_utils_exports, {
28
28
  getCurrentTurnContents: () => getCurrentTurnContents
29
29
  });
30
30
  module.exports = __toCommonJS(content_processor_utils_exports);
31
- var import_lodash = require("lodash");
31
+ var import_lodash_es = require("lodash-es");
32
32
  var import_event = require("../events/event.js");
33
33
  var import_functions = require("./functions.js");
34
34
  /**
@@ -60,7 +60,7 @@ function getContents(events, agentName, currentBranch) {
60
60
  resultEvents = rearrangeEventsForAsyncFunctionResponsesInHistory(resultEvents);
61
61
  const contents = [];
62
62
  for (const event of resultEvents) {
63
- const content = (0, import_lodash.cloneDeep)(event.content);
63
+ const content = (0, import_lodash_es.cloneDeep)(event.content);
64
64
  (0, import_functions.removeClientFunctionCallId)(content);
65
65
  contents.push(content);
66
66
  }
@@ -39,7 +39,7 @@ __export(functions_exports, {
39
39
  });
40
40
  module.exports = __toCommonJS(functions_exports);
41
41
  var import_genai = require("@google/genai");
42
- var import_lodash = require("lodash");
42
+ var import_lodash_es = require("lodash-es");
43
43
  var import_event = require("../events/event.js");
44
44
  var import_event_actions = require("../events/event_actions.js");
45
45
  var import_tool_context = require("../tools/tool_context.js");
@@ -95,7 +95,7 @@ function getLongRunningFunctionCalls(functionCalls, toolsDict) {
95
95
  }
96
96
  function generateAuthEvent(invocationContext, functionResponseEvent) {
97
97
  var _a;
98
- if (!((_a = functionResponseEvent.actions) == null ? void 0 : _a.requestedAuthConfigs) || (0, import_lodash.isEmpty)(functionResponseEvent.actions.requestedAuthConfigs)) {
98
+ if (!((_a = functionResponseEvent.actions) == null ? void 0 : _a.requestedAuthConfigs) || (0, import_lodash_es.isEmpty)(functionResponseEvent.actions.requestedAuthConfigs)) {
99
99
  return void 0;
100
100
  }
101
101
  const parts = [];
@@ -131,7 +131,7 @@ function generateRequestConfirmationEvent({
131
131
  functionResponseEvent
132
132
  }) {
133
133
  var _a, _b;
134
- if (!((_a = functionResponseEvent.actions) == null ? void 0 : _a.requestedToolConfirmations) || (0, import_lodash.isEmpty)(functionResponseEvent.actions.requestedToolConfirmations)) {
134
+ if (!((_a = functionResponseEvent.actions) == null ? void 0 : _a.requestedToolConfirmations) || (0, import_lodash_es.isEmpty)(functionResponseEvent.actions.requestedToolConfirmations)) {
135
135
  return;
136
136
  }
137
137
  const parts = [];
@@ -29,7 +29,7 @@ __export(llm_agent_exports, {
29
29
  responseProcessor: () => responseProcessor
30
30
  });
31
31
  module.exports = __toCommonJS(llm_agent_exports);
32
- var import_lodash = require("lodash");
32
+ var import_lodash_es = require("lodash-es");
33
33
  var import_zod = require("zod");
34
34
  var import_base_code_executor = require("../code_executors/base_code_executor.js");
35
35
  var import_built_in_code_executor = require("../code_executors/built_in_code_executor.js");
@@ -483,7 +483,7 @@ async function* runPreProcessor(invocationContext, llmRequest) {
483
483
  (0, import_code_execution_utils.buildExecutableCodePart)(codeStr)
484
484
  ]
485
485
  };
486
- llmRequest.contents.push((0, import_lodash.cloneDeep)(codeContent));
486
+ llmRequest.contents.push((0, import_lodash_es.cloneDeep)(codeContent));
487
487
  yield (0, import_event.createEvent)({
488
488
  invocationId: invocationContext.invocationId,
489
489
  author: agent.name,
@@ -512,7 +512,7 @@ async function* runPreProcessor(invocationContext, llmRequest) {
512
512
  codeExecutionResult
513
513
  );
514
514
  yield executionResultEvent;
515
- llmRequest.contents.push((0, import_lodash.cloneDeep)(executionResultEvent.content));
515
+ llmRequest.contents.push((0, import_lodash_es.cloneDeep)(executionResultEvent.content));
516
516
  }
517
517
  }
518
518
  async function* runPostProcessor(invocationContext, llmResponse) {
@@ -43,7 +43,7 @@ class BuiltInCodeExecutor extends import_base_code_executor.BaseCodeExecutor {
43
43
  });
44
44
  }
45
45
  processLlmRequest(llmRequest) {
46
- if (llmRequest.model && (0, import_model_name.isGemini2Model)(llmRequest.model)) {
46
+ if (llmRequest.model && (0, import_model_name.isGemini2OrAbove)(llmRequest.model)) {
47
47
  llmRequest.config = llmRequest.config || {};
48
48
  llmRequest.config.tools = llmRequest.config.tools || [];
49
49
  llmRequest.config.tools.push({ codeExecution: {} });
@@ -32,7 +32,7 @@ __export(code_execution_utils_exports, {
32
32
  });
33
33
  module.exports = __toCommonJS(code_execution_utils_exports);
34
34
  var import_genai = require("@google/genai");
35
- var import_lodash = require("lodash");
35
+ var import_lodash_es = require("lodash-es");
36
36
  var import_env_aware_utils = require("../utils/env_aware_utils.js");
37
37
  /**
38
38
  * @license
@@ -58,7 +58,7 @@ function extractCodeAndTruncateContent(content, codeBlockDelimiters) {
58
58
  if (!textParts.length) {
59
59
  return "";
60
60
  }
61
- const firstTextPart = (0, import_lodash.cloneDeep)(textParts[0]);
61
+ const firstTextPart = (0, import_lodash_es.cloneDeep)(textParts[0]);
62
62
  const responseText = textParts.map((part) => part.text).join("\n");
63
63
  const leadingDelimiterPattern = codeBlockDelimiters.map((d) => d[0]).join("|");
64
64
  const trailingDelimiterPattern = codeBlockDelimiters.map((d) => d[1]).join("|");
@@ -27,7 +27,7 @@ __export(code_executor_context_exports, {
27
27
  CodeExecutorContext: () => CodeExecutorContext
28
28
  });
29
29
  module.exports = __toCommonJS(code_executor_context_exports);
30
- var import_lodash = require("lodash");
30
+ var import_lodash_es = require("lodash-es");
31
31
  /**
32
32
  * @license
33
33
  * Copyright 2025 Google LLC
@@ -52,7 +52,7 @@ class CodeExecutorContext {
52
52
  */
53
53
  getStateDelta() {
54
54
  return {
55
- [CONTEXT_KEY]: (0, import_lodash.cloneDeep)(this.context)
55
+ [CONTEXT_KEY]: (0, import_lodash_es.cloneDeep)(this.context)
56
56
  };
57
57
  }
58
58
  /**
@@ -71,6 +71,7 @@ __export(common_exports, {
71
71
  isBaseAgent: () => import_base_agent.isBaseAgent,
72
72
  isBaseLlm: () => import_base_llm.isBaseLlm,
73
73
  isFinalResponse: () => import_event.isFinalResponse,
74
+ isGemini2OrAbove: () => import_model_name.isGemini2OrAbove,
74
75
  setLogLevel: () => import_logger.setLogLevel,
75
76
  stringifyContent: () => import_event.stringifyContent,
76
77
  version: () => import_version.version,
@@ -113,6 +114,7 @@ var import_long_running_tool = require("./tools/long_running_tool.js");
113
114
  var import_tool_confirmation = require("./tools/tool_confirmation.js");
114
115
  var import_tool_context = require("./tools/tool_context.js");
115
116
  var import_logger = require("./utils/logger.js");
117
+ var import_model_name = require("./utils/model_name.js");
116
118
  var import_simple_zod_to_json = require("./utils/simple_zod_to_json.js");
117
119
  var import_version = require("./version.js");
118
120
  __reExport(common_exports, require("./artifacts/base_artifact_service.js"), module.exports);
@@ -172,6 +174,7 @@ __reExport(common_exports, require("./tools/base_tool.js"), module.exports);
172
174
  isBaseAgent,
173
175
  isBaseLlm,
174
176
  isFinalResponse,
177
+ isGemini2OrAbove,
175
178
  setLogLevel,
176
179
  stringifyContent,
177
180
  version,