unique_toolkit 1.31.1__py3-none-any.whl → 1.31.2__py3-none-any.whl

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.
@@ -231,25 +231,6 @@ class _ToolManager(Generic[_ApiMode]):
231
231
  self,
232
232
  tool_calls: list[LanguageModelFunction],
233
233
  ) -> list[ToolCallResponse]:
234
- tool_calls = tool_calls
235
-
236
- tool_calls = self.filter_duplicate_tool_calls(
237
- tool_calls=tool_calls,
238
- )
239
- num_tool_calls = len(tool_calls)
240
-
241
- if num_tool_calls > self._config.max_tool_calls:
242
- self._logger.warning(
243
- (
244
- "Number of tool calls %s exceeds the allowed maximum of %s."
245
- "The tool calls will be reduced to the first %s."
246
- ),
247
- num_tool_calls,
248
- self._config.max_tool_calls,
249
- self._config.max_tool_calls,
250
- )
251
- tool_calls = tool_calls[: self._config.max_tool_calls]
252
-
253
234
  tool_call_responses = await self._execute_parallelized(tool_calls)
254
235
  return tool_call_responses
255
236
 
@@ -358,6 +339,22 @@ class _ToolManager(Generic[_ApiMode]):
358
339
  )
359
340
  return unique_tool_calls
360
341
 
342
+ def filter_tool_calls_by_max_tool_calls_allowed(
343
+ self, tool_calls: list[LanguageModelFunction]
344
+ ) -> list[LanguageModelFunction]:
345
+ if len(tool_calls) > self._config.max_tool_calls:
346
+ self._logger.warning(
347
+ (
348
+ "Number of tool calls %s exceeds the allowed maximum of %s."
349
+ "The tool calls will be reduced to the first %s."
350
+ ),
351
+ len(tool_calls),
352
+ self._config.max_tool_calls,
353
+ self._config.max_tool_calls,
354
+ )
355
+ return tool_calls[: self._config.max_tool_calls]
356
+ return tool_calls
357
+
361
358
  @overload
362
359
  def get_tool_by_name(
363
360
  self: "_ToolManager[Literal['completions']]", name: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 1.31.1
3
+ Version: 1.31.2
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Cedric Klinkert
@@ -121,6 +121,9 @@ All notable changes to this project will be documented in this file.
121
121
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
122
122
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
123
123
 
124
+ ## [1.31.2] - 2025-11-27
125
+ - Added the function `filter_tool_calls_by_max_tool_calls_allowed` in `tool_manager` to limit the number of parallel tool calls permitted per loop iteration.
126
+
124
127
  ## [1.31.1] - 2025-11-27
125
128
  - Various fixes to sub agent answers.
126
129
 
@@ -112,10 +112,9 @@ unique_toolkit/agentic/tools/openai_builtin/code_interpreter/service.py,sha256=X
112
112
  unique_toolkit/agentic/tools/openai_builtin/manager.py,sha256=QeDVgLfnCXrSmXI3b9bgQa9oyfQe_L15wa_YfhfNe9E,2633
113
113
  unique_toolkit/agentic/tools/schemas.py,sha256=TXshRvivr2hD-McXHumO0bp-Z0mz_GnAmQRiVjT59rU,5025
114
114
  unique_toolkit/agentic/tools/test/test_mcp_manager.py,sha256=VpB4k4Dh0lQWakilJMQSzO8sBXapuEC26cub_lorl-M,19221
115
- unique_toolkit/agentic/tools/test/test_tool_manager.py,sha256=eO7BSCRrw8iiPhrVL348Ch_yOobc6dUEqK_3OZ5heDw,48298
116
115
  unique_toolkit/agentic/tools/test/test_tool_progress_reporter.py,sha256=XHNezB8itj9KzpQgD0cwRtp2AgRUfUkQsHc3bTyPj6c,15801
117
116
  unique_toolkit/agentic/tools/tool.py,sha256=YmhGZ-NkPlgQ4X1hA6IVod10LNM5YErzbd0Zn6ANA98,6529
118
- unique_toolkit/agentic/tools/tool_manager.py,sha256=zOshUjQYuZe-_lN7DgPCT8UgXK-V34CzVBgF7f7XsWg,17549
117
+ unique_toolkit/agentic/tools/tool_manager.py,sha256=ZwzCcjzHYZgB1FxrpKRmarepfaZknIhLilxeyKoe4BY,17541
119
118
  unique_toolkit/agentic/tools/tool_progress_reporter.py,sha256=GaR0oqDUJZvBB9WCUVYYh0Zvs6U-LMygJCCrqPlitgA,10296
120
119
  unique_toolkit/agentic/tools/utils/__init__.py,sha256=s75sjY5nrJchjLGs3MwSIqhDW08fFXIaX7eRQjFIA4s,346
121
120
  unique_toolkit/agentic/tools/utils/execution/__init__.py,sha256=OHiKpqBnfhBiEQagKVWJsZlHv8smPp5OI4dFIexzibw,37
@@ -189,7 +188,7 @@ unique_toolkit/short_term_memory/service.py,sha256=5PeVBu1ZCAfyDb2HLVvlmqSbyzBBu
189
188
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
190
189
  unique_toolkit/smart_rules/compile.py,sha256=Ozhh70qCn2yOzRWr9d8WmJeTo7AQurwd3tStgBMPFLA,1246
191
190
  unique_toolkit/test_utilities/events.py,sha256=_mwV2bs5iLjxS1ynDCjaIq-gjjKhXYCK-iy3dRfvO3g,6410
192
- unique_toolkit-1.31.1.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
193
- unique_toolkit-1.31.1.dist-info/METADATA,sha256=xnIZXap3GPV6kt0ML-vhtAoFiSI4JVU5RWtt_qLNgtw,44716
194
- unique_toolkit-1.31.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
195
- unique_toolkit-1.31.1.dist-info/RECORD,,
191
+ unique_toolkit-1.31.2.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
192
+ unique_toolkit-1.31.2.dist-info/METADATA,sha256=FU5HB8zOBqLFAp77GYJskJr5r3PJefSRQs9zrvVDUxQ,44900
193
+ unique_toolkit-1.31.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
194
+ unique_toolkit-1.31.2.dist-info/RECORD,,