arcade-core 3.3.1__tar.gz → 3.3.3__tar.gz

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 (29) hide show
  1. {arcade_core-3.3.1 → arcade_core-3.3.3}/PKG-INFO +1 -1
  2. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/catalog.py +38 -6
  3. {arcade_core-3.3.1 → arcade_core-3.3.3}/pyproject.toml +1 -1
  4. {arcade_core-3.3.1 → arcade_core-3.3.3}/.gitignore +0 -0
  5. {arcade_core-3.3.1 → arcade_core-3.3.3}/README.md +0 -0
  6. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/__init__.py +0 -0
  7. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/annotations.py +0 -0
  8. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/auth.py +0 -0
  9. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/config.py +0 -0
  10. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/config_model.py +0 -0
  11. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/constants.py +0 -0
  12. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/context.py +0 -0
  13. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/converters/openai.py +0 -0
  14. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/discovery.py +0 -0
  15. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/errors.py +0 -0
  16. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/executor.py +0 -0
  17. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/output.py +0 -0
  18. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/parse.py +0 -0
  19. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/py.typed +0 -0
  20. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/schema.py +0 -0
  21. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/toolkit.py +0 -0
  22. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/usage/__init__.py +0 -0
  23. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/usage/__main__.py +0 -0
  24. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/usage/constants.py +0 -0
  25. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/usage/identity.py +0 -0
  26. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/usage/usage_service.py +0 -0
  27. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/usage/utils.py +0 -0
  28. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/utils.py +0 -0
  29. {arcade_core-3.3.1 → arcade_core-3.3.3}/arcade_core/version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arcade-core
3
- Version: 3.3.1
3
+ Version: 3.3.3
4
4
  Summary: Arcade Core - Core library for Arcade platform
5
5
  Author-email: Arcade <dev@arcade.dev>
6
6
  License: MIT
@@ -203,9 +203,18 @@ class ToolCatalog(BaseModel):
203
203
  tool_func: Callable,
204
204
  toolkit_or_name: str | Toolkit,
205
205
  module: ModuleType | None = None,
206
+ toolkit_version: str | None = None,
207
+ toolkit_description: str | None = None,
206
208
  ) -> None:
207
209
  """
208
210
  Add a function to the catalog as a tool.
211
+
212
+ Args:
213
+ tool_func: The function to add to the catalog.
214
+ toolkit_or_name: The toolkit or name of the toolkit.
215
+ module: The module to add the tool from.
216
+ toolkit_version: The version of the toolkit. Overrides the version of the toolkit if provided.
217
+ toolkit_description: The description of the toolkit. Overrides the description of the toolkit if provided.
209
218
  """
210
219
 
211
220
  input_model, output_model = create_func_models(tool_func)
@@ -213,6 +222,8 @@ class ToolCatalog(BaseModel):
213
222
  if isinstance(toolkit_or_name, Toolkit):
214
223
  toolkit = toolkit_or_name
215
224
  toolkit_name = toolkit.name
225
+ toolkit_version = toolkit_version or toolkit.version
226
+ toolkit_description = toolkit_description or toolkit.description
216
227
  elif isinstance(toolkit_or_name, str):
217
228
  toolkit = None
218
229
  toolkit_name = toolkit_or_name
@@ -223,8 +234,8 @@ class ToolCatalog(BaseModel):
223
234
  definition = ToolCatalog.create_tool_definition(
224
235
  tool_func,
225
236
  toolkit_name,
226
- toolkit.version if toolkit else None,
227
- toolkit.description if toolkit else None,
237
+ toolkit_version,
238
+ toolkit_description,
228
239
  )
229
240
 
230
241
  fully_qualified_name = definition.get_fully_qualified_name()
@@ -255,22 +266,37 @@ class ToolCatalog(BaseModel):
255
266
  output_model=output_model,
256
267
  )
257
268
 
258
- def add_module(self, module: ModuleType, name: str | None = None) -> None:
269
+ def add_module(
270
+ self,
271
+ module: ModuleType,
272
+ name: str | None = None,
273
+ version: str | None = None,
274
+ description: str | None = None,
275
+ ) -> None:
259
276
  """
260
277
  Add all the tools in a module to the catalog.
261
278
 
262
279
  Args:
263
280
  module: The module to add.
264
281
  name: Optionally override the name of the toolkit with this parameter
282
+ version: Optionally override the version of the toolkit with this parameter
283
+ description: Optionally override the description of the toolkit with this parameter
265
284
  """
266
285
  toolkit = Toolkit.from_module(module)
267
286
  if name:
268
287
  toolkit.name = name
269
- self.add_toolkit(toolkit)
288
+ self.add_toolkit(toolkit, version=version, description=description)
270
289
 
271
- def add_toolkit(self, toolkit: Toolkit) -> None:
290
+ def add_toolkit(
291
+ self, toolkit: Toolkit, version: str | None = None, description: str | None = None
292
+ ) -> None:
272
293
  """
273
294
  Add the tools from a loaded toolkit to the catalog.
295
+
296
+ Args:
297
+ toolkit: The toolkit to add.
298
+ version: Optionally override the version of the toolkit with this parameter
299
+ description: Optionally override the description of the toolkit with this parameter
274
300
  """
275
301
 
276
302
  if str(toolkit).lower() in self._disabled_toolkits:
@@ -282,7 +308,13 @@ class ToolCatalog(BaseModel):
282
308
  try:
283
309
  module = import_module(module_name)
284
310
  tool_func = getattr(module, tool_name)
285
- self.add_tool(tool_func, toolkit, module)
311
+ self.add_tool(
312
+ tool_func,
313
+ toolkit,
314
+ module,
315
+ toolkit_version=version,
316
+ toolkit_description=description,
317
+ )
286
318
  except ToolDefinitionError as e:
287
319
  raise e.with_context(tool_name) from e
288
320
  except ToolkitLoadError as e:
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arcade-core"
3
- version = "3.3.1"
3
+ version = "3.3.3"
4
4
  description = "Arcade Core - Core library for Arcade platform"
5
5
  readme = "README.md"
6
6
  license = {text = "MIT"}
File without changes
File without changes