composio-smol 0.7.1__py3-none-any.whl → 0.7.15__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.
composio_smol/toolset.py CHANGED
@@ -76,6 +76,7 @@ class ComposioToolSet(
76
76
  action: str,
77
77
  description: str,
78
78
  schema_params: t.Dict,
79
+ skip_default: bool = False,
79
80
  entity_id: t.Optional[str] = None,
80
81
  ):
81
82
  def function(**kwargs: t.Any) -> t.Dict:
@@ -96,7 +97,8 @@ class ComposioToolSet(
96
97
  )
97
98
  action_func.__signature__ = Signature( # type: ignore
98
99
  parameters=get_signature_format_from_schema_params(
99
- schema_params=schema_params
100
+ schema_params=schema_params,
101
+ skip_default=skip_default,
100
102
  )
101
103
  )
102
104
 
@@ -108,6 +110,7 @@ class ComposioToolSet(
108
110
  self,
109
111
  schema: t.Dict[str, t.Any],
110
112
  entity_id: t.Optional[str] = None,
113
+ skip_default: bool = False,
111
114
  ) -> StructuredTool:
112
115
  """Wraps composio tool as StructuredTool object."""
113
116
  action = schema["name"]
@@ -117,10 +120,16 @@ class ComposioToolSet(
117
120
  action=action,
118
121
  description=description,
119
122
  schema_params=schema_params,
123
+ skip_default=skip_default,
120
124
  entity_id=entity_id,
121
125
  )
122
126
  # Flatten and format the parameters structure
123
127
  params = schema_params["properties"]
128
+ required_params = schema_params.get("required", [])
129
+ for param_name, param_info in params.items():
130
+ if param_name not in required_params:
131
+ param_info["nullable"] = True
132
+
124
133
  tool = StructuredTool(
125
134
  name=action,
126
135
  description=description,
@@ -138,6 +147,7 @@ class ComposioToolSet(
138
147
  entity_id: t.Optional[str] = None,
139
148
  *,
140
149
  processors: t.Optional[ProcessorsType] = None,
150
+ skip_default: bool = False,
141
151
  check_connected_accounts: bool = True,
142
152
  ) -> t.Sequence[StructuredTool]:
143
153
  """
@@ -154,12 +164,12 @@ class ComposioToolSet(
154
164
  self.validate_tools(apps=apps, actions=actions, tags=tags)
155
165
  if processors is not None:
156
166
  self._processor_helpers.merge_processors(processors)
167
+
157
168
  return [
158
169
  self._wrap_tool(
159
- schema=tool.model_dump(
160
- exclude_none=True,
161
- ),
170
+ schema=tool.model_dump(exclude_none=True),
162
171
  entity_id=entity_id or self.entity_id,
172
+ skip_default=skip_default,
163
173
  )
164
174
  for tool in self.get_action_schemas(
165
175
  actions=actions,
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: composio_smol
3
- Version: 0.7.1
3
+ Version: 0.7.15
4
4
  Summary: Use Composio to get array of strongly typed tools for Smol Agents
5
5
  Home-page: https://github.com/ComposioHQ/composio
6
6
  Author: Composio
@@ -0,0 +1,6 @@
1
+ composio_smol/__init__.py,sha256=vhykKuh6fZ6F21wGUvm3A6NTaeCnPwOMBwq4u5opBKE,246
2
+ composio_smol/toolset.py,sha256=jaDLCvas4Lc-hzhixn_pHMCPL-cZNIyTfak2h3CQfHY,5716
3
+ composio_smol-0.7.15.dist-info/METADATA,sha256=Mciucyaw7EAbTu_znfsj5IR1yKNrDaK7OTm5s3qKe80,3122
4
+ composio_smol-0.7.15.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
5
+ composio_smol-0.7.15.dist-info/top_level.txt,sha256=QWxT62bXOYLbM34nE31Y8_cdXufUB-ZFgcjnxMd5tLc,14
6
+ composio_smol-0.7.15.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.0)
2
+ Generator: setuptools (78.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- composio_smol/__init__.py,sha256=vhykKuh6fZ6F21wGUvm3A6NTaeCnPwOMBwq4u5opBKE,246
2
- composio_smol/toolset.py,sha256=Q5aBVlLX9A4euB9RRuWt4lpvDbNdPlsOTFxFevBx890,5309
3
- composio_smol-0.7.1.dist-info/METADATA,sha256=rt7QClLbYeZV6Sq9mcbPt4w9RUFIynnhIoO1Xckf7XI,3121
4
- composio_smol-0.7.1.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
5
- composio_smol-0.7.1.dist-info/top_level.txt,sha256=QWxT62bXOYLbM34nE31Y8_cdXufUB-ZFgcjnxMd5tLc,14
6
- composio_smol-0.7.1.dist-info/RECORD,,