mixpeek 0.21.7__py3-none-any.whl → 0.22.0__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 (84) hide show
  1. mixpeek/_hooks/types.py +7 -0
  2. mixpeek/_version.py +3 -3
  3. mixpeek/basesdk.py +12 -20
  4. mixpeek/bucketobjects.py +19 -37
  5. mixpeek/buckets.py +19 -31
  6. mixpeek/clusters.py +2 -0
  7. mixpeek/collectioncache.py +6 -0
  8. mixpeek/collections.py +13 -19
  9. mixpeek/features.py +4 -0
  10. mixpeek/health.py +2 -0
  11. mixpeek/httpclient.py +6 -16
  12. mixpeek/models/__init__.py +752 -583
  13. mixpeek/models/blobmodel.py +3 -11
  14. mixpeek/models/bucketcreaterequest.py +3 -11
  15. mixpeek/models/bucketresponse.py +3 -11
  16. mixpeek/models/bucketschemafield_input.py +6 -22
  17. mixpeek/models/bucketschemafield_output.py +6 -22
  18. mixpeek/models/bucketschemafieldbase.py +81 -0
  19. mixpeek/models/bucketschemafieldtype.py +1 -0
  20. mixpeek/models/bucketupdaterequest.py +3 -10
  21. mixpeek/models/collectionmodel.py +3 -11
  22. mixpeek/models/createblobrequest.py +3 -11
  23. mixpeek/models/createcollectionrequest.py +3 -11
  24. mixpeek/models/createnamespacerequest.py +9 -9
  25. mixpeek/models/createobjectrequest.py +3 -11
  26. mixpeek/models/createretrieverrequest.py +8 -16
  27. mixpeek/models/errordetail.py +3 -10
  28. mixpeek/models/featureextractorconfig.py +3 -11
  29. mixpeek/models/featureextractordefinition.py +26 -46
  30. mixpeek/models/interactionresponse.py +3 -11
  31. mixpeek/models/internal/__init__.py +35 -1
  32. mixpeek/models/logicaloperator_input.py +30 -36
  33. mixpeek/models/logicaloperator_output.py +39 -45
  34. mixpeek/models/logicaloperatorbase_input.py +74 -0
  35. mixpeek/models/logicaloperatorbase_output.py +74 -0
  36. mixpeek/models/namespaceresponse.py +17 -6
  37. mixpeek/models/namespacestatus.py +10 -0
  38. mixpeek/models/objectresponse.py +3 -11
  39. mixpeek/models/organizationmodel.py +3 -11
  40. mixpeek/models/retrieverbinding.py +3 -10
  41. mixpeek/models/retrievermodel.py +11 -16
  42. mixpeek/models/retrieverqueryrequest.py +3 -11
  43. mixpeek/models/retrieverschema_input.py +37 -0
  44. mixpeek/models/retrieverschema_output.py +37 -0
  45. mixpeek/models/retrieverschemafield_input.py +91 -0
  46. mixpeek/models/retrieverschemafield_output.py +91 -0
  47. mixpeek/models/searchinteraction.py +3 -11
  48. mixpeek/models/stageconfig_input.py +8 -16
  49. mixpeek/models/stageconfig_output.py +8 -16
  50. mixpeek/models/stagedefinition.py +28 -17
  51. mixpeek/models/stageresponse.py +3 -11
  52. mixpeek/models/updateobjectrequest.py +3 -11
  53. mixpeek/models/usermodel_input.py +3 -11
  54. mixpeek/models/usermodel_output.py +3 -11
  55. mixpeek/namespaces.py +28 -22
  56. mixpeek/organizationnotifications.py +2 -0
  57. mixpeek/organizations.py +13 -13
  58. mixpeek/organizationsusage.py +2 -0
  59. mixpeek/research.py +2 -0
  60. mixpeek/retrieverinteractions.py +13 -19
  61. mixpeek/retrievers.py +21 -39
  62. mixpeek/retrieverstages.py +2 -0
  63. mixpeek/sdk.py +94 -65
  64. mixpeek/sdkconfiguration.py +0 -7
  65. mixpeek/tasks.py +6 -0
  66. mixpeek/taxonomies.py +2 -0
  67. mixpeek/users.py +6 -0
  68. mixpeek/utils/__init__.py +131 -45
  69. mixpeek/utils/datetimes.py +23 -0
  70. mixpeek/utils/serializers.py +32 -3
  71. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/METADATA +3 -15
  72. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/RECORD +73 -75
  73. {mixpeek-0.21.7.dist-info → mixpeek-0.22.0.dist-info}/WHEEL +1 -1
  74. mixpeek/collectiondocuments.py +0 -1564
  75. mixpeek/models/batch_delete_documents_v1_collections_collection_identifier_documents_batch_deleteop.py +0 -75
  76. mixpeek/models/batch_update_documents_v1_collections_collection_identifier_documents_batch_putop.py +0 -84
  77. mixpeek/models/delete_document_v1_collections_collection_identifier_documents_document_id_deleteop.py +0 -70
  78. mixpeek/models/documentlistresponse.py +0 -56
  79. mixpeek/models/documentresponse.py +0 -87
  80. mixpeek/models/documentupdate.py +0 -60
  81. mixpeek/models/genericsuccessresponse.py +0 -17
  82. mixpeek/models/get_document_v1_collections_collection_identifier_documents_document_id_getop.py +0 -70
  83. mixpeek/models/list_documents_v1_collections_collection_identifier_documents_getop.py +0 -114
  84. mixpeek/models/update_document_v1_collections_collection_identifier_documents_document_id_putop.py +0 -83
mixpeek/_hooks/types.py CHANGED
@@ -3,10 +3,12 @@
3
3
  from abc import ABC, abstractmethod
4
4
  import httpx
5
5
  from mixpeek.httpclient import HttpClient
6
+ from mixpeek.sdkconfiguration import SDKConfiguration
6
7
  from typing import Any, Callable, List, Optional, Tuple, Union
7
8
 
8
9
 
9
10
  class HookContext:
11
+ config: SDKConfiguration
10
12
  base_url: str
11
13
  operation_id: str
12
14
  oauth2_scopes: Optional[List[str]] = None
@@ -14,11 +16,13 @@ class HookContext:
14
16
 
15
17
  def __init__(
16
18
  self,
19
+ config: SDKConfiguration,
17
20
  base_url: str,
18
21
  operation_id: str,
19
22
  oauth2_scopes: Optional[List[str]],
20
23
  security_source: Optional[Union[Any, Callable[[], Any]]],
21
24
  ):
25
+ self.config = config
22
26
  self.base_url = base_url
23
27
  self.operation_id = operation_id
24
28
  self.oauth2_scopes = oauth2_scopes
@@ -28,6 +32,7 @@ class HookContext:
28
32
  class BeforeRequestContext(HookContext):
29
33
  def __init__(self, hook_ctx: HookContext):
30
34
  super().__init__(
35
+ hook_ctx.config,
31
36
  hook_ctx.base_url,
32
37
  hook_ctx.operation_id,
33
38
  hook_ctx.oauth2_scopes,
@@ -38,6 +43,7 @@ class BeforeRequestContext(HookContext):
38
43
  class AfterSuccessContext(HookContext):
39
44
  def __init__(self, hook_ctx: HookContext):
40
45
  super().__init__(
46
+ hook_ctx.config,
41
47
  hook_ctx.base_url,
42
48
  hook_ctx.operation_id,
43
49
  hook_ctx.oauth2_scopes,
@@ -48,6 +54,7 @@ class AfterSuccessContext(HookContext):
48
54
  class AfterErrorContext(HookContext):
49
55
  def __init__(self, hook_ctx: HookContext):
50
56
  super().__init__(
57
+ hook_ctx.config,
51
58
  hook_ctx.base_url,
52
59
  hook_ctx.operation_id,
53
60
  hook_ctx.oauth2_scopes,
mixpeek/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "mixpeek"
6
- __version__: str = "0.21.7"
6
+ __version__: str = "0.22.0"
7
7
  __openapi_doc_version__: str = "0.81"
8
- __gen_version__: str = "2.585.2"
9
- __user_agent__: str = "speakeasy-sdk/python 0.21.7 2.585.2 0.81 mixpeek"
8
+ __gen_version__: str = "2.616.1"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.22.0 2.616.1 0.81 mixpeek"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
mixpeek/basesdk.py CHANGED
@@ -214,12 +214,12 @@ class BaseSDK:
214
214
  client = self.sdk_configuration.client
215
215
  logger = self.sdk_configuration.debug_logger
216
216
 
217
+ hooks = self.sdk_configuration.__dict__["_hooks"]
218
+
217
219
  def do():
218
220
  http_res = None
219
221
  try:
220
- req = self.sdk_configuration.get_hooks().before_request(
221
- BeforeRequestContext(hook_ctx), request
222
- )
222
+ req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
223
223
  logger.debug(
224
224
  "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
225
225
  req.method,
@@ -233,9 +233,7 @@ class BaseSDK:
233
233
 
234
234
  http_res = client.send(req, stream=stream)
235
235
  except Exception as e:
236
- _, e = self.sdk_configuration.get_hooks().after_error(
237
- AfterErrorContext(hook_ctx), None, e
238
- )
236
+ _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
239
237
  if e is not None:
240
238
  logger.debug("Request Exception", exc_info=True)
241
239
  raise e
@@ -253,7 +251,7 @@ class BaseSDK:
253
251
  )
254
252
 
255
253
  if utils.match_status_codes(error_status_codes, http_res.status_code):
256
- result, err = self.sdk_configuration.get_hooks().after_error(
254
+ result, err = hooks.after_error(
257
255
  AfterErrorContext(hook_ctx), http_res, None
258
256
  )
259
257
  if err is not None:
@@ -273,9 +271,7 @@ class BaseSDK:
273
271
  http_res = do()
274
272
 
275
273
  if not utils.match_status_codes(error_status_codes, http_res.status_code):
276
- http_res = self.sdk_configuration.get_hooks().after_success(
277
- AfterSuccessContext(hook_ctx), http_res
278
- )
274
+ http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
279
275
 
280
276
  return http_res
281
277
 
@@ -290,12 +286,12 @@ class BaseSDK:
290
286
  client = self.sdk_configuration.async_client
291
287
  logger = self.sdk_configuration.debug_logger
292
288
 
289
+ hooks = self.sdk_configuration.__dict__["_hooks"]
290
+
293
291
  async def do():
294
292
  http_res = None
295
293
  try:
296
- req = self.sdk_configuration.get_hooks().before_request(
297
- BeforeRequestContext(hook_ctx), request
298
- )
294
+ req = hooks.before_request(BeforeRequestContext(hook_ctx), request)
299
295
  logger.debug(
300
296
  "Request:\nMethod: %s\nURL: %s\nHeaders: %s\nBody: %s",
301
297
  req.method,
@@ -309,9 +305,7 @@ class BaseSDK:
309
305
 
310
306
  http_res = await client.send(req, stream=stream)
311
307
  except Exception as e:
312
- _, e = self.sdk_configuration.get_hooks().after_error(
313
- AfterErrorContext(hook_ctx), None, e
314
- )
308
+ _, e = hooks.after_error(AfterErrorContext(hook_ctx), None, e)
315
309
  if e is not None:
316
310
  logger.debug("Request Exception", exc_info=True)
317
311
  raise e
@@ -329,7 +323,7 @@ class BaseSDK:
329
323
  )
330
324
 
331
325
  if utils.match_status_codes(error_status_codes, http_res.status_code):
332
- result, err = self.sdk_configuration.get_hooks().after_error(
326
+ result, err = hooks.after_error(
333
327
  AfterErrorContext(hook_ctx), http_res, None
334
328
  )
335
329
  if err is not None:
@@ -351,8 +345,6 @@ class BaseSDK:
351
345
  http_res = await do()
352
346
 
353
347
  if not utils.match_status_codes(error_status_codes, http_res.status_code):
354
- http_res = self.sdk_configuration.get_hooks().after_success(
355
- AfterSuccessContext(hook_ctx), http_res
356
- )
348
+ http_res = hooks.after_success(AfterSuccessContext(hook_ctx), http_res)
357
349
 
358
350
  return http_res
mixpeek/bucketobjects.py CHANGED
@@ -5,7 +5,7 @@ from mixpeek import models, utils
5
5
  from mixpeek._hooks import HookContext
6
6
  from mixpeek.types import OptionalNullable, UNSET
7
7
  from mixpeek.utils import get_security_from_env
8
- from typing import Any, List, Mapping, Optional, Union
8
+ from typing import Any, Dict, List, Mapping, Optional, Union
9
9
 
10
10
 
11
11
  class BucketObjects(BaseSDK):
@@ -20,12 +20,7 @@ class BucketObjects(BaseSDK):
20
20
  List[models.CreateBlobRequest], List[models.CreateBlobRequestTypedDict]
21
21
  ]
22
22
  ] = None,
23
- metadata: Optional[
24
- Union[
25
- models.CreateObjectRequestMetadata,
26
- models.CreateObjectRequestMetadataTypedDict,
27
- ]
28
- ] = None,
23
+ metadata: Optional[Dict[str, Any]] = None,
29
24
  skip_duplicates: Optional[bool] = False,
30
25
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
31
26
  server_url: Optional[str] = None,
@@ -66,9 +61,7 @@ class BucketObjects(BaseSDK):
66
61
  blobs=utils.get_pydantic_model(
67
62
  blobs, Optional[List[models.CreateBlobRequest]]
68
63
  ),
69
- metadata=utils.get_pydantic_model(
70
- metadata, Optional[models.CreateObjectRequestMetadata]
71
- ),
64
+ metadata=metadata,
72
65
  skip_duplicates=skip_duplicates,
73
66
  ),
74
67
  )
@@ -106,6 +99,7 @@ class BucketObjects(BaseSDK):
106
99
 
107
100
  http_res = self.do_request(
108
101
  hook_ctx=HookContext(
102
+ config=self.sdk_configuration,
109
103
  base_url=base_url or "",
110
104
  operation_id="create_object_v1_buckets__bucket_identifier__objects_create_post",
111
105
  oauth2_scopes=[],
@@ -169,12 +163,7 @@ class BucketObjects(BaseSDK):
169
163
  List[models.CreateBlobRequest], List[models.CreateBlobRequestTypedDict]
170
164
  ]
171
165
  ] = None,
172
- metadata: Optional[
173
- Union[
174
- models.CreateObjectRequestMetadata,
175
- models.CreateObjectRequestMetadataTypedDict,
176
- ]
177
- ] = None,
166
+ metadata: Optional[Dict[str, Any]] = None,
178
167
  skip_duplicates: Optional[bool] = False,
179
168
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
180
169
  server_url: Optional[str] = None,
@@ -215,9 +204,7 @@ class BucketObjects(BaseSDK):
215
204
  blobs=utils.get_pydantic_model(
216
205
  blobs, Optional[List[models.CreateBlobRequest]]
217
206
  ),
218
- metadata=utils.get_pydantic_model(
219
- metadata, Optional[models.CreateObjectRequestMetadata]
220
- ),
207
+ metadata=metadata,
221
208
  skip_duplicates=skip_duplicates,
222
209
  ),
223
210
  )
@@ -255,6 +242,7 @@ class BucketObjects(BaseSDK):
255
242
 
256
243
  http_res = await self.do_request_async(
257
244
  hook_ctx=HookContext(
245
+ config=self.sdk_configuration,
258
246
  base_url=base_url or "",
259
247
  operation_id="create_object_v1_buckets__bucket_identifier__objects_create_post",
260
248
  oauth2_scopes=[],
@@ -374,6 +362,7 @@ class BucketObjects(BaseSDK):
374
362
 
375
363
  http_res = self.do_request(
376
364
  hook_ctx=HookContext(
365
+ config=self.sdk_configuration,
377
366
  base_url=base_url or "",
378
367
  operation_id="get_object_v1_buckets__bucket_identifier__objects__object_identifier__get",
379
368
  oauth2_scopes=[],
@@ -493,6 +482,7 @@ class BucketObjects(BaseSDK):
493
482
 
494
483
  http_res = await self.do_request_async(
495
484
  hook_ctx=HookContext(
485
+ config=self.sdk_configuration,
496
486
  base_url=base_url or "",
497
487
  operation_id="get_object_v1_buckets__bucket_identifier__objects__object_identifier__get",
498
488
  oauth2_scopes=[],
@@ -557,12 +547,7 @@ class BucketObjects(BaseSDK):
557
547
  List[models.CreateBlobRequest], List[models.CreateBlobRequestTypedDict]
558
548
  ]
559
549
  ] = UNSET,
560
- metadata: OptionalNullable[
561
- Union[
562
- models.UpdateObjectRequestMetadata,
563
- models.UpdateObjectRequestMetadataTypedDict,
564
- ]
565
- ] = UNSET,
550
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET,
566
551
  skip_duplicates: OptionalNullable[bool] = UNSET,
567
552
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
568
553
  server_url: Optional[str] = None,
@@ -605,9 +590,7 @@ class BucketObjects(BaseSDK):
605
590
  blobs=utils.get_pydantic_model(
606
591
  blobs, OptionalNullable[List[models.CreateBlobRequest]]
607
592
  ),
608
- metadata=utils.get_pydantic_model(
609
- metadata, OptionalNullable[models.UpdateObjectRequestMetadata]
610
- ),
593
+ metadata=metadata,
611
594
  skip_duplicates=skip_duplicates,
612
595
  ),
613
596
  )
@@ -645,6 +628,7 @@ class BucketObjects(BaseSDK):
645
628
 
646
629
  http_res = self.do_request(
647
630
  hook_ctx=HookContext(
631
+ config=self.sdk_configuration,
648
632
  base_url=base_url or "",
649
633
  operation_id="update_object_v1_buckets__bucket_identifier__objects__object_identifier__put",
650
634
  oauth2_scopes=[],
@@ -709,12 +693,7 @@ class BucketObjects(BaseSDK):
709
693
  List[models.CreateBlobRequest], List[models.CreateBlobRequestTypedDict]
710
694
  ]
711
695
  ] = UNSET,
712
- metadata: OptionalNullable[
713
- Union[
714
- models.UpdateObjectRequestMetadata,
715
- models.UpdateObjectRequestMetadataTypedDict,
716
- ]
717
- ] = UNSET,
696
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET,
718
697
  skip_duplicates: OptionalNullable[bool] = UNSET,
719
698
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
720
699
  server_url: Optional[str] = None,
@@ -757,9 +736,7 @@ class BucketObjects(BaseSDK):
757
736
  blobs=utils.get_pydantic_model(
758
737
  blobs, OptionalNullable[List[models.CreateBlobRequest]]
759
738
  ),
760
- metadata=utils.get_pydantic_model(
761
- metadata, OptionalNullable[models.UpdateObjectRequestMetadata]
762
- ),
739
+ metadata=metadata,
763
740
  skip_duplicates=skip_duplicates,
764
741
  ),
765
742
  )
@@ -797,6 +774,7 @@ class BucketObjects(BaseSDK):
797
774
 
798
775
  http_res = await self.do_request_async(
799
776
  hook_ctx=HookContext(
777
+ config=self.sdk_configuration,
800
778
  base_url=base_url or "",
801
779
  operation_id="update_object_v1_buckets__bucket_identifier__objects__object_identifier__put",
802
780
  oauth2_scopes=[],
@@ -914,6 +892,7 @@ class BucketObjects(BaseSDK):
914
892
 
915
893
  http_res = self.do_request(
916
894
  hook_ctx=HookContext(
895
+ config=self.sdk_configuration,
917
896
  base_url=base_url or "",
918
897
  operation_id="delete_object_v1_buckets__bucket_identifier__objects__object_identifier__delete",
919
898
  oauth2_scopes=[],
@@ -1031,6 +1010,7 @@ class BucketObjects(BaseSDK):
1031
1010
 
1032
1011
  http_res = await self.do_request_async(
1033
1012
  hook_ctx=HookContext(
1013
+ config=self.sdk_configuration,
1034
1014
  base_url=base_url or "",
1035
1015
  operation_id="delete_object_v1_buckets__bucket_identifier__objects__object_identifier__delete",
1036
1016
  oauth2_scopes=[],
@@ -1177,6 +1157,7 @@ class BucketObjects(BaseSDK):
1177
1157
 
1178
1158
  http_res = self.do_request(
1179
1159
  hook_ctx=HookContext(
1160
+ config=self.sdk_configuration,
1180
1161
  base_url=base_url or "",
1181
1162
  operation_id="list_objects_v1_buckets__bucket_identifier__objects_post",
1182
1163
  oauth2_scopes=[],
@@ -1323,6 +1304,7 @@ class BucketObjects(BaseSDK):
1323
1304
 
1324
1305
  http_res = await self.do_request_async(
1325
1306
  hook_ctx=HookContext(
1307
+ config=self.sdk_configuration,
1326
1308
  base_url=base_url or "",
1327
1309
  operation_id="list_objects_v1_buckets__bucket_identifier__objects_post",
1328
1310
  oauth2_scopes=[],
mixpeek/buckets.py CHANGED
@@ -5,7 +5,7 @@ from mixpeek import models, utils
5
5
  from mixpeek._hooks import HookContext
6
6
  from mixpeek.types import OptionalNullable, UNSET
7
7
  from mixpeek.utils import get_security_from_env
8
- from typing import Any, Mapping, Optional, Union
8
+ from typing import Any, Dict, Mapping, Optional, Union
9
9
 
10
10
 
11
11
  class Buckets(BaseSDK):
@@ -18,12 +18,7 @@ class Buckets(BaseSDK):
18
18
  ],
19
19
  x_namespace: OptionalNullable[str] = UNSET,
20
20
  description: OptionalNullable[str] = UNSET,
21
- metadata: Optional[
22
- Union[
23
- models.BucketCreateRequestMetadata,
24
- models.BucketCreateRequestMetadataTypedDict,
25
- ]
26
- ] = None,
21
+ metadata: Optional[Dict[str, Any]] = None,
27
22
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
28
23
  server_url: Optional[str] = None,
29
24
  timeout_ms: Optional[int] = None,
@@ -63,9 +58,7 @@ class Buckets(BaseSDK):
63
58
  bucket_schema=utils.get_pydantic_model(
64
59
  bucket_schema, models.BucketSchemaInput
65
60
  ),
66
- metadata=utils.get_pydantic_model(
67
- metadata, Optional[models.BucketCreateRequestMetadata]
68
- ),
61
+ metadata=metadata,
69
62
  ),
70
63
  )
71
64
 
@@ -102,6 +95,7 @@ class Buckets(BaseSDK):
102
95
 
103
96
  http_res = self.do_request(
104
97
  hook_ctx=HookContext(
98
+ config=self.sdk_configuration,
105
99
  base_url=base_url or "",
106
100
  operation_id="create_bucket_v1_buckets_create_post",
107
101
  oauth2_scopes=[],
@@ -163,12 +157,7 @@ class Buckets(BaseSDK):
163
157
  ],
164
158
  x_namespace: OptionalNullable[str] = UNSET,
165
159
  description: OptionalNullable[str] = UNSET,
166
- metadata: Optional[
167
- Union[
168
- models.BucketCreateRequestMetadata,
169
- models.BucketCreateRequestMetadataTypedDict,
170
- ]
171
- ] = None,
160
+ metadata: Optional[Dict[str, Any]] = None,
172
161
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
173
162
  server_url: Optional[str] = None,
174
163
  timeout_ms: Optional[int] = None,
@@ -208,9 +197,7 @@ class Buckets(BaseSDK):
208
197
  bucket_schema=utils.get_pydantic_model(
209
198
  bucket_schema, models.BucketSchemaInput
210
199
  ),
211
- metadata=utils.get_pydantic_model(
212
- metadata, Optional[models.BucketCreateRequestMetadata]
213
- ),
200
+ metadata=metadata,
214
201
  ),
215
202
  )
216
203
 
@@ -247,6 +234,7 @@ class Buckets(BaseSDK):
247
234
 
248
235
  http_res = await self.do_request_async(
249
236
  hook_ctx=HookContext(
237
+ config=self.sdk_configuration,
250
238
  base_url=base_url or "",
251
239
  operation_id="create_bucket_v1_buckets_create_post",
252
240
  oauth2_scopes=[],
@@ -361,6 +349,7 @@ class Buckets(BaseSDK):
361
349
 
362
350
  http_res = self.do_request(
363
351
  hook_ctx=HookContext(
352
+ config=self.sdk_configuration,
364
353
  base_url=base_url or "",
365
354
  operation_id="get_bucket_v1_buckets__bucket_identifier__get",
366
355
  oauth2_scopes=[],
@@ -475,6 +464,7 @@ class Buckets(BaseSDK):
475
464
 
476
465
  http_res = await self.do_request_async(
477
466
  hook_ctx=HookContext(
467
+ config=self.sdk_configuration,
478
468
  base_url=base_url or "",
479
469
  operation_id="get_bucket_v1_buckets__bucket_identifier__get",
480
470
  oauth2_scopes=[],
@@ -534,9 +524,7 @@ class Buckets(BaseSDK):
534
524
  x_namespace: OptionalNullable[str] = UNSET,
535
525
  bucket_name: OptionalNullable[str] = UNSET,
536
526
  description: OptionalNullable[str] = UNSET,
537
- metadata: OptionalNullable[
538
- Union[models.Metadata, models.MetadataTypedDict]
539
- ] = UNSET,
527
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET,
540
528
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
541
529
  server_url: Optional[str] = None,
542
530
  timeout_ms: Optional[int] = None,
@@ -573,9 +561,7 @@ class Buckets(BaseSDK):
573
561
  bucket_update_request=models.BucketUpdateRequest(
574
562
  bucket_name=bucket_name,
575
563
  description=description,
576
- metadata=utils.get_pydantic_model(
577
- metadata, OptionalNullable[models.Metadata]
578
- ),
564
+ metadata=metadata,
579
565
  ),
580
566
  )
581
567
 
@@ -612,6 +598,7 @@ class Buckets(BaseSDK):
612
598
 
613
599
  http_res = self.do_request(
614
600
  hook_ctx=HookContext(
601
+ config=self.sdk_configuration,
615
602
  base_url=base_url or "",
616
603
  operation_id="update_bucket_v1_buckets__bucket_identifier__put",
617
604
  oauth2_scopes=[],
@@ -671,9 +658,7 @@ class Buckets(BaseSDK):
671
658
  x_namespace: OptionalNullable[str] = UNSET,
672
659
  bucket_name: OptionalNullable[str] = UNSET,
673
660
  description: OptionalNullable[str] = UNSET,
674
- metadata: OptionalNullable[
675
- Union[models.Metadata, models.MetadataTypedDict]
676
- ] = UNSET,
661
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET,
677
662
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
678
663
  server_url: Optional[str] = None,
679
664
  timeout_ms: Optional[int] = None,
@@ -710,9 +695,7 @@ class Buckets(BaseSDK):
710
695
  bucket_update_request=models.BucketUpdateRequest(
711
696
  bucket_name=bucket_name,
712
697
  description=description,
713
- metadata=utils.get_pydantic_model(
714
- metadata, OptionalNullable[models.Metadata]
715
- ),
698
+ metadata=metadata,
716
699
  ),
717
700
  )
718
701
 
@@ -749,6 +732,7 @@ class Buckets(BaseSDK):
749
732
 
750
733
  http_res = await self.do_request_async(
751
734
  hook_ctx=HookContext(
735
+ config=self.sdk_configuration,
752
736
  base_url=base_url or "",
753
737
  operation_id="update_bucket_v1_buckets__bucket_identifier__put",
754
738
  oauth2_scopes=[],
@@ -863,6 +847,7 @@ class Buckets(BaseSDK):
863
847
 
864
848
  http_res = self.do_request(
865
849
  hook_ctx=HookContext(
850
+ config=self.sdk_configuration,
866
851
  base_url=base_url or "",
867
852
  operation_id="delete_bucket_v1_buckets__bucket_identifier__delete",
868
853
  oauth2_scopes=[],
@@ -977,6 +962,7 @@ class Buckets(BaseSDK):
977
962
 
978
963
  http_res = await self.do_request_async(
979
964
  hook_ctx=HookContext(
965
+ config=self.sdk_configuration,
980
966
  base_url=base_url or "",
981
967
  operation_id="delete_bucket_v1_buckets__bucket_identifier__delete",
982
968
  oauth2_scopes=[],
@@ -1108,6 +1094,7 @@ class Buckets(BaseSDK):
1108
1094
 
1109
1095
  http_res = self.do_request(
1110
1096
  hook_ctx=HookContext(
1097
+ config=self.sdk_configuration,
1111
1098
  base_url=base_url or "",
1112
1099
  operation_id="list_buckets_v1_buckets_post",
1113
1100
  oauth2_scopes=[],
@@ -1239,6 +1226,7 @@ class Buckets(BaseSDK):
1239
1226
 
1240
1227
  http_res = await self.do_request_async(
1241
1228
  hook_ctx=HookContext(
1229
+ config=self.sdk_configuration,
1242
1230
  base_url=base_url or "",
1243
1231
  operation_id="list_buckets_v1_buckets_post",
1244
1232
  oauth2_scopes=[],
mixpeek/clusters.py CHANGED
@@ -105,6 +105,7 @@ class Clusters(BaseSDK):
105
105
 
106
106
  http_res = self.do_request(
107
107
  hook_ctx=HookContext(
108
+ config=self.sdk_configuration,
108
109
  base_url=base_url or "",
109
110
  operation_id="create_cluster_v1_clusters_post",
110
111
  oauth2_scopes=[],
@@ -253,6 +254,7 @@ class Clusters(BaseSDK):
253
254
 
254
255
  http_res = await self.do_request_async(
255
256
  hook_ctx=HookContext(
257
+ config=self.sdk_configuration,
256
258
  base_url=base_url or "",
257
259
  operation_id="create_cluster_v1_clusters_post",
258
260
  oauth2_scopes=[],
@@ -106,6 +106,7 @@ class CollectionCache(BaseSDK):
106
106
 
107
107
  http_res = self.do_request(
108
108
  hook_ctx=HookContext(
109
+ config=self.sdk_configuration,
109
110
  base_url=base_url or "",
110
111
  operation_id="invalidate_cache_v1_collections_cache_invalidate_post",
111
112
  oauth2_scopes=[],
@@ -255,6 +256,7 @@ class CollectionCache(BaseSDK):
255
256
 
256
257
  http_res = await self.do_request_async(
257
258
  hook_ctx=HookContext(
259
+ config=self.sdk_configuration,
258
260
  base_url=base_url or "",
259
261
  operation_id="invalidate_cache_v1_collections_cache_invalidate_post",
260
262
  oauth2_scopes=[],
@@ -381,6 +383,7 @@ class CollectionCache(BaseSDK):
381
383
 
382
384
  http_res = self.do_request(
383
385
  hook_ctx=HookContext(
386
+ config=self.sdk_configuration,
384
387
  base_url=base_url or "",
385
388
  operation_id="get_cache_stats_v1_collections_cache_stats_get",
386
389
  oauth2_scopes=[],
@@ -507,6 +510,7 @@ class CollectionCache(BaseSDK):
507
510
 
508
511
  http_res = await self.do_request_async(
509
512
  hook_ctx=HookContext(
513
+ config=self.sdk_configuration,
510
514
  base_url=base_url or "",
511
515
  operation_id="get_cache_stats_v1_collections_cache_stats_get",
512
516
  oauth2_scopes=[],
@@ -637,6 +641,7 @@ class CollectionCache(BaseSDK):
637
641
 
638
642
  http_res = self.do_request(
639
643
  hook_ctx=HookContext(
644
+ config=self.sdk_configuration,
640
645
  base_url=base_url or "",
641
646
  operation_id="cleanup_cache_v1_collections_cache_cleanup_post",
642
647
  oauth2_scopes=[],
@@ -767,6 +772,7 @@ class CollectionCache(BaseSDK):
767
772
 
768
773
  http_res = await self.do_request_async(
769
774
  hook_ctx=HookContext(
775
+ config=self.sdk_configuration,
770
776
  base_url=base_url or "",
771
777
  operation_id="cleanup_cache_v1_collections_cache_cleanup_post",
772
778
  oauth2_scopes=[],
mixpeek/collections.py CHANGED
@@ -5,7 +5,7 @@ from mixpeek import models, utils
5
5
  from mixpeek._hooks import HookContext
6
6
  from mixpeek.types import OptionalNullable, UNSET
7
7
  from mixpeek.utils import get_security_from_env
8
- from typing import Any, List, Mapping, Optional, Union
8
+ from typing import Any, Dict, List, Mapping, Optional, Union
9
9
 
10
10
 
11
11
  class Collections(BaseSDK):
@@ -27,12 +27,7 @@ class Collections(BaseSDK):
27
27
  ]
28
28
  ] = None,
29
29
  enabled: Optional[bool] = True,
30
- metadata: OptionalNullable[
31
- Union[
32
- models.CreateCollectionRequestMetadata,
33
- models.CreateCollectionRequestMetadataTypedDict,
34
- ]
35
- ] = UNSET,
30
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET,
36
31
  document_handling: OptionalNullable[
37
32
  Union[models.DocumentHandlingConfig, models.DocumentHandlingConfigTypedDict]
38
33
  ] = UNSET,
@@ -90,9 +85,7 @@ class Collections(BaseSDK):
90
85
  Optional[List[models.TaxonomyApplicationConfig]],
91
86
  ),
92
87
  enabled=enabled,
93
- metadata=utils.get_pydantic_model(
94
- metadata, OptionalNullable[models.CreateCollectionRequestMetadata]
95
- ),
88
+ metadata=metadata,
96
89
  document_handling=utils.get_pydantic_model(
97
90
  document_handling, OptionalNullable[models.DocumentHandlingConfig]
98
91
  ),
@@ -135,6 +128,7 @@ class Collections(BaseSDK):
135
128
 
136
129
  http_res = self.do_request(
137
130
  hook_ctx=HookContext(
131
+ config=self.sdk_configuration,
138
132
  base_url=base_url or "",
139
133
  operation_id="create_collection_v1_collections_create_post",
140
134
  oauth2_scopes=[],
@@ -205,12 +199,7 @@ class Collections(BaseSDK):
205
199
  ]
206
200
  ] = None,
207
201
  enabled: Optional[bool] = True,
208
- metadata: OptionalNullable[
209
- Union[
210
- models.CreateCollectionRequestMetadata,
211
- models.CreateCollectionRequestMetadataTypedDict,
212
- ]
213
- ] = UNSET,
202
+ metadata: OptionalNullable[Dict[str, Any]] = UNSET,
214
203
  document_handling: OptionalNullable[
215
204
  Union[models.DocumentHandlingConfig, models.DocumentHandlingConfigTypedDict]
216
205
  ] = UNSET,
@@ -268,9 +257,7 @@ class Collections(BaseSDK):
268
257
  Optional[List[models.TaxonomyApplicationConfig]],
269
258
  ),
270
259
  enabled=enabled,
271
- metadata=utils.get_pydantic_model(
272
- metadata, OptionalNullable[models.CreateCollectionRequestMetadata]
273
- ),
260
+ metadata=metadata,
274
261
  document_handling=utils.get_pydantic_model(
275
262
  document_handling, OptionalNullable[models.DocumentHandlingConfig]
276
263
  ),
@@ -313,6 +300,7 @@ class Collections(BaseSDK):
313
300
 
314
301
  http_res = await self.do_request_async(
315
302
  hook_ctx=HookContext(
303
+ config=self.sdk_configuration,
316
304
  base_url=base_url or "",
317
305
  operation_id="create_collection_v1_collections_create_post",
318
306
  oauth2_scopes=[],
@@ -377,6 +365,8 @@ class Collections(BaseSDK):
377
365
  ) -> models.CollectionModel:
378
366
  r"""Get Collection
379
367
 
368
+ This endpoint allows you to retrieve a collection by ID.
369
+
380
370
  :param collection_id: The ID of the collection to retrieve
381
371
  :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
382
372
  :param retries: Override the default retry configuration for this method
@@ -425,6 +415,7 @@ class Collections(BaseSDK):
425
415
 
426
416
  http_res = self.do_request(
427
417
  hook_ctx=HookContext(
418
+ config=self.sdk_configuration,
428
419
  base_url=base_url or "",
429
420
  operation_id="get_collection_v1_collections__collection_id__get",
430
421
  oauth2_scopes=[],
@@ -489,6 +480,8 @@ class Collections(BaseSDK):
489
480
  ) -> models.CollectionModel:
490
481
  r"""Get Collection
491
482
 
483
+ This endpoint allows you to retrieve a collection by ID.
484
+
492
485
  :param collection_id: The ID of the collection to retrieve
493
486
  :param x_namespace: Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint.
494
487
  :param retries: Override the default retry configuration for this method
@@ -537,6 +530,7 @@ class Collections(BaseSDK):
537
530
 
538
531
  http_res = await self.do_request_async(
539
532
  hook_ctx=HookContext(
533
+ config=self.sdk_configuration,
540
534
  base_url=base_url or "",
541
535
  operation_id="get_collection_v1_collections__collection_id__get",
542
536
  oauth2_scopes=[],