unique_toolkit 1.1.5__py3-none-any.whl → 1.1.6__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.
@@ -1,5 +1,6 @@
1
+ import json
1
2
  from enum import StrEnum
2
- from typing import Any
3
+ from typing import Any, Dict
3
4
 
4
5
  from pydantic import (
5
6
  BaseModel,
@@ -98,10 +99,46 @@ class ToolBuildConfig(BaseModel):
98
99
  value["configuration"] = config
99
100
  return value
100
101
 
101
-
102
- def _rebuild_config_model():
103
- """Rebuild the ToolBuildConfig model to resolve forward references."""
104
- # Import here to avoid circular imports
105
- from unique_toolkit.agentic.tools.schemas import BaseToolConfig # noqa: F401
106
-
107
- ToolBuildConfig.model_rebuild()
102
+ def model_dump(self) -> Dict[str, Any]:
103
+ """
104
+ Returns a dict representation of the tool config that preserves
105
+ subclass fields from `configuration` by delegating to its own
106
+ model_dump. This prevents `{}` when `configuration` is typed
107
+ as `BaseToolConfig` but holds a subclass instance.
108
+ """
109
+ data: Dict[str, Any] = {
110
+ "name": self.name,
111
+ "configuration": self.configuration.model_dump()
112
+ if self.configuration
113
+ else None,
114
+ "display_name": self.display_name,
115
+ "icon": self.icon,
116
+ "selection_policy": self.selection_policy,
117
+ "is_exclusive": self.is_exclusive,
118
+ "is_sub_agent": self.is_sub_agent,
119
+ "is_enabled": self.is_enabled,
120
+ }
121
+ return data
122
+
123
+ def model_dump_json(self) -> str:
124
+ """
125
+ Returns a JSON string representation of the tool config.
126
+ Ensures `configuration` is fully serialized by using the
127
+ subclass's `model_dump_json()` when available.
128
+ """
129
+ config_json = (
130
+ self.configuration.model_dump_json() if self.configuration else None
131
+ )
132
+ config = json.loads(config_json) if config_json else None
133
+
134
+ data: Dict[str, Any] = {
135
+ "name": self.name,
136
+ "configuration": config,
137
+ "display_name": self.display_name,
138
+ "icon": self.icon,
139
+ "selection_policy": self.selection_policy,
140
+ "is_exclusive": self.is_exclusive,
141
+ "is_sub_agent": self.is_sub_agent,
142
+ "is_enabled": self.is_enabled,
143
+ }
144
+ return json.dumps(data)
@@ -6,7 +6,7 @@ from pydantic import BaseModel, Field
6
6
 
7
7
  from unique_toolkit.agentic.evaluation.schemas import EvaluationMetricName
8
8
  from unique_toolkit.agentic.tools.a2a.manager import A2AManager
9
- from unique_toolkit.agentic.tools.config import ToolBuildConfig, _rebuild_config_model
9
+ from unique_toolkit.agentic.tools.config import ToolBuildConfig
10
10
  from unique_toolkit.agentic.tools.factory import ToolFactory
11
11
  from unique_toolkit.agentic.tools.mcp.manager import MCPManager
12
12
  from unique_toolkit.agentic.tools.schemas import ToolCallResponse, ToolPrompts
@@ -23,9 +23,6 @@ from unique_toolkit.language_model.schemas import (
23
23
  LanguageModelToolDescription,
24
24
  )
25
25
 
26
- # Rebuild the config model now that all imports are resolved
27
- _rebuild_config_model()
28
-
29
26
 
30
27
  class ForcedToolOption:
31
28
  type: str = "function"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: unique_toolkit
3
- Version: 1.1.5
3
+ Version: 1.1.6
4
4
  Summary:
5
5
  License: Proprietary
6
6
  Author: Cedric Klinkert
@@ -118,7 +118,10 @@ All notable changes to this project will be documented in this file.
118
118
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
119
119
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
120
120
 
121
- ## [1.1.4] - 2025-09-23
121
+ ## [1.1.6] - 2025-09-23
122
+ - Fix model_dump for `ToolBuildConfig`
123
+
124
+ ## [1.1.5] - 2025-09-23
122
125
  - Fix a circular import and add tests for `ToolBuildConfig`
123
126
 
124
127
  ## [1.1.4] - 2025-09-23
@@ -56,7 +56,7 @@ unique_toolkit/agentic/tools/a2a/memory.py,sha256=4VFBzITCv5E_8YCc4iF4Y6FhzplS2C
56
56
  unique_toolkit/agentic/tools/a2a/schema.py,sha256=T1l5z6trtPE5nhqPzt5tvfRNDhqL_ST1Wj7_lBWJ58g,304
57
57
  unique_toolkit/agentic/tools/a2a/service.py,sha256=7n7BkJxTR-hpoQczfHLK8eS0rtATL7-YARH-4netbbI,5339
58
58
  unique_toolkit/agentic/tools/agent_chunks_hanlder.py,sha256=x32Dp1Z8cVW5i-XzXbaMwX2KHPcNGmqEU-FB4AV9ZGo,1909
59
- unique_toolkit/agentic/tools/config.py,sha256=NWFp8Kr8LOSoOk0cy207tFnenomu3HXSjEqMvi7tJJQ,3221
59
+ unique_toolkit/agentic/tools/config.py,sha256=B9Tl0uJ81XB4SjSke4kSydame4glGT2s69ZXfr0ViZU,4634
60
60
  unique_toolkit/agentic/tools/factory.py,sha256=Wt0IGSbLg8ZTq5PU9p_JTW0LtNATWLpc3336irJKXlM,1277
61
61
  unique_toolkit/agentic/tools/mcp/__init__.py,sha256=RLF_p-LDRC7GhiB3fdCi4u3bh6V9PY_w26fg61BLyco,122
62
62
  unique_toolkit/agentic/tools/mcp/manager.py,sha256=DPYwwDe6RSZyuPaxn-je49fP_qOOs0ZV46EM6GZcV4c,2748
@@ -66,7 +66,7 @@ unique_toolkit/agentic/tools/schemas.py,sha256=0ZR8xCdGj1sEdPE0lfTIG2uSR5zqWoprU
66
66
  unique_toolkit/agentic/tools/test/test_mcp_manager.py,sha256=9F7FjpYKeOkg2Z4bt2H1WGaxu9fzB-1iiE-b7g3KzQk,15724
67
67
  unique_toolkit/agentic/tools/test/test_tool_progress_reporter.py,sha256=dod5QPqgGUInVAGXAbsAKNTEypIi6pUEWhDbJr9YfUU,6307
68
68
  unique_toolkit/agentic/tools/tool.py,sha256=m56VLxiHuKU2_J5foZp00xhm5lTxWEW7zRLGbIE9ssU,6744
69
- unique_toolkit/agentic/tools/tool_manager.py,sha256=RWz6hKzuTTqzry5KpaeSfsO84zMp6RqVfX59YWFYblc,11034
69
+ unique_toolkit/agentic/tools/tool_manager.py,sha256=E1eKZuc7eHPeGFqrGfdMGPNLqu3NYhrfKDjSJxMSuvU,10925
70
70
  unique_toolkit/agentic/tools/tool_progress_reporter.py,sha256=ixud9VoHey1vlU1t86cW0-WTvyTwMxNSWBon8I11SUk,7955
71
71
  unique_toolkit/agentic/tools/utils/__init__.py,sha256=iD1YYzf9LcJFv95Z8BqCAFSewNBabybZRZyvPKGfvro,27
72
72
  unique_toolkit/agentic/tools/utils/execution/__init__.py,sha256=OHiKpqBnfhBiEQagKVWJsZlHv8smPp5OI4dFIexzibw,37
@@ -128,7 +128,7 @@ unique_toolkit/short_term_memory/schemas.py,sha256=OhfcXyF6ACdwIXW45sKzjtZX_gkcJ
128
128
  unique_toolkit/short_term_memory/service.py,sha256=5PeVBu1ZCAfyDb2HLVvlmqSbyzBBuE9sI2o9Aajqjxg,8884
129
129
  unique_toolkit/smart_rules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
130
130
  unique_toolkit/smart_rules/compile.py,sha256=cxWjb2dxEI2HGsakKdVCkSNi7VK9mr08w5sDcFCQyWI,9553
131
- unique_toolkit-1.1.5.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
132
- unique_toolkit-1.1.5.dist-info/METADATA,sha256=J5VKFRheot-bjwdjbOoXzTR4NlgWvq5dNZ1ffBE7sVg,32806
133
- unique_toolkit-1.1.5.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
134
- unique_toolkit-1.1.5.dist-info/RECORD,,
131
+ unique_toolkit-1.1.6.dist-info/LICENSE,sha256=GlN8wHNdh53xwOPg44URnwag6TEolCjoq3YD_KrWgss,193
132
+ unique_toolkit-1.1.6.dist-info/METADATA,sha256=sMJptXKLbf2ULpa6UcCWdX_mi7W-B5rQLNvHq0X1Q5A,32870
133
+ unique_toolkit-1.1.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
134
+ unique_toolkit-1.1.6.dist-info/RECORD,,