h2ogpte 1.6.38rc3__py3-none-any.whl → 1.6.40rc1__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.
Files changed (35) hide show
  1. h2ogpte/__init__.py +1 -1
  2. h2ogpte/h2ogpte.py +122 -0
  3. h2ogpte/h2ogpte_async.py +123 -0
  4. h2ogpte/rest_async/__init__.py +8 -1
  5. h2ogpte/rest_async/api/agents_api.py +1181 -22
  6. h2ogpte/rest_async/api/permissions_api.py +550 -2
  7. h2ogpte/rest_async/api_client.py +1 -1
  8. h2ogpte/rest_async/configuration.py +1 -1
  9. h2ogpte/rest_async/models/__init__.py +7 -0
  10. h2ogpte/rest_async/models/add_custom_agent_tool201_response_inner.py +87 -0
  11. h2ogpte/rest_async/models/confirm_user_deletion_request.py +87 -0
  12. h2ogpte/rest_async/models/create_agent_tool_request.py +103 -0
  13. h2ogpte/rest_async/models/list_custom_agent_tools200_response_inner.py +95 -0
  14. h2ogpte/rest_async/models/prompt_template.py +3 -1
  15. h2ogpte/rest_async/models/update_custom_agent_tool200_response.py +87 -0
  16. h2ogpte/rest_async/models/update_custom_agent_tool_request.py +87 -0
  17. h2ogpte/rest_async/models/user_deletion_request.py +87 -0
  18. h2ogpte/rest_sync/__init__.py +8 -1
  19. h2ogpte/rest_sync/api/agents_api.py +1181 -22
  20. h2ogpte/rest_sync/api/permissions_api.py +550 -2
  21. h2ogpte/rest_sync/api_client.py +1 -1
  22. h2ogpte/rest_sync/configuration.py +1 -1
  23. h2ogpte/rest_sync/models/__init__.py +7 -0
  24. h2ogpte/rest_sync/models/add_custom_agent_tool201_response_inner.py +87 -0
  25. h2ogpte/rest_sync/models/confirm_user_deletion_request.py +87 -0
  26. h2ogpte/rest_sync/models/create_agent_tool_request.py +103 -0
  27. h2ogpte/rest_sync/models/list_custom_agent_tools200_response_inner.py +95 -0
  28. h2ogpte/rest_sync/models/prompt_template.py +3 -1
  29. h2ogpte/rest_sync/models/update_custom_agent_tool200_response.py +87 -0
  30. h2ogpte/rest_sync/models/update_custom_agent_tool_request.py +87 -0
  31. h2ogpte/rest_sync/models/user_deletion_request.py +87 -0
  32. {h2ogpte-1.6.38rc3.dist-info → h2ogpte-1.6.40rc1.dist-info}/METADATA +1 -1
  33. {h2ogpte-1.6.38rc3.dist-info → h2ogpte-1.6.40rc1.dist-info}/RECORD +35 -21
  34. {h2ogpte-1.6.38rc3.dist-info → h2ogpte-1.6.40rc1.dist-info}/WHEEL +0 -0
  35. {h2ogpte-1.6.38rc3.dist-info → h2ogpte-1.6.40rc1.dist-info}/top_level.txt +0 -0
@@ -16,9 +16,10 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
16
16
  from typing import Any, Dict, List, Optional, Tuple, Union
17
17
  from typing_extensions import Annotated
18
18
 
19
- from pydantic import Field, StrictInt, StrictStr
20
- from typing import List, Optional
19
+ from pydantic import Field, StrictBytes, StrictInt, StrictStr
20
+ from typing import List, Optional, Tuple, Union
21
21
  from typing_extensions import Annotated
22
+ from h2ogpte.rest_sync.models.add_custom_agent_tool201_response_inner import AddCustomAgentTool201ResponseInner
22
23
  from h2ogpte.rest_sync.models.agent_key import AgentKey
23
24
  from h2ogpte.rest_sync.models.agent_server_directory_stats_per_agent_chat_session import AgentServerDirectoryStatsPerAgentChatSession
24
25
  from h2ogpte.rest_sync.models.agent_tool_key_associations import AgentToolKeyAssociations
@@ -26,8 +27,11 @@ from h2ogpte.rest_sync.models.agent_tool_spec import AgentToolSpec
26
27
  from h2ogpte.rest_sync.models.count import Count
27
28
  from h2ogpte.rest_sync.models.create_agent_key_request import CreateAgentKeyRequest
28
29
  from h2ogpte.rest_sync.models.create_agent_tool_key_associations_request import CreateAgentToolKeyAssociationsRequest
30
+ from h2ogpte.rest_sync.models.list_custom_agent_tools200_response_inner import ListCustomAgentTools200ResponseInner
29
31
  from h2ogpte.rest_sync.models.update_agent_key_request import UpdateAgentKeyRequest
30
32
  from h2ogpte.rest_sync.models.update_agent_tool_preference_request import UpdateAgentToolPreferenceRequest
33
+ from h2ogpte.rest_sync.models.update_custom_agent_tool200_response import UpdateCustomAgentTool200Response
34
+ from h2ogpte.rest_sync.models.update_custom_agent_tool_request import UpdateCustomAgentToolRequest
31
35
 
32
36
  from h2ogpte.rest_sync.api_client import ApiClient, RequestSerialized
33
37
  from h2ogpte.rest_sync.api_response import ApiResponse
@@ -47,6 +51,343 @@ class AgentsApi:
47
51
  self.api_client = api_client
48
52
 
49
53
 
54
+ @validate_call
55
+ def add_custom_agent_tool(
56
+ self,
57
+ tool_type: StrictStr,
58
+ tool_args: StrictStr,
59
+ file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
60
+ custom_tool_path: Optional[StrictStr] = None,
61
+ filename: Optional[StrictStr] = None,
62
+ _request_timeout: Union[
63
+ None,
64
+ Annotated[StrictFloat, Field(gt=0)],
65
+ Tuple[
66
+ Annotated[StrictFloat, Field(gt=0)],
67
+ Annotated[StrictFloat, Field(gt=0)]
68
+ ]
69
+ ] = None,
70
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
71
+ _content_type: Optional[StrictStr] = None,
72
+ _headers: Optional[Dict[StrictStr, Any]] = None,
73
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
74
+ ) -> List[AddCustomAgentTool201ResponseInner]:
75
+ """Add Custom Agent Tools
76
+
77
+ Add Custom Agent Tools
78
+
79
+ :param tool_type: (required)
80
+ :type tool_type: str
81
+ :param tool_args: (required)
82
+ :type tool_args: str
83
+ :param file:
84
+ :type file: bytearray
85
+ :param custom_tool_path:
86
+ :type custom_tool_path: str
87
+ :param filename:
88
+ :type filename: str
89
+ :param _request_timeout: timeout setting for this request. If one
90
+ number provided, it will be total request
91
+ timeout. It can also be a pair (tuple) of
92
+ (connection, read) timeouts.
93
+ :type _request_timeout: int, tuple(int, int), optional
94
+ :param _request_auth: set to override the auth_settings for an a single
95
+ request; this effectively ignores the
96
+ authentication in the spec for a single request.
97
+ :type _request_auth: dict, optional
98
+ :param _content_type: force content-type for the request.
99
+ :type _content_type: str, Optional
100
+ :param _headers: set to override the headers for a single
101
+ request; this effectively ignores the headers
102
+ in the spec for a single request.
103
+ :type _headers: dict, optional
104
+ :param _host_index: set to override the host_index for a single
105
+ request; this effectively ignores the host_index
106
+ in the spec for a single request.
107
+ :type _host_index: int, optional
108
+ :return: Returns the result object.
109
+ """ # noqa: E501
110
+
111
+ _param = self._add_custom_agent_tool_serialize(
112
+ tool_type=tool_type,
113
+ tool_args=tool_args,
114
+ file=file,
115
+ custom_tool_path=custom_tool_path,
116
+ filename=filename,
117
+ _request_auth=_request_auth,
118
+ _content_type=_content_type,
119
+ _headers=_headers,
120
+ _host_index=_host_index
121
+ )
122
+
123
+ _response_types_map: Dict[str, Optional[str]] = {
124
+ '201': "List[AddCustomAgentTool201ResponseInner]",
125
+ '401': "EndpointError",
126
+ }
127
+ response_data = self.api_client.call_api(
128
+ *_param,
129
+ _request_timeout=_request_timeout
130
+ )
131
+ response_data.read()
132
+ return self.api_client.response_deserialize(
133
+ response_data=response_data,
134
+ response_types_map=_response_types_map,
135
+ ).data
136
+
137
+
138
+ @validate_call
139
+ def add_custom_agent_tool_with_http_info(
140
+ self,
141
+ tool_type: StrictStr,
142
+ tool_args: StrictStr,
143
+ file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
144
+ custom_tool_path: Optional[StrictStr] = None,
145
+ filename: Optional[StrictStr] = None,
146
+ _request_timeout: Union[
147
+ None,
148
+ Annotated[StrictFloat, Field(gt=0)],
149
+ Tuple[
150
+ Annotated[StrictFloat, Field(gt=0)],
151
+ Annotated[StrictFloat, Field(gt=0)]
152
+ ]
153
+ ] = None,
154
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
155
+ _content_type: Optional[StrictStr] = None,
156
+ _headers: Optional[Dict[StrictStr, Any]] = None,
157
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
158
+ ) -> ApiResponse[List[AddCustomAgentTool201ResponseInner]]:
159
+ """Add Custom Agent Tools
160
+
161
+ Add Custom Agent Tools
162
+
163
+ :param tool_type: (required)
164
+ :type tool_type: str
165
+ :param tool_args: (required)
166
+ :type tool_args: str
167
+ :param file:
168
+ :type file: bytearray
169
+ :param custom_tool_path:
170
+ :type custom_tool_path: str
171
+ :param filename:
172
+ :type filename: str
173
+ :param _request_timeout: timeout setting for this request. If one
174
+ number provided, it will be total request
175
+ timeout. It can also be a pair (tuple) of
176
+ (connection, read) timeouts.
177
+ :type _request_timeout: int, tuple(int, int), optional
178
+ :param _request_auth: set to override the auth_settings for an a single
179
+ request; this effectively ignores the
180
+ authentication in the spec for a single request.
181
+ :type _request_auth: dict, optional
182
+ :param _content_type: force content-type for the request.
183
+ :type _content_type: str, Optional
184
+ :param _headers: set to override the headers for a single
185
+ request; this effectively ignores the headers
186
+ in the spec for a single request.
187
+ :type _headers: dict, optional
188
+ :param _host_index: set to override the host_index for a single
189
+ request; this effectively ignores the host_index
190
+ in the spec for a single request.
191
+ :type _host_index: int, optional
192
+ :return: Returns the result object.
193
+ """ # noqa: E501
194
+
195
+ _param = self._add_custom_agent_tool_serialize(
196
+ tool_type=tool_type,
197
+ tool_args=tool_args,
198
+ file=file,
199
+ custom_tool_path=custom_tool_path,
200
+ filename=filename,
201
+ _request_auth=_request_auth,
202
+ _content_type=_content_type,
203
+ _headers=_headers,
204
+ _host_index=_host_index
205
+ )
206
+
207
+ _response_types_map: Dict[str, Optional[str]] = {
208
+ '201': "List[AddCustomAgentTool201ResponseInner]",
209
+ '401': "EndpointError",
210
+ }
211
+ response_data = self.api_client.call_api(
212
+ *_param,
213
+ _request_timeout=_request_timeout
214
+ )
215
+ response_data.read()
216
+ return self.api_client.response_deserialize(
217
+ response_data=response_data,
218
+ response_types_map=_response_types_map,
219
+ )
220
+
221
+
222
+ @validate_call
223
+ def add_custom_agent_tool_without_preload_content(
224
+ self,
225
+ tool_type: StrictStr,
226
+ tool_args: StrictStr,
227
+ file: Optional[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]] = None,
228
+ custom_tool_path: Optional[StrictStr] = None,
229
+ filename: Optional[StrictStr] = None,
230
+ _request_timeout: Union[
231
+ None,
232
+ Annotated[StrictFloat, Field(gt=0)],
233
+ Tuple[
234
+ Annotated[StrictFloat, Field(gt=0)],
235
+ Annotated[StrictFloat, Field(gt=0)]
236
+ ]
237
+ ] = None,
238
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
239
+ _content_type: Optional[StrictStr] = None,
240
+ _headers: Optional[Dict[StrictStr, Any]] = None,
241
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
242
+ ) -> RESTResponseType:
243
+ """Add Custom Agent Tools
244
+
245
+ Add Custom Agent Tools
246
+
247
+ :param tool_type: (required)
248
+ :type tool_type: str
249
+ :param tool_args: (required)
250
+ :type tool_args: str
251
+ :param file:
252
+ :type file: bytearray
253
+ :param custom_tool_path:
254
+ :type custom_tool_path: str
255
+ :param filename:
256
+ :type filename: str
257
+ :param _request_timeout: timeout setting for this request. If one
258
+ number provided, it will be total request
259
+ timeout. It can also be a pair (tuple) of
260
+ (connection, read) timeouts.
261
+ :type _request_timeout: int, tuple(int, int), optional
262
+ :param _request_auth: set to override the auth_settings for an a single
263
+ request; this effectively ignores the
264
+ authentication in the spec for a single request.
265
+ :type _request_auth: dict, optional
266
+ :param _content_type: force content-type for the request.
267
+ :type _content_type: str, Optional
268
+ :param _headers: set to override the headers for a single
269
+ request; this effectively ignores the headers
270
+ in the spec for a single request.
271
+ :type _headers: dict, optional
272
+ :param _host_index: set to override the host_index for a single
273
+ request; this effectively ignores the host_index
274
+ in the spec for a single request.
275
+ :type _host_index: int, optional
276
+ :return: Returns the result object.
277
+ """ # noqa: E501
278
+
279
+ _param = self._add_custom_agent_tool_serialize(
280
+ tool_type=tool_type,
281
+ tool_args=tool_args,
282
+ file=file,
283
+ custom_tool_path=custom_tool_path,
284
+ filename=filename,
285
+ _request_auth=_request_auth,
286
+ _content_type=_content_type,
287
+ _headers=_headers,
288
+ _host_index=_host_index
289
+ )
290
+
291
+ _response_types_map: Dict[str, Optional[str]] = {
292
+ '201': "List[AddCustomAgentTool201ResponseInner]",
293
+ '401': "EndpointError",
294
+ }
295
+ response_data = self.api_client.call_api(
296
+ *_param,
297
+ _request_timeout=_request_timeout
298
+ )
299
+ return response_data.response
300
+
301
+
302
+ def _add_custom_agent_tool_serialize(
303
+ self,
304
+ tool_type,
305
+ tool_args,
306
+ file,
307
+ custom_tool_path,
308
+ filename,
309
+ _request_auth,
310
+ _content_type,
311
+ _headers,
312
+ _host_index,
313
+ ) -> RequestSerialized:
314
+
315
+ _host = None
316
+
317
+ _collection_formats: Dict[str, str] = {
318
+ }
319
+
320
+ _path_params: Dict[str, str] = {}
321
+ _query_params: List[Tuple[str, str]] = []
322
+ _header_params: Dict[str, Optional[str]] = _headers or {}
323
+ _form_params: List[Tuple[str, str]] = []
324
+ _files: Dict[
325
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
326
+ ] = {}
327
+ _body_params: Optional[bytes] = None
328
+
329
+ # process the path parameters
330
+ # process the query parameters
331
+ # process the header parameters
332
+ # process the form parameters
333
+ if file is not None:
334
+ _files['file'] = file
335
+ if tool_type is not None:
336
+ _form_params.append(('tool_type', tool_type))
337
+ if tool_args is not None:
338
+ _form_params.append(('tool_args', tool_args))
339
+ if custom_tool_path is not None:
340
+ _form_params.append(('custom_tool_path', custom_tool_path))
341
+ if filename is not None:
342
+ _form_params.append(('filename', filename))
343
+ # process the body parameter
344
+
345
+
346
+ # set the HTTP header `Accept`
347
+ if 'Accept' not in _header_params:
348
+ _header_params['Accept'] = self.api_client.select_header_accept(
349
+ [
350
+ 'application/json'
351
+ ]
352
+ )
353
+
354
+ # set the HTTP header `Content-Type`
355
+ if _content_type:
356
+ _header_params['Content-Type'] = _content_type
357
+ else:
358
+ _default_content_type = (
359
+ self.api_client.select_header_content_type(
360
+ [
361
+ 'multipart/form-data'
362
+ ]
363
+ )
364
+ )
365
+ if _default_content_type is not None:
366
+ _header_params['Content-Type'] = _default_content_type
367
+
368
+ # authentication setting
369
+ _auth_settings: List[str] = [
370
+ 'bearerAuth'
371
+ ]
372
+
373
+ return self.api_client.param_serialize(
374
+ method='POST',
375
+ resource_path='/agents/custom_tools',
376
+ path_params=_path_params,
377
+ query_params=_query_params,
378
+ header_params=_header_params,
379
+ body=_body_params,
380
+ post_params=_form_params,
381
+ files=_files,
382
+ auth_settings=_auth_settings,
383
+ collection_formats=_collection_formats,
384
+ _host=_host,
385
+ _request_auth=_request_auth
386
+ )
387
+
388
+
389
+
390
+
50
391
  @validate_call
51
392
  def create_agent_key(
52
393
  self,
@@ -1399,11 +1740,9 @@ class AgentsApi:
1399
1740
 
1400
1741
 
1401
1742
  @validate_call
1402
- def list_agent_directory_stats(
1743
+ def delete_custom_agent_tool(
1403
1744
  self,
1404
- offset: Annotated[Optional[StrictInt], Field(description="How many agent chat sessions to skip before returning.")] = None,
1405
- limit: Annotated[Optional[StrictInt], Field(description="How many agent chat sessions to return.")] = None,
1406
- filter_text: Annotated[Optional[StrictStr], Field(description="Applied text filter.")] = None,
1745
+ tool_ids: Annotated[List[StrictStr], Field(description="The unique identifiers of tools to be deleted.")],
1407
1746
  _request_timeout: Union[
1408
1747
  None,
1409
1748
  Annotated[StrictFloat, Field(gt=0)],
@@ -1416,17 +1755,13 @@ class AgentsApi:
1416
1755
  _content_type: Optional[StrictStr] = None,
1417
1756
  _headers: Optional[Dict[StrictStr, Any]] = None,
1418
1757
  _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1419
- ) -> List[AgentServerDirectoryStatsPerAgentChatSession]:
1420
- """Lists agent directory stats across all agent chat sessions.
1758
+ ) -> Count:
1759
+ """Deletes custom agent tools
1421
1760
 
1422
- Lists agent directory stats across all agent chat sessions.
1761
+ Deletes custom agent tool given a list of tool ids belonging to the user.
1423
1762
 
1424
- :param offset: How many agent chat sessions to skip before returning.
1425
- :type offset: int
1426
- :param limit: How many agent chat sessions to return.
1427
- :type limit: int
1428
- :param filter_text: Applied text filter.
1429
- :type filter_text: str
1763
+ :param tool_ids: The unique identifiers of tools to be deleted. (required)
1764
+ :type tool_ids: List[str]
1430
1765
  :param _request_timeout: timeout setting for this request. If one
1431
1766
  number provided, it will be total request
1432
1767
  timeout. It can also be a pair (tuple) of
@@ -1449,10 +1784,8 @@ class AgentsApi:
1449
1784
  :return: Returns the result object.
1450
1785
  """ # noqa: E501
1451
1786
 
1452
- _param = self._list_agent_directory_stats_serialize(
1453
- offset=offset,
1454
- limit=limit,
1455
- filter_text=filter_text,
1787
+ _param = self._delete_custom_agent_tool_serialize(
1788
+ tool_ids=tool_ids,
1456
1789
  _request_auth=_request_auth,
1457
1790
  _content_type=_content_type,
1458
1791
  _headers=_headers,
@@ -1460,7 +1793,283 @@ class AgentsApi:
1460
1793
  )
1461
1794
 
1462
1795
  _response_types_map: Dict[str, Optional[str]] = {
1463
- '200': "List[AgentServerDirectoryStatsPerAgentChatSession]",
1796
+ '200': "Count",
1797
+ '401': "EndpointError",
1798
+ '500': "EndpointError",
1799
+ }
1800
+ response_data = self.api_client.call_api(
1801
+ *_param,
1802
+ _request_timeout=_request_timeout
1803
+ )
1804
+ response_data.read()
1805
+ return self.api_client.response_deserialize(
1806
+ response_data=response_data,
1807
+ response_types_map=_response_types_map,
1808
+ ).data
1809
+
1810
+
1811
+ @validate_call
1812
+ def delete_custom_agent_tool_with_http_info(
1813
+ self,
1814
+ tool_ids: Annotated[List[StrictStr], Field(description="The unique identifiers of tools to be deleted.")],
1815
+ _request_timeout: Union[
1816
+ None,
1817
+ Annotated[StrictFloat, Field(gt=0)],
1818
+ Tuple[
1819
+ Annotated[StrictFloat, Field(gt=0)],
1820
+ Annotated[StrictFloat, Field(gt=0)]
1821
+ ]
1822
+ ] = None,
1823
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1824
+ _content_type: Optional[StrictStr] = None,
1825
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1826
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1827
+ ) -> ApiResponse[Count]:
1828
+ """Deletes custom agent tools
1829
+
1830
+ Deletes custom agent tool given a list of tool ids belonging to the user.
1831
+
1832
+ :param tool_ids: The unique identifiers of tools to be deleted. (required)
1833
+ :type tool_ids: List[str]
1834
+ :param _request_timeout: timeout setting for this request. If one
1835
+ number provided, it will be total request
1836
+ timeout. It can also be a pair (tuple) of
1837
+ (connection, read) timeouts.
1838
+ :type _request_timeout: int, tuple(int, int), optional
1839
+ :param _request_auth: set to override the auth_settings for an a single
1840
+ request; this effectively ignores the
1841
+ authentication in the spec for a single request.
1842
+ :type _request_auth: dict, optional
1843
+ :param _content_type: force content-type for the request.
1844
+ :type _content_type: str, Optional
1845
+ :param _headers: set to override the headers for a single
1846
+ request; this effectively ignores the headers
1847
+ in the spec for a single request.
1848
+ :type _headers: dict, optional
1849
+ :param _host_index: set to override the host_index for a single
1850
+ request; this effectively ignores the host_index
1851
+ in the spec for a single request.
1852
+ :type _host_index: int, optional
1853
+ :return: Returns the result object.
1854
+ """ # noqa: E501
1855
+
1856
+ _param = self._delete_custom_agent_tool_serialize(
1857
+ tool_ids=tool_ids,
1858
+ _request_auth=_request_auth,
1859
+ _content_type=_content_type,
1860
+ _headers=_headers,
1861
+ _host_index=_host_index
1862
+ )
1863
+
1864
+ _response_types_map: Dict[str, Optional[str]] = {
1865
+ '200': "Count",
1866
+ '401': "EndpointError",
1867
+ '500': "EndpointError",
1868
+ }
1869
+ response_data = self.api_client.call_api(
1870
+ *_param,
1871
+ _request_timeout=_request_timeout
1872
+ )
1873
+ response_data.read()
1874
+ return self.api_client.response_deserialize(
1875
+ response_data=response_data,
1876
+ response_types_map=_response_types_map,
1877
+ )
1878
+
1879
+
1880
+ @validate_call
1881
+ def delete_custom_agent_tool_without_preload_content(
1882
+ self,
1883
+ tool_ids: Annotated[List[StrictStr], Field(description="The unique identifiers of tools to be deleted.")],
1884
+ _request_timeout: Union[
1885
+ None,
1886
+ Annotated[StrictFloat, Field(gt=0)],
1887
+ Tuple[
1888
+ Annotated[StrictFloat, Field(gt=0)],
1889
+ Annotated[StrictFloat, Field(gt=0)]
1890
+ ]
1891
+ ] = None,
1892
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
1893
+ _content_type: Optional[StrictStr] = None,
1894
+ _headers: Optional[Dict[StrictStr, Any]] = None,
1895
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
1896
+ ) -> RESTResponseType:
1897
+ """Deletes custom agent tools
1898
+
1899
+ Deletes custom agent tool given a list of tool ids belonging to the user.
1900
+
1901
+ :param tool_ids: The unique identifiers of tools to be deleted. (required)
1902
+ :type tool_ids: List[str]
1903
+ :param _request_timeout: timeout setting for this request. If one
1904
+ number provided, it will be total request
1905
+ timeout. It can also be a pair (tuple) of
1906
+ (connection, read) timeouts.
1907
+ :type _request_timeout: int, tuple(int, int), optional
1908
+ :param _request_auth: set to override the auth_settings for an a single
1909
+ request; this effectively ignores the
1910
+ authentication in the spec for a single request.
1911
+ :type _request_auth: dict, optional
1912
+ :param _content_type: force content-type for the request.
1913
+ :type _content_type: str, Optional
1914
+ :param _headers: set to override the headers for a single
1915
+ request; this effectively ignores the headers
1916
+ in the spec for a single request.
1917
+ :type _headers: dict, optional
1918
+ :param _host_index: set to override the host_index for a single
1919
+ request; this effectively ignores the host_index
1920
+ in the spec for a single request.
1921
+ :type _host_index: int, optional
1922
+ :return: Returns the result object.
1923
+ """ # noqa: E501
1924
+
1925
+ _param = self._delete_custom_agent_tool_serialize(
1926
+ tool_ids=tool_ids,
1927
+ _request_auth=_request_auth,
1928
+ _content_type=_content_type,
1929
+ _headers=_headers,
1930
+ _host_index=_host_index
1931
+ )
1932
+
1933
+ _response_types_map: Dict[str, Optional[str]] = {
1934
+ '200': "Count",
1935
+ '401': "EndpointError",
1936
+ '500': "EndpointError",
1937
+ }
1938
+ response_data = self.api_client.call_api(
1939
+ *_param,
1940
+ _request_timeout=_request_timeout
1941
+ )
1942
+ return response_data.response
1943
+
1944
+
1945
+ def _delete_custom_agent_tool_serialize(
1946
+ self,
1947
+ tool_ids,
1948
+ _request_auth,
1949
+ _content_type,
1950
+ _headers,
1951
+ _host_index,
1952
+ ) -> RequestSerialized:
1953
+
1954
+ _host = None
1955
+
1956
+ _collection_formats: Dict[str, str] = {
1957
+ 'tool_ids': 'csv',
1958
+ }
1959
+
1960
+ _path_params: Dict[str, str] = {}
1961
+ _query_params: List[Tuple[str, str]] = []
1962
+ _header_params: Dict[str, Optional[str]] = _headers or {}
1963
+ _form_params: List[Tuple[str, str]] = []
1964
+ _files: Dict[
1965
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
1966
+ ] = {}
1967
+ _body_params: Optional[bytes] = None
1968
+
1969
+ # process the path parameters
1970
+ if tool_ids is not None:
1971
+ _path_params['tool_ids'] = tool_ids
1972
+ # process the query parameters
1973
+ # process the header parameters
1974
+ # process the form parameters
1975
+ # process the body parameter
1976
+
1977
+
1978
+ # set the HTTP header `Accept`
1979
+ if 'Accept' not in _header_params:
1980
+ _header_params['Accept'] = self.api_client.select_header_accept(
1981
+ [
1982
+ 'application/json'
1983
+ ]
1984
+ )
1985
+
1986
+
1987
+ # authentication setting
1988
+ _auth_settings: List[str] = [
1989
+ 'bearerAuth'
1990
+ ]
1991
+
1992
+ return self.api_client.param_serialize(
1993
+ method='DELETE',
1994
+ resource_path='/agents/custom_tools/{tool_ids}',
1995
+ path_params=_path_params,
1996
+ query_params=_query_params,
1997
+ header_params=_header_params,
1998
+ body=_body_params,
1999
+ post_params=_form_params,
2000
+ files=_files,
2001
+ auth_settings=_auth_settings,
2002
+ collection_formats=_collection_formats,
2003
+ _host=_host,
2004
+ _request_auth=_request_auth
2005
+ )
2006
+
2007
+
2008
+
2009
+
2010
+ @validate_call
2011
+ def list_agent_directory_stats(
2012
+ self,
2013
+ offset: Annotated[Optional[StrictInt], Field(description="How many agent chat sessions to skip before returning.")] = None,
2014
+ limit: Annotated[Optional[StrictInt], Field(description="How many agent chat sessions to return.")] = None,
2015
+ filter_text: Annotated[Optional[StrictStr], Field(description="Applied text filter.")] = None,
2016
+ _request_timeout: Union[
2017
+ None,
2018
+ Annotated[StrictFloat, Field(gt=0)],
2019
+ Tuple[
2020
+ Annotated[StrictFloat, Field(gt=0)],
2021
+ Annotated[StrictFloat, Field(gt=0)]
2022
+ ]
2023
+ ] = None,
2024
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
2025
+ _content_type: Optional[StrictStr] = None,
2026
+ _headers: Optional[Dict[StrictStr, Any]] = None,
2027
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
2028
+ ) -> List[AgentServerDirectoryStatsPerAgentChatSession]:
2029
+ """Lists agent directory stats across all agent chat sessions.
2030
+
2031
+ Lists agent directory stats across all agent chat sessions.
2032
+
2033
+ :param offset: How many agent chat sessions to skip before returning.
2034
+ :type offset: int
2035
+ :param limit: How many agent chat sessions to return.
2036
+ :type limit: int
2037
+ :param filter_text: Applied text filter.
2038
+ :type filter_text: str
2039
+ :param _request_timeout: timeout setting for this request. If one
2040
+ number provided, it will be total request
2041
+ timeout. It can also be a pair (tuple) of
2042
+ (connection, read) timeouts.
2043
+ :type _request_timeout: int, tuple(int, int), optional
2044
+ :param _request_auth: set to override the auth_settings for an a single
2045
+ request; this effectively ignores the
2046
+ authentication in the spec for a single request.
2047
+ :type _request_auth: dict, optional
2048
+ :param _content_type: force content-type for the request.
2049
+ :type _content_type: str, Optional
2050
+ :param _headers: set to override the headers for a single
2051
+ request; this effectively ignores the headers
2052
+ in the spec for a single request.
2053
+ :type _headers: dict, optional
2054
+ :param _host_index: set to override the host_index for a single
2055
+ request; this effectively ignores the host_index
2056
+ in the spec for a single request.
2057
+ :type _host_index: int, optional
2058
+ :return: Returns the result object.
2059
+ """ # noqa: E501
2060
+
2061
+ _param = self._list_agent_directory_stats_serialize(
2062
+ offset=offset,
2063
+ limit=limit,
2064
+ filter_text=filter_text,
2065
+ _request_auth=_request_auth,
2066
+ _content_type=_content_type,
2067
+ _headers=_headers,
2068
+ _host_index=_host_index
2069
+ )
2070
+
2071
+ _response_types_map: Dict[str, Optional[str]] = {
2072
+ '200': "List[AgentServerDirectoryStatsPerAgentChatSession]",
1464
2073
  '401': "EndpointError",
1465
2074
  }
1466
2075
  response_data = self.api_client.call_api(
@@ -2707,9 +3316,261 @@ class AgentsApi:
2707
3316
 
2708
3317
 
2709
3318
  @validate_call
2710
- def update_agent_key(
3319
+ def list_custom_agent_tools(
2711
3320
  self,
2712
- key_id: Annotated[StrictStr, Field(description="Id of the key to be updated.")],
3321
+ _request_timeout: Union[
3322
+ None,
3323
+ Annotated[StrictFloat, Field(gt=0)],
3324
+ Tuple[
3325
+ Annotated[StrictFloat, Field(gt=0)],
3326
+ Annotated[StrictFloat, Field(gt=0)]
3327
+ ]
3328
+ ] = None,
3329
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3330
+ _content_type: Optional[StrictStr] = None,
3331
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3332
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3333
+ ) -> List[ListCustomAgentTools200ResponseInner]:
3334
+ """List Custom Agent Tools
3335
+
3336
+ List all custom agent tools for the current user
3337
+
3338
+ :param _request_timeout: timeout setting for this request. If one
3339
+ number provided, it will be total request
3340
+ timeout. It can also be a pair (tuple) of
3341
+ (connection, read) timeouts.
3342
+ :type _request_timeout: int, tuple(int, int), optional
3343
+ :param _request_auth: set to override the auth_settings for an a single
3344
+ request; this effectively ignores the
3345
+ authentication in the spec for a single request.
3346
+ :type _request_auth: dict, optional
3347
+ :param _content_type: force content-type for the request.
3348
+ :type _content_type: str, Optional
3349
+ :param _headers: set to override the headers for a single
3350
+ request; this effectively ignores the headers
3351
+ in the spec for a single request.
3352
+ :type _headers: dict, optional
3353
+ :param _host_index: set to override the host_index for a single
3354
+ request; this effectively ignores the host_index
3355
+ in the spec for a single request.
3356
+ :type _host_index: int, optional
3357
+ :return: Returns the result object.
3358
+ """ # noqa: E501
3359
+
3360
+ _param = self._list_custom_agent_tools_serialize(
3361
+ _request_auth=_request_auth,
3362
+ _content_type=_content_type,
3363
+ _headers=_headers,
3364
+ _host_index=_host_index
3365
+ )
3366
+
3367
+ _response_types_map: Dict[str, Optional[str]] = {
3368
+ '200': "List[ListCustomAgentTools200ResponseInner]",
3369
+ '401': "EndpointError",
3370
+ '500': "EndpointError",
3371
+ }
3372
+ response_data = self.api_client.call_api(
3373
+ *_param,
3374
+ _request_timeout=_request_timeout
3375
+ )
3376
+ response_data.read()
3377
+ return self.api_client.response_deserialize(
3378
+ response_data=response_data,
3379
+ response_types_map=_response_types_map,
3380
+ ).data
3381
+
3382
+
3383
+ @validate_call
3384
+ def list_custom_agent_tools_with_http_info(
3385
+ self,
3386
+ _request_timeout: Union[
3387
+ None,
3388
+ Annotated[StrictFloat, Field(gt=0)],
3389
+ Tuple[
3390
+ Annotated[StrictFloat, Field(gt=0)],
3391
+ Annotated[StrictFloat, Field(gt=0)]
3392
+ ]
3393
+ ] = None,
3394
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3395
+ _content_type: Optional[StrictStr] = None,
3396
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3397
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3398
+ ) -> ApiResponse[List[ListCustomAgentTools200ResponseInner]]:
3399
+ """List Custom Agent Tools
3400
+
3401
+ List all custom agent tools for the current user
3402
+
3403
+ :param _request_timeout: timeout setting for this request. If one
3404
+ number provided, it will be total request
3405
+ timeout. It can also be a pair (tuple) of
3406
+ (connection, read) timeouts.
3407
+ :type _request_timeout: int, tuple(int, int), optional
3408
+ :param _request_auth: set to override the auth_settings for an a single
3409
+ request; this effectively ignores the
3410
+ authentication in the spec for a single request.
3411
+ :type _request_auth: dict, optional
3412
+ :param _content_type: force content-type for the request.
3413
+ :type _content_type: str, Optional
3414
+ :param _headers: set to override the headers for a single
3415
+ request; this effectively ignores the headers
3416
+ in the spec for a single request.
3417
+ :type _headers: dict, optional
3418
+ :param _host_index: set to override the host_index for a single
3419
+ request; this effectively ignores the host_index
3420
+ in the spec for a single request.
3421
+ :type _host_index: int, optional
3422
+ :return: Returns the result object.
3423
+ """ # noqa: E501
3424
+
3425
+ _param = self._list_custom_agent_tools_serialize(
3426
+ _request_auth=_request_auth,
3427
+ _content_type=_content_type,
3428
+ _headers=_headers,
3429
+ _host_index=_host_index
3430
+ )
3431
+
3432
+ _response_types_map: Dict[str, Optional[str]] = {
3433
+ '200': "List[ListCustomAgentTools200ResponseInner]",
3434
+ '401': "EndpointError",
3435
+ '500': "EndpointError",
3436
+ }
3437
+ response_data = self.api_client.call_api(
3438
+ *_param,
3439
+ _request_timeout=_request_timeout
3440
+ )
3441
+ response_data.read()
3442
+ return self.api_client.response_deserialize(
3443
+ response_data=response_data,
3444
+ response_types_map=_response_types_map,
3445
+ )
3446
+
3447
+
3448
+ @validate_call
3449
+ def list_custom_agent_tools_without_preload_content(
3450
+ self,
3451
+ _request_timeout: Union[
3452
+ None,
3453
+ Annotated[StrictFloat, Field(gt=0)],
3454
+ Tuple[
3455
+ Annotated[StrictFloat, Field(gt=0)],
3456
+ Annotated[StrictFloat, Field(gt=0)]
3457
+ ]
3458
+ ] = None,
3459
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
3460
+ _content_type: Optional[StrictStr] = None,
3461
+ _headers: Optional[Dict[StrictStr, Any]] = None,
3462
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
3463
+ ) -> RESTResponseType:
3464
+ """List Custom Agent Tools
3465
+
3466
+ List all custom agent tools for the current user
3467
+
3468
+ :param _request_timeout: timeout setting for this request. If one
3469
+ number provided, it will be total request
3470
+ timeout. It can also be a pair (tuple) of
3471
+ (connection, read) timeouts.
3472
+ :type _request_timeout: int, tuple(int, int), optional
3473
+ :param _request_auth: set to override the auth_settings for an a single
3474
+ request; this effectively ignores the
3475
+ authentication in the spec for a single request.
3476
+ :type _request_auth: dict, optional
3477
+ :param _content_type: force content-type for the request.
3478
+ :type _content_type: str, Optional
3479
+ :param _headers: set to override the headers for a single
3480
+ request; this effectively ignores the headers
3481
+ in the spec for a single request.
3482
+ :type _headers: dict, optional
3483
+ :param _host_index: set to override the host_index for a single
3484
+ request; this effectively ignores the host_index
3485
+ in the spec for a single request.
3486
+ :type _host_index: int, optional
3487
+ :return: Returns the result object.
3488
+ """ # noqa: E501
3489
+
3490
+ _param = self._list_custom_agent_tools_serialize(
3491
+ _request_auth=_request_auth,
3492
+ _content_type=_content_type,
3493
+ _headers=_headers,
3494
+ _host_index=_host_index
3495
+ )
3496
+
3497
+ _response_types_map: Dict[str, Optional[str]] = {
3498
+ '200': "List[ListCustomAgentTools200ResponseInner]",
3499
+ '401': "EndpointError",
3500
+ '500': "EndpointError",
3501
+ }
3502
+ response_data = self.api_client.call_api(
3503
+ *_param,
3504
+ _request_timeout=_request_timeout
3505
+ )
3506
+ return response_data.response
3507
+
3508
+
3509
+ def _list_custom_agent_tools_serialize(
3510
+ self,
3511
+ _request_auth,
3512
+ _content_type,
3513
+ _headers,
3514
+ _host_index,
3515
+ ) -> RequestSerialized:
3516
+
3517
+ _host = None
3518
+
3519
+ _collection_formats: Dict[str, str] = {
3520
+ }
3521
+
3522
+ _path_params: Dict[str, str] = {}
3523
+ _query_params: List[Tuple[str, str]] = []
3524
+ _header_params: Dict[str, Optional[str]] = _headers or {}
3525
+ _form_params: List[Tuple[str, str]] = []
3526
+ _files: Dict[
3527
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
3528
+ ] = {}
3529
+ _body_params: Optional[bytes] = None
3530
+
3531
+ # process the path parameters
3532
+ # process the query parameters
3533
+ # process the header parameters
3534
+ # process the form parameters
3535
+ # process the body parameter
3536
+
3537
+
3538
+ # set the HTTP header `Accept`
3539
+ if 'Accept' not in _header_params:
3540
+ _header_params['Accept'] = self.api_client.select_header_accept(
3541
+ [
3542
+ 'application/json'
3543
+ ]
3544
+ )
3545
+
3546
+
3547
+ # authentication setting
3548
+ _auth_settings: List[str] = [
3549
+ 'bearerAuth'
3550
+ ]
3551
+
3552
+ return self.api_client.param_serialize(
3553
+ method='GET',
3554
+ resource_path='/agents/custom_tools',
3555
+ path_params=_path_params,
3556
+ query_params=_query_params,
3557
+ header_params=_header_params,
3558
+ body=_body_params,
3559
+ post_params=_form_params,
3560
+ files=_files,
3561
+ auth_settings=_auth_settings,
3562
+ collection_formats=_collection_formats,
3563
+ _host=_host,
3564
+ _request_auth=_request_auth
3565
+ )
3566
+
3567
+
3568
+
3569
+
3570
+ @validate_call
3571
+ def update_agent_key(
3572
+ self,
3573
+ key_id: Annotated[StrictStr, Field(description="Id of the key to be updated.")],
2713
3574
  update_agent_key_request: UpdateAgentKeyRequest,
2714
3575
  _request_timeout: Union[
2715
3576
  None,
@@ -3282,3 +4143,301 @@ class AgentsApi:
3282
4143
  )
3283
4144
 
3284
4145
 
4146
+
4147
+
4148
+ @validate_call
4149
+ def update_custom_agent_tool(
4150
+ self,
4151
+ tool_id: Annotated[StrictStr, Field(description="The unique identifier of the tool to be updated.")],
4152
+ update_custom_agent_tool_request: UpdateCustomAgentToolRequest,
4153
+ _request_timeout: Union[
4154
+ None,
4155
+ Annotated[StrictFloat, Field(gt=0)],
4156
+ Tuple[
4157
+ Annotated[StrictFloat, Field(gt=0)],
4158
+ Annotated[StrictFloat, Field(gt=0)]
4159
+ ]
4160
+ ] = None,
4161
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4162
+ _content_type: Optional[StrictStr] = None,
4163
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4164
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4165
+ ) -> UpdateCustomAgentTool200Response:
4166
+ """Updates a custom agent tool
4167
+
4168
+ Updates a custom agent tool given a tool id belonging to the user.
4169
+
4170
+ :param tool_id: The unique identifier of the tool to be updated. (required)
4171
+ :type tool_id: str
4172
+ :param update_custom_agent_tool_request: (required)
4173
+ :type update_custom_agent_tool_request: UpdateCustomAgentToolRequest
4174
+ :param _request_timeout: timeout setting for this request. If one
4175
+ number provided, it will be total request
4176
+ timeout. It can also be a pair (tuple) of
4177
+ (connection, read) timeouts.
4178
+ :type _request_timeout: int, tuple(int, int), optional
4179
+ :param _request_auth: set to override the auth_settings for an a single
4180
+ request; this effectively ignores the
4181
+ authentication in the spec for a single request.
4182
+ :type _request_auth: dict, optional
4183
+ :param _content_type: force content-type for the request.
4184
+ :type _content_type: str, Optional
4185
+ :param _headers: set to override the headers for a single
4186
+ request; this effectively ignores the headers
4187
+ in the spec for a single request.
4188
+ :type _headers: dict, optional
4189
+ :param _host_index: set to override the host_index for a single
4190
+ request; this effectively ignores the host_index
4191
+ in the spec for a single request.
4192
+ :type _host_index: int, optional
4193
+ :return: Returns the result object.
4194
+ """ # noqa: E501
4195
+
4196
+ _param = self._update_custom_agent_tool_serialize(
4197
+ tool_id=tool_id,
4198
+ update_custom_agent_tool_request=update_custom_agent_tool_request,
4199
+ _request_auth=_request_auth,
4200
+ _content_type=_content_type,
4201
+ _headers=_headers,
4202
+ _host_index=_host_index
4203
+ )
4204
+
4205
+ _response_types_map: Dict[str, Optional[str]] = {
4206
+ '200': "UpdateCustomAgentTool200Response",
4207
+ '401': "EndpointError",
4208
+ '404': "EndpointError",
4209
+ '500': "EndpointError",
4210
+ }
4211
+ response_data = self.api_client.call_api(
4212
+ *_param,
4213
+ _request_timeout=_request_timeout
4214
+ )
4215
+ response_data.read()
4216
+ return self.api_client.response_deserialize(
4217
+ response_data=response_data,
4218
+ response_types_map=_response_types_map,
4219
+ ).data
4220
+
4221
+
4222
+ @validate_call
4223
+ def update_custom_agent_tool_with_http_info(
4224
+ self,
4225
+ tool_id: Annotated[StrictStr, Field(description="The unique identifier of the tool to be updated.")],
4226
+ update_custom_agent_tool_request: UpdateCustomAgentToolRequest,
4227
+ _request_timeout: Union[
4228
+ None,
4229
+ Annotated[StrictFloat, Field(gt=0)],
4230
+ Tuple[
4231
+ Annotated[StrictFloat, Field(gt=0)],
4232
+ Annotated[StrictFloat, Field(gt=0)]
4233
+ ]
4234
+ ] = None,
4235
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4236
+ _content_type: Optional[StrictStr] = None,
4237
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4238
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4239
+ ) -> ApiResponse[UpdateCustomAgentTool200Response]:
4240
+ """Updates a custom agent tool
4241
+
4242
+ Updates a custom agent tool given a tool id belonging to the user.
4243
+
4244
+ :param tool_id: The unique identifier of the tool to be updated. (required)
4245
+ :type tool_id: str
4246
+ :param update_custom_agent_tool_request: (required)
4247
+ :type update_custom_agent_tool_request: UpdateCustomAgentToolRequest
4248
+ :param _request_timeout: timeout setting for this request. If one
4249
+ number provided, it will be total request
4250
+ timeout. It can also be a pair (tuple) of
4251
+ (connection, read) timeouts.
4252
+ :type _request_timeout: int, tuple(int, int), optional
4253
+ :param _request_auth: set to override the auth_settings for an a single
4254
+ request; this effectively ignores the
4255
+ authentication in the spec for a single request.
4256
+ :type _request_auth: dict, optional
4257
+ :param _content_type: force content-type for the request.
4258
+ :type _content_type: str, Optional
4259
+ :param _headers: set to override the headers for a single
4260
+ request; this effectively ignores the headers
4261
+ in the spec for a single request.
4262
+ :type _headers: dict, optional
4263
+ :param _host_index: set to override the host_index for a single
4264
+ request; this effectively ignores the host_index
4265
+ in the spec for a single request.
4266
+ :type _host_index: int, optional
4267
+ :return: Returns the result object.
4268
+ """ # noqa: E501
4269
+
4270
+ _param = self._update_custom_agent_tool_serialize(
4271
+ tool_id=tool_id,
4272
+ update_custom_agent_tool_request=update_custom_agent_tool_request,
4273
+ _request_auth=_request_auth,
4274
+ _content_type=_content_type,
4275
+ _headers=_headers,
4276
+ _host_index=_host_index
4277
+ )
4278
+
4279
+ _response_types_map: Dict[str, Optional[str]] = {
4280
+ '200': "UpdateCustomAgentTool200Response",
4281
+ '401': "EndpointError",
4282
+ '404': "EndpointError",
4283
+ '500': "EndpointError",
4284
+ }
4285
+ response_data = self.api_client.call_api(
4286
+ *_param,
4287
+ _request_timeout=_request_timeout
4288
+ )
4289
+ response_data.read()
4290
+ return self.api_client.response_deserialize(
4291
+ response_data=response_data,
4292
+ response_types_map=_response_types_map,
4293
+ )
4294
+
4295
+
4296
+ @validate_call
4297
+ def update_custom_agent_tool_without_preload_content(
4298
+ self,
4299
+ tool_id: Annotated[StrictStr, Field(description="The unique identifier of the tool to be updated.")],
4300
+ update_custom_agent_tool_request: UpdateCustomAgentToolRequest,
4301
+ _request_timeout: Union[
4302
+ None,
4303
+ Annotated[StrictFloat, Field(gt=0)],
4304
+ Tuple[
4305
+ Annotated[StrictFloat, Field(gt=0)],
4306
+ Annotated[StrictFloat, Field(gt=0)]
4307
+ ]
4308
+ ] = None,
4309
+ _request_auth: Optional[Dict[StrictStr, Any]] = None,
4310
+ _content_type: Optional[StrictStr] = None,
4311
+ _headers: Optional[Dict[StrictStr, Any]] = None,
4312
+ _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
4313
+ ) -> RESTResponseType:
4314
+ """Updates a custom agent tool
4315
+
4316
+ Updates a custom agent tool given a tool id belonging to the user.
4317
+
4318
+ :param tool_id: The unique identifier of the tool to be updated. (required)
4319
+ :type tool_id: str
4320
+ :param update_custom_agent_tool_request: (required)
4321
+ :type update_custom_agent_tool_request: UpdateCustomAgentToolRequest
4322
+ :param _request_timeout: timeout setting for this request. If one
4323
+ number provided, it will be total request
4324
+ timeout. It can also be a pair (tuple) of
4325
+ (connection, read) timeouts.
4326
+ :type _request_timeout: int, tuple(int, int), optional
4327
+ :param _request_auth: set to override the auth_settings for an a single
4328
+ request; this effectively ignores the
4329
+ authentication in the spec for a single request.
4330
+ :type _request_auth: dict, optional
4331
+ :param _content_type: force content-type for the request.
4332
+ :type _content_type: str, Optional
4333
+ :param _headers: set to override the headers for a single
4334
+ request; this effectively ignores the headers
4335
+ in the spec for a single request.
4336
+ :type _headers: dict, optional
4337
+ :param _host_index: set to override the host_index for a single
4338
+ request; this effectively ignores the host_index
4339
+ in the spec for a single request.
4340
+ :type _host_index: int, optional
4341
+ :return: Returns the result object.
4342
+ """ # noqa: E501
4343
+
4344
+ _param = self._update_custom_agent_tool_serialize(
4345
+ tool_id=tool_id,
4346
+ update_custom_agent_tool_request=update_custom_agent_tool_request,
4347
+ _request_auth=_request_auth,
4348
+ _content_type=_content_type,
4349
+ _headers=_headers,
4350
+ _host_index=_host_index
4351
+ )
4352
+
4353
+ _response_types_map: Dict[str, Optional[str]] = {
4354
+ '200': "UpdateCustomAgentTool200Response",
4355
+ '401': "EndpointError",
4356
+ '404': "EndpointError",
4357
+ '500': "EndpointError",
4358
+ }
4359
+ response_data = self.api_client.call_api(
4360
+ *_param,
4361
+ _request_timeout=_request_timeout
4362
+ )
4363
+ return response_data.response
4364
+
4365
+
4366
+ def _update_custom_agent_tool_serialize(
4367
+ self,
4368
+ tool_id,
4369
+ update_custom_agent_tool_request,
4370
+ _request_auth,
4371
+ _content_type,
4372
+ _headers,
4373
+ _host_index,
4374
+ ) -> RequestSerialized:
4375
+
4376
+ _host = None
4377
+
4378
+ _collection_formats: Dict[str, str] = {
4379
+ }
4380
+
4381
+ _path_params: Dict[str, str] = {}
4382
+ _query_params: List[Tuple[str, str]] = []
4383
+ _header_params: Dict[str, Optional[str]] = _headers or {}
4384
+ _form_params: List[Tuple[str, str]] = []
4385
+ _files: Dict[
4386
+ str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
4387
+ ] = {}
4388
+ _body_params: Optional[bytes] = None
4389
+
4390
+ # process the path parameters
4391
+ if tool_id is not None:
4392
+ _path_params['tool_id'] = tool_id
4393
+ # process the query parameters
4394
+ # process the header parameters
4395
+ # process the form parameters
4396
+ # process the body parameter
4397
+ if update_custom_agent_tool_request is not None:
4398
+ _body_params = update_custom_agent_tool_request
4399
+
4400
+
4401
+ # set the HTTP header `Accept`
4402
+ if 'Accept' not in _header_params:
4403
+ _header_params['Accept'] = self.api_client.select_header_accept(
4404
+ [
4405
+ 'application/json'
4406
+ ]
4407
+ )
4408
+
4409
+ # set the HTTP header `Content-Type`
4410
+ if _content_type:
4411
+ _header_params['Content-Type'] = _content_type
4412
+ else:
4413
+ _default_content_type = (
4414
+ self.api_client.select_header_content_type(
4415
+ [
4416
+ 'application/json'
4417
+ ]
4418
+ )
4419
+ )
4420
+ if _default_content_type is not None:
4421
+ _header_params['Content-Type'] = _default_content_type
4422
+
4423
+ # authentication setting
4424
+ _auth_settings: List[str] = [
4425
+ 'bearerAuth'
4426
+ ]
4427
+
4428
+ return self.api_client.param_serialize(
4429
+ method='PUT',
4430
+ resource_path='/agents/custom_tools/{tool_id}',
4431
+ path_params=_path_params,
4432
+ query_params=_query_params,
4433
+ header_params=_header_params,
4434
+ body=_body_params,
4435
+ post_params=_form_params,
4436
+ files=_files,
4437
+ auth_settings=_auth_settings,
4438
+ collection_formats=_collection_formats,
4439
+ _host=_host,
4440
+ _request_auth=_request_auth
4441
+ )
4442
+
4443
+