mixpeek 0.15.2__py3-none-any.whl → 0.16.1__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.
- mixpeek/_hooks/__init__.py +0 -1
- mixpeek/_hooks/sdkhooks.py +0 -2
- mixpeek/_version.py +1 -1
- mixpeek/assets.py +74 -56
- mixpeek/collections.py +46 -40
- mixpeek/{featureextractors.py → feature_extractors.py} +6 -6
- mixpeek/feature_search.py +334 -0
- mixpeek/features.py +44 -356
- mixpeek/health.py +3 -15
- mixpeek/{ingest.py → ingest_assets.py} +43 -25
- mixpeek/models/__init__.py +291 -160
- mixpeek/models/assignmentconfig.py +25 -0
- mixpeek/models/availablemodels.py +2 -1
- mixpeek/models/{availableindexesresponse.py → availablemodelsresponse.py} +8 -4
- mixpeek/models/classificationmatch.py +72 -0
- mixpeek/models/classificationwithfeature.py +73 -0
- mixpeek/models/classify_features_v1_entities_taxonomies_taxonomy_classify_postop.py +73 -0
- mixpeek/models/{create_api_key_organizations_users_user_email_api_keys_postop.py → create_api_key_v1_organizations_users_user_email_api_keys_postop.py} +2 -2
- mixpeek/models/{create_collection_collections_postop.py → create_collection_v1_collections_postop.py} +2 -2
- mixpeek/models/create_taxonomy_v1_entities_taxonomies_postop.py +59 -0
- mixpeek/models/createnamespacerequest.py +2 -2
- mixpeek/models/{delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py → delete_api_key_v1_organizations_users_user_email_api_keys_key_name_deleteop.py} +2 -2
- mixpeek/models/{delete_asset_assets_asset_id_deleteop.py → delete_asset_v1_assets_asset_id_deleteop.py} +2 -2
- mixpeek/models/delete_classifications_v1_entities_taxonomies_taxonomy_classifications_classification_id_deleteop.py +70 -0
- mixpeek/models/{delete_collection_collections_collection_deleteop.py → delete_collection_v1_collections_collection_deleteop.py} +2 -2
- mixpeek/models/{delete_feature_features_feature_id_deleteop.py → delete_feature_v1_features_feature_id_deleteop.py} +2 -2
- mixpeek/models/{delete_namespace_namespaces_namespace_deleteop.py → delete_namespace_v1_namespaces_namespace_deleteop.py} +2 -2
- mixpeek/models/delete_taxonomy_v1_entities_taxonomies_taxonomy_deleteop.py +59 -0
- mixpeek/models/{delete_user_organizations_users_user_email_deleteop.py → delete_user_v1_organizations_users_user_email_deleteop.py} +2 -2
- mixpeek/models/discoverrequest.py +74 -0
- mixpeek/models/embeddingconfig.py +33 -0
- mixpeek/models/embeddingrequest.py +40 -7
- mixpeek/models/featureoptions.py +25 -0
- mixpeek/models/{full_asset_update_assets_asset_id_putop.py → full_asset_update_v1_assets_asset_id_putop.py} +2 -2
- mixpeek/models/{full_feature_update_features_feature_id_putop.py → full_feature_update_v1_features_feature_id_putop.py} +2 -2
- mixpeek/models/genericsuccessresponse.py +17 -0
- mixpeek/models/{get_asset_assets_asset_id_getop.py → get_asset_v1_assets_asset_id_getop.py} +2 -2
- mixpeek/models/{get_asset_with_features_assets_asset_id_features_getop.py → get_asset_with_features_v1_assets_asset_id_features_getop.py} +2 -2
- mixpeek/models/{get_collection_collections_collection_getop.py → get_collection_v1_collections_collection_getop.py} +2 -2
- mixpeek/models/{get_feature_features_feature_id_getop.py → get_feature_v1_features_feature_id_getop.py} +2 -2
- mixpeek/models/{get_namespace_namespaces_namespace_getop.py → get_namespace_v1_namespaces_namespace_getop.py} +2 -2
- mixpeek/models/{get_task_tasks_task_id_getop.py → get_task_v1_tasks_task_id_getop.py} +2 -2
- mixpeek/models/get_taxonomy_node_v1_entities_taxonomies_nodes_node_getop.py +59 -0
- mixpeek/models/get_taxonomy_v1_entities_taxonomies_taxonomy_getop.py +59 -0
- mixpeek/models/{get_user_organizations_users_user_email_getop.py → get_user_v1_organizations_users_user_email_getop.py} +2 -2
- mixpeek/models/{ingest_image_url_ingest_images_url_postop.py → ingest_image_url_v1_ingest_images_url_postop.py} +2 -2
- mixpeek/models/{ingest_text_ingest_text_postop.py → ingest_text_v1_ingest_text_postop.py} +2 -2
- mixpeek/models/{ingest_video_url_ingest_videos_url_postop.py → ingest_video_url_v1_ingest_videos_url_postop.py} +2 -2
- mixpeek/models/{kill_task_tasks_task_id_deleteop.py → kill_task_v1_tasks_task_id_deleteop.py} +2 -2
- mixpeek/models/{list_assets_assets_postop.py → list_assets_v1_assets_postop.py} +2 -2
- mixpeek/models/list_classifications_v1_entities_taxonomies_taxonomy_classifications_postop.py +92 -0
- mixpeek/models/{list_collections_collections_getop.py → list_collections_v1_collections_getop.py} +2 -2
- mixpeek/models/{list_features_features_postop.py → list_features_v1_features_postop.py} +2 -2
- mixpeek/models/list_taxonomies_v1_entities_taxonomies_getop.py +67 -0
- mixpeek/models/listclassificationsrequest.py +69 -0
- mixpeek/models/listclassificationsresponse.py +31 -0
- mixpeek/models/listtaxonomiesresponse.py +24 -0
- mixpeek/models/modeldetails.py +9 -5
- mixpeek/models/nodeoptions.py +16 -0
- mixpeek/models/nodeupdate.py +51 -0
- mixpeek/models/{partial_asset_update_assets_asset_id_patchop.py → partial_asset_update_v1_assets_asset_id_patchop.py} +2 -2
- mixpeek/models/permission.py +12 -0
- mixpeek/models/{search_assets_assets_search_postop.py → search_assets_v1_assets_search_postop.py} +2 -2
- mixpeek/models/{search_features_features_search_postop.py → search_features_v1_features_search_postop.py} +4 -4
- mixpeek/models/searchrequestfeatures.py +9 -7
- mixpeek/models/taxonomycreate.py +20 -0
- mixpeek/models/taxonomymodel.py +27 -0
- mixpeek/models/taxonomynode.py +101 -0
- mixpeek/models/taxonomynodecreate.py +63 -0
- mixpeek/models/taxonomyupdate.py +55 -0
- mixpeek/models/{update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py → update_api_key_v1_organizations_users_user_email_api_keys_key_name_patchop.py} +2 -2
- mixpeek/models/{update_collection_collections_collection_putop.py → update_collection_v1_collections_collection_putop.py} +2 -2
- mixpeek/models/{update_namespace_namespaces_namespace_putop.py → update_namespace_v1_namespaces_namespace_putop.py} +2 -2
- mixpeek/models/update_node_v1_entities_taxonomies_nodes_node_patchop.py +71 -0
- mixpeek/models/update_taxonomy_v1_entities_taxonomies_taxonomy_patchop.py +71 -0
- mixpeek/models/vectormodel.py +1 -0
- mixpeek/namespaces.py +52 -52
- mixpeek/organizations.py +82 -58
- mixpeek/sdk.py +12 -6
- mixpeek/sdkconfiguration.py +4 -4
- mixpeek/tasks.py +22 -16
- mixpeek/taxonomy_entities.py +2214 -0
- {mixpeek-0.15.2.dist-info → mixpeek-0.16.1.dist-info}/METADATA +64 -49
- {mixpeek-0.15.2.dist-info → mixpeek-0.16.1.dist-info}/RECORD +85 -56
- {mixpeek-0.15.2.dist-info → mixpeek-0.16.1.dist-info}/WHEEL +1 -1
mixpeek/features.py
CHANGED
@@ -9,7 +9,7 @@ from typing import Any, List, Mapping, Optional, Union
|
|
9
9
|
|
10
10
|
|
11
11
|
class Features(BaseSDK):
|
12
|
-
def
|
12
|
+
def get_feature_v1_features_feature_id_get(
|
13
13
|
self,
|
14
14
|
*,
|
15
15
|
feature_id: str,
|
@@ -38,7 +38,7 @@ class Features(BaseSDK):
|
|
38
38
|
if server_url is not None:
|
39
39
|
base_url = server_url
|
40
40
|
|
41
|
-
request = models.
|
41
|
+
request = models.GetFeatureV1FeaturesFeatureIDGetRequest(
|
42
42
|
feature_id=feature_id,
|
43
43
|
return_vectors=return_vectors,
|
44
44
|
x_namespace=x_namespace,
|
@@ -46,7 +46,7 @@ class Features(BaseSDK):
|
|
46
46
|
|
47
47
|
req = self._build_request(
|
48
48
|
method="GET",
|
49
|
-
path="/features/{feature_id}",
|
49
|
+
path="/v1/features/{feature_id}",
|
50
50
|
base_url=base_url,
|
51
51
|
url_variables=url_variables,
|
52
52
|
request=request,
|
@@ -70,7 +70,7 @@ class Features(BaseSDK):
|
|
70
70
|
|
71
71
|
http_res = self.do_request(
|
72
72
|
hook_ctx=HookContext(
|
73
|
-
operation_id="
|
73
|
+
operation_id="get_feature_v1_features__feature_id__get",
|
74
74
|
oauth2_scopes=[],
|
75
75
|
security_source=get_security_from_env(
|
76
76
|
self.sdk_configuration.security, models.Security
|
@@ -107,7 +107,7 @@ class Features(BaseSDK):
|
|
107
107
|
http_res,
|
108
108
|
)
|
109
109
|
|
110
|
-
async def
|
110
|
+
async def get_feature_v1_features_feature_id_get_async(
|
111
111
|
self,
|
112
112
|
*,
|
113
113
|
feature_id: str,
|
@@ -136,7 +136,7 @@ class Features(BaseSDK):
|
|
136
136
|
if server_url is not None:
|
137
137
|
base_url = server_url
|
138
138
|
|
139
|
-
request = models.
|
139
|
+
request = models.GetFeatureV1FeaturesFeatureIDGetRequest(
|
140
140
|
feature_id=feature_id,
|
141
141
|
return_vectors=return_vectors,
|
142
142
|
x_namespace=x_namespace,
|
@@ -144,7 +144,7 @@ class Features(BaseSDK):
|
|
144
144
|
|
145
145
|
req = self._build_request_async(
|
146
146
|
method="GET",
|
147
|
-
path="/features/{feature_id}",
|
147
|
+
path="/v1/features/{feature_id}",
|
148
148
|
base_url=base_url,
|
149
149
|
url_variables=url_variables,
|
150
150
|
request=request,
|
@@ -168,7 +168,7 @@ class Features(BaseSDK):
|
|
168
168
|
|
169
169
|
http_res = await self.do_request_async(
|
170
170
|
hook_ctx=HookContext(
|
171
|
-
operation_id="
|
171
|
+
operation_id="get_feature_v1_features__feature_id__get",
|
172
172
|
oauth2_scopes=[],
|
173
173
|
security_source=get_security_from_env(
|
174
174
|
self.sdk_configuration.security, models.Security
|
@@ -205,7 +205,7 @@ class Features(BaseSDK):
|
|
205
205
|
http_res,
|
206
206
|
)
|
207
207
|
|
208
|
-
def
|
208
|
+
def delete_feature_v1_features_feature_id_delete(
|
209
209
|
self,
|
210
210
|
*,
|
211
211
|
feature_id: str,
|
@@ -217,6 +217,9 @@ class Features(BaseSDK):
|
|
217
217
|
) -> Any:
|
218
218
|
r"""Delete Feature
|
219
219
|
|
220
|
+
**Requirements:**
|
221
|
+
- Required permissions: write
|
222
|
+
|
220
223
|
:param feature_id:
|
221
224
|
: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.
|
222
225
|
:param retries: Override the default retry configuration for this method
|
@@ -232,14 +235,14 @@ class Features(BaseSDK):
|
|
232
235
|
if server_url is not None:
|
233
236
|
base_url = server_url
|
234
237
|
|
235
|
-
request = models.
|
238
|
+
request = models.DeleteFeatureV1FeaturesFeatureIDDeleteRequest(
|
236
239
|
feature_id=feature_id,
|
237
240
|
x_namespace=x_namespace,
|
238
241
|
)
|
239
242
|
|
240
243
|
req = self._build_request(
|
241
244
|
method="DELETE",
|
242
|
-
path="/features/{feature_id}",
|
245
|
+
path="/v1/features/{feature_id}",
|
243
246
|
base_url=base_url,
|
244
247
|
url_variables=url_variables,
|
245
248
|
request=request,
|
@@ -263,7 +266,7 @@ class Features(BaseSDK):
|
|
263
266
|
|
264
267
|
http_res = self.do_request(
|
265
268
|
hook_ctx=HookContext(
|
266
|
-
operation_id="
|
269
|
+
operation_id="delete_feature_v1_features__feature_id__delete",
|
267
270
|
oauth2_scopes=[],
|
268
271
|
security_source=get_security_from_env(
|
269
272
|
self.sdk_configuration.security, models.Security
|
@@ -300,7 +303,7 @@ class Features(BaseSDK):
|
|
300
303
|
http_res,
|
301
304
|
)
|
302
305
|
|
303
|
-
async def
|
306
|
+
async def delete_feature_v1_features_feature_id_delete_async(
|
304
307
|
self,
|
305
308
|
*,
|
306
309
|
feature_id: str,
|
@@ -312,6 +315,9 @@ class Features(BaseSDK):
|
|
312
315
|
) -> Any:
|
313
316
|
r"""Delete Feature
|
314
317
|
|
318
|
+
**Requirements:**
|
319
|
+
- Required permissions: write
|
320
|
+
|
315
321
|
:param feature_id:
|
316
322
|
: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.
|
317
323
|
:param retries: Override the default retry configuration for this method
|
@@ -327,14 +333,14 @@ class Features(BaseSDK):
|
|
327
333
|
if server_url is not None:
|
328
334
|
base_url = server_url
|
329
335
|
|
330
|
-
request = models.
|
336
|
+
request = models.DeleteFeatureV1FeaturesFeatureIDDeleteRequest(
|
331
337
|
feature_id=feature_id,
|
332
338
|
x_namespace=x_namespace,
|
333
339
|
)
|
334
340
|
|
335
341
|
req = self._build_request_async(
|
336
342
|
method="DELETE",
|
337
|
-
path="/features/{feature_id}",
|
343
|
+
path="/v1/features/{feature_id}",
|
338
344
|
base_url=base_url,
|
339
345
|
url_variables=url_variables,
|
340
346
|
request=request,
|
@@ -358,7 +364,7 @@ class Features(BaseSDK):
|
|
358
364
|
|
359
365
|
http_res = await self.do_request_async(
|
360
366
|
hook_ctx=HookContext(
|
361
|
-
operation_id="
|
367
|
+
operation_id="delete_feature_v1_features__feature_id__delete",
|
362
368
|
oauth2_scopes=[],
|
363
369
|
security_source=get_security_from_env(
|
364
370
|
self.sdk_configuration.security, models.Security
|
@@ -395,7 +401,7 @@ class Features(BaseSDK):
|
|
395
401
|
http_res,
|
396
402
|
)
|
397
403
|
|
398
|
-
def
|
404
|
+
def full_feature_update_v1_features_feature_id_put(
|
399
405
|
self,
|
400
406
|
*,
|
401
407
|
feature_id: str,
|
@@ -411,6 +417,9 @@ class Features(BaseSDK):
|
|
411
417
|
) -> models.FeatureResponse:
|
412
418
|
r"""Full Feature Update
|
413
419
|
|
420
|
+
**Requirements:**
|
421
|
+
- Required permissions: write
|
422
|
+
|
414
423
|
:param feature_id:
|
415
424
|
:param metadata:
|
416
425
|
: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.
|
@@ -427,7 +436,7 @@ class Features(BaseSDK):
|
|
427
436
|
if server_url is not None:
|
428
437
|
base_url = server_url
|
429
438
|
|
430
|
-
request = models.
|
439
|
+
request = models.FullFeatureUpdateV1FeaturesFeatureIDPutRequest(
|
431
440
|
feature_id=feature_id,
|
432
441
|
x_namespace=x_namespace,
|
433
442
|
feature_update_request=models.FeatureUpdateRequest(
|
@@ -439,7 +448,7 @@ class Features(BaseSDK):
|
|
439
448
|
|
440
449
|
req = self._build_request(
|
441
450
|
method="PUT",
|
442
|
-
path="/features/{feature_id}",
|
451
|
+
path="/v1/features/{feature_id}",
|
443
452
|
base_url=base_url,
|
444
453
|
url_variables=url_variables,
|
445
454
|
request=request,
|
@@ -470,7 +479,7 @@ class Features(BaseSDK):
|
|
470
479
|
|
471
480
|
http_res = self.do_request(
|
472
481
|
hook_ctx=HookContext(
|
473
|
-
operation_id="
|
482
|
+
operation_id="full_feature_update_v1_features__feature_id__put",
|
474
483
|
oauth2_scopes=[],
|
475
484
|
security_source=get_security_from_env(
|
476
485
|
self.sdk_configuration.security, models.Security
|
@@ -507,7 +516,7 @@ class Features(BaseSDK):
|
|
507
516
|
http_res,
|
508
517
|
)
|
509
518
|
|
510
|
-
async def
|
519
|
+
async def full_feature_update_v1_features_feature_id_put_async(
|
511
520
|
self,
|
512
521
|
*,
|
513
522
|
feature_id: str,
|
@@ -523,6 +532,9 @@ class Features(BaseSDK):
|
|
523
532
|
) -> models.FeatureResponse:
|
524
533
|
r"""Full Feature Update
|
525
534
|
|
535
|
+
**Requirements:**
|
536
|
+
- Required permissions: write
|
537
|
+
|
526
538
|
:param feature_id:
|
527
539
|
:param metadata:
|
528
540
|
: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.
|
@@ -539,7 +551,7 @@ class Features(BaseSDK):
|
|
539
551
|
if server_url is not None:
|
540
552
|
base_url = server_url
|
541
553
|
|
542
|
-
request = models.
|
554
|
+
request = models.FullFeatureUpdateV1FeaturesFeatureIDPutRequest(
|
543
555
|
feature_id=feature_id,
|
544
556
|
x_namespace=x_namespace,
|
545
557
|
feature_update_request=models.FeatureUpdateRequest(
|
@@ -551,7 +563,7 @@ class Features(BaseSDK):
|
|
551
563
|
|
552
564
|
req = self._build_request_async(
|
553
565
|
method="PUT",
|
554
|
-
path="/features/{feature_id}",
|
566
|
+
path="/v1/features/{feature_id}",
|
555
567
|
base_url=base_url,
|
556
568
|
url_variables=url_variables,
|
557
569
|
request=request,
|
@@ -582,7 +594,7 @@ class Features(BaseSDK):
|
|
582
594
|
|
583
595
|
http_res = await self.do_request_async(
|
584
596
|
hook_ctx=HookContext(
|
585
|
-
operation_id="
|
597
|
+
operation_id="full_feature_update_v1_features__feature_id__put",
|
586
598
|
oauth2_scopes=[],
|
587
599
|
security_source=get_security_from_env(
|
588
600
|
self.sdk_configuration.security, models.Security
|
@@ -619,7 +631,7 @@ class Features(BaseSDK):
|
|
619
631
|
http_res,
|
620
632
|
)
|
621
633
|
|
622
|
-
def
|
634
|
+
def list_features_v1_features_post(
|
623
635
|
self,
|
624
636
|
*,
|
625
637
|
collections: List[str],
|
@@ -666,7 +678,7 @@ class Features(BaseSDK):
|
|
666
678
|
if server_url is not None:
|
667
679
|
base_url = server_url
|
668
680
|
|
669
|
-
request = models.
|
681
|
+
request = models.ListFeaturesV1FeaturesPostRequest(
|
670
682
|
offset_feature_id=offset_feature_id,
|
671
683
|
page_size=page_size,
|
672
684
|
x_namespace=x_namespace,
|
@@ -685,7 +697,7 @@ class Features(BaseSDK):
|
|
685
697
|
|
686
698
|
req = self._build_request(
|
687
699
|
method="POST",
|
688
|
-
path="/features",
|
700
|
+
path="/v1/features",
|
689
701
|
base_url=base_url,
|
690
702
|
url_variables=url_variables,
|
691
703
|
request=request,
|
@@ -716,7 +728,7 @@ class Features(BaseSDK):
|
|
716
728
|
|
717
729
|
http_res = self.do_request(
|
718
730
|
hook_ctx=HookContext(
|
719
|
-
operation_id="
|
731
|
+
operation_id="list_features_v1_features_post",
|
720
732
|
oauth2_scopes=[],
|
721
733
|
security_source=get_security_from_env(
|
722
734
|
self.sdk_configuration.security, models.Security
|
@@ -753,7 +765,7 @@ class Features(BaseSDK):
|
|
753
765
|
http_res,
|
754
766
|
)
|
755
767
|
|
756
|
-
async def
|
768
|
+
async def list_features_v1_features_post_async(
|
757
769
|
self,
|
758
770
|
*,
|
759
771
|
collections: List[str],
|
@@ -800,7 +812,7 @@ class Features(BaseSDK):
|
|
800
812
|
if server_url is not None:
|
801
813
|
base_url = server_url
|
802
814
|
|
803
|
-
request = models.
|
815
|
+
request = models.ListFeaturesV1FeaturesPostRequest(
|
804
816
|
offset_feature_id=offset_feature_id,
|
805
817
|
page_size=page_size,
|
806
818
|
x_namespace=x_namespace,
|
@@ -819,7 +831,7 @@ class Features(BaseSDK):
|
|
819
831
|
|
820
832
|
req = self._build_request_async(
|
821
833
|
method="POST",
|
822
|
-
path="/features",
|
834
|
+
path="/v1/features",
|
823
835
|
base_url=base_url,
|
824
836
|
url_variables=url_variables,
|
825
837
|
request=request,
|
@@ -850,7 +862,7 @@ class Features(BaseSDK):
|
|
850
862
|
|
851
863
|
http_res = await self.do_request_async(
|
852
864
|
hook_ctx=HookContext(
|
853
|
-
operation_id="
|
865
|
+
operation_id="list_features_v1_features_post",
|
854
866
|
oauth2_scopes=[],
|
855
867
|
security_source=get_security_from_env(
|
856
868
|
self.sdk_configuration.security, models.Security
|
@@ -886,327 +898,3 @@ class Features(BaseSDK):
|
|
886
898
|
http_res_text,
|
887
899
|
http_res,
|
888
900
|
)
|
889
|
-
|
890
|
-
def search(
|
891
|
-
self,
|
892
|
-
*,
|
893
|
-
queries: Union[
|
894
|
-
List[models.SearchModelSearchQuery],
|
895
|
-
List[models.SearchModelSearchQueryTypedDict],
|
896
|
-
],
|
897
|
-
collections: List[str],
|
898
|
-
offset_position: OptionalNullable[int] = UNSET,
|
899
|
-
page_size: Optional[int] = 10,
|
900
|
-
x_namespace: OptionalNullable[str] = UNSET,
|
901
|
-
filters: OptionalNullable[
|
902
|
-
Union[models.LogicalOperator, models.LogicalOperatorTypedDict]
|
903
|
-
] = UNSET,
|
904
|
-
group_by: OptionalNullable[
|
905
|
-
Union[models.GroupByOptions, models.GroupByOptionsTypedDict]
|
906
|
-
] = UNSET,
|
907
|
-
sort: OptionalNullable[
|
908
|
-
Union[models.SortOption, models.SortOptionTypedDict]
|
909
|
-
] = UNSET,
|
910
|
-
select: OptionalNullable[List[str]] = UNSET,
|
911
|
-
reranking_options: OptionalNullable[
|
912
|
-
Union[models.RerankingOptions, models.RerankingOptionsTypedDict]
|
913
|
-
] = UNSET,
|
914
|
-
session_id: OptionalNullable[str] = UNSET,
|
915
|
-
return_url: OptionalNullable[bool] = UNSET,
|
916
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
917
|
-
server_url: Optional[str] = None,
|
918
|
-
timeout_ms: Optional[int] = None,
|
919
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
920
|
-
) -> (
|
921
|
-
models.SearchFeaturesFeaturesSearchPostResponseSearchFeaturesFeaturesSearchPost
|
922
|
-
):
|
923
|
-
r"""Search Features
|
924
|
-
|
925
|
-
This endpoint allows you to search features.
|
926
|
-
|
927
|
-
:param queries: List of search queries to perform. Behavior: - Single query: Results are returned directly from that query - Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF) RRF combines results from multiple queries by: 1. Taking each item's rank position in each result list 2. Re-ranking all items by their combined RRF scores When merging lists from different sources, RRF considers all items that appear in any of the input lists, not just items that appear in all lists. This helps surface items that rank well across multiple queries while reducing the impact of outlier high rankings in single queries. NOTE: If query array is empty, it will return all features.
|
928
|
-
:param collections: List of Collection names to search within, required
|
929
|
-
:param offset_position: The position to start returning results from. Used for pagination. Does not work with group_by
|
930
|
-
:param page_size: Number of results to return per page.
|
931
|
-
: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.
|
932
|
-
:param filters: Used for filtering across all indexes
|
933
|
-
:param group_by: Grouping options for search results
|
934
|
-
:param sort: List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields.
|
935
|
-
:param select: List of fields to return in results, supports dot notation. If None, all fields are returned.
|
936
|
-
:param reranking_options: Options for ranking the search results, including weights and feedback application
|
937
|
-
:param session_id: Identifier for tracking search session interactions
|
938
|
-
:param return_url: Return the presigned URL for the asset and preview asset, this will introduce additional latency
|
939
|
-
:param retries: Override the default retry configuration for this method
|
940
|
-
:param server_url: Override the default server URL for this method
|
941
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
942
|
-
:param http_headers: Additional headers to set or replace on requests.
|
943
|
-
"""
|
944
|
-
base_url = None
|
945
|
-
url_variables = None
|
946
|
-
if timeout_ms is None:
|
947
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
948
|
-
|
949
|
-
if server_url is not None:
|
950
|
-
base_url = server_url
|
951
|
-
|
952
|
-
request = models.SearchFeaturesFeaturesSearchPostRequest(
|
953
|
-
offset_position=offset_position,
|
954
|
-
page_size=page_size,
|
955
|
-
x_namespace=x_namespace,
|
956
|
-
search_request_features=models.SearchRequestFeatures(
|
957
|
-
queries=utils.get_pydantic_model(
|
958
|
-
queries, List[models.SearchModelSearchQuery]
|
959
|
-
),
|
960
|
-
collections=collections,
|
961
|
-
filters=utils.get_pydantic_model(
|
962
|
-
filters, OptionalNullable[models.LogicalOperator]
|
963
|
-
),
|
964
|
-
group_by=utils.get_pydantic_model(
|
965
|
-
group_by, OptionalNullable[models.GroupByOptions]
|
966
|
-
),
|
967
|
-
sort=utils.get_pydantic_model(
|
968
|
-
sort, OptionalNullable[models.SortOption]
|
969
|
-
),
|
970
|
-
select=select,
|
971
|
-
reranking_options=utils.get_pydantic_model(
|
972
|
-
reranking_options, OptionalNullable[models.RerankingOptions]
|
973
|
-
),
|
974
|
-
session_id=session_id,
|
975
|
-
return_url=return_url,
|
976
|
-
),
|
977
|
-
)
|
978
|
-
|
979
|
-
req = self._build_request(
|
980
|
-
method="POST",
|
981
|
-
path="/features/search",
|
982
|
-
base_url=base_url,
|
983
|
-
url_variables=url_variables,
|
984
|
-
request=request,
|
985
|
-
request_body_required=True,
|
986
|
-
request_has_path_params=False,
|
987
|
-
request_has_query_params=True,
|
988
|
-
user_agent_header="user-agent",
|
989
|
-
accept_header_value="application/json",
|
990
|
-
http_headers=http_headers,
|
991
|
-
security=self.sdk_configuration.security,
|
992
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
993
|
-
request.search_request_features,
|
994
|
-
False,
|
995
|
-
False,
|
996
|
-
"json",
|
997
|
-
models.SearchRequestFeatures,
|
998
|
-
),
|
999
|
-
timeout_ms=timeout_ms,
|
1000
|
-
)
|
1001
|
-
|
1002
|
-
if retries == UNSET:
|
1003
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
1004
|
-
retries = self.sdk_configuration.retry_config
|
1005
|
-
|
1006
|
-
retry_config = None
|
1007
|
-
if isinstance(retries, utils.RetryConfig):
|
1008
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1009
|
-
|
1010
|
-
http_res = self.do_request(
|
1011
|
-
hook_ctx=HookContext(
|
1012
|
-
operation_id="search_features_features_search_post",
|
1013
|
-
oauth2_scopes=[],
|
1014
|
-
security_source=get_security_from_env(
|
1015
|
-
self.sdk_configuration.security, models.Security
|
1016
|
-
),
|
1017
|
-
),
|
1018
|
-
request=req,
|
1019
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
1020
|
-
retry_config=retry_config,
|
1021
|
-
)
|
1022
|
-
|
1023
|
-
data: Any = None
|
1024
|
-
if utils.match_response(http_res, "200", "application/json"):
|
1025
|
-
return utils.unmarshal_json(
|
1026
|
-
http_res.text,
|
1027
|
-
models.SearchFeaturesFeaturesSearchPostResponseSearchFeaturesFeaturesSearchPost,
|
1028
|
-
)
|
1029
|
-
if utils.match_response(
|
1030
|
-
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
1031
|
-
):
|
1032
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1033
|
-
raise models.ErrorResponse(data=data)
|
1034
|
-
if utils.match_response(http_res, "422", "application/json"):
|
1035
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
1036
|
-
raise models.HTTPValidationError(data=data)
|
1037
|
-
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
1038
|
-
http_res_text = utils.stream_to_text(http_res)
|
1039
|
-
raise models.APIError(
|
1040
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1041
|
-
)
|
1042
|
-
|
1043
|
-
content_type = http_res.headers.get("Content-Type")
|
1044
|
-
http_res_text = utils.stream_to_text(http_res)
|
1045
|
-
raise models.APIError(
|
1046
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1047
|
-
http_res.status_code,
|
1048
|
-
http_res_text,
|
1049
|
-
http_res,
|
1050
|
-
)
|
1051
|
-
|
1052
|
-
async def search_async(
|
1053
|
-
self,
|
1054
|
-
*,
|
1055
|
-
queries: Union[
|
1056
|
-
List[models.SearchModelSearchQuery],
|
1057
|
-
List[models.SearchModelSearchQueryTypedDict],
|
1058
|
-
],
|
1059
|
-
collections: List[str],
|
1060
|
-
offset_position: OptionalNullable[int] = UNSET,
|
1061
|
-
page_size: Optional[int] = 10,
|
1062
|
-
x_namespace: OptionalNullable[str] = UNSET,
|
1063
|
-
filters: OptionalNullable[
|
1064
|
-
Union[models.LogicalOperator, models.LogicalOperatorTypedDict]
|
1065
|
-
] = UNSET,
|
1066
|
-
group_by: OptionalNullable[
|
1067
|
-
Union[models.GroupByOptions, models.GroupByOptionsTypedDict]
|
1068
|
-
] = UNSET,
|
1069
|
-
sort: OptionalNullable[
|
1070
|
-
Union[models.SortOption, models.SortOptionTypedDict]
|
1071
|
-
] = UNSET,
|
1072
|
-
select: OptionalNullable[List[str]] = UNSET,
|
1073
|
-
reranking_options: OptionalNullable[
|
1074
|
-
Union[models.RerankingOptions, models.RerankingOptionsTypedDict]
|
1075
|
-
] = UNSET,
|
1076
|
-
session_id: OptionalNullable[str] = UNSET,
|
1077
|
-
return_url: OptionalNullable[bool] = UNSET,
|
1078
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
1079
|
-
server_url: Optional[str] = None,
|
1080
|
-
timeout_ms: Optional[int] = None,
|
1081
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
1082
|
-
) -> (
|
1083
|
-
models.SearchFeaturesFeaturesSearchPostResponseSearchFeaturesFeaturesSearchPost
|
1084
|
-
):
|
1085
|
-
r"""Search Features
|
1086
|
-
|
1087
|
-
This endpoint allows you to search features.
|
1088
|
-
|
1089
|
-
:param queries: List of search queries to perform. Behavior: - Single query: Results are returned directly from that query - Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF) RRF combines results from multiple queries by: 1. Taking each item's rank position in each result list 2. Re-ranking all items by their combined RRF scores When merging lists from different sources, RRF considers all items that appear in any of the input lists, not just items that appear in all lists. This helps surface items that rank well across multiple queries while reducing the impact of outlier high rankings in single queries. NOTE: If query array is empty, it will return all features.
|
1090
|
-
:param collections: List of Collection names to search within, required
|
1091
|
-
:param offset_position: The position to start returning results from. Used for pagination. Does not work with group_by
|
1092
|
-
:param page_size: Number of results to return per page.
|
1093
|
-
: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.
|
1094
|
-
:param filters: Used for filtering across all indexes
|
1095
|
-
:param group_by: Grouping options for search results
|
1096
|
-
:param sort: List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields.
|
1097
|
-
:param select: List of fields to return in results, supports dot notation. If None, all fields are returned.
|
1098
|
-
:param reranking_options: Options for ranking the search results, including weights and feedback application
|
1099
|
-
:param session_id: Identifier for tracking search session interactions
|
1100
|
-
:param return_url: Return the presigned URL for the asset and preview asset, this will introduce additional latency
|
1101
|
-
:param retries: Override the default retry configuration for this method
|
1102
|
-
:param server_url: Override the default server URL for this method
|
1103
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
1104
|
-
:param http_headers: Additional headers to set or replace on requests.
|
1105
|
-
"""
|
1106
|
-
base_url = None
|
1107
|
-
url_variables = None
|
1108
|
-
if timeout_ms is None:
|
1109
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
1110
|
-
|
1111
|
-
if server_url is not None:
|
1112
|
-
base_url = server_url
|
1113
|
-
|
1114
|
-
request = models.SearchFeaturesFeaturesSearchPostRequest(
|
1115
|
-
offset_position=offset_position,
|
1116
|
-
page_size=page_size,
|
1117
|
-
x_namespace=x_namespace,
|
1118
|
-
search_request_features=models.SearchRequestFeatures(
|
1119
|
-
queries=utils.get_pydantic_model(
|
1120
|
-
queries, List[models.SearchModelSearchQuery]
|
1121
|
-
),
|
1122
|
-
collections=collections,
|
1123
|
-
filters=utils.get_pydantic_model(
|
1124
|
-
filters, OptionalNullable[models.LogicalOperator]
|
1125
|
-
),
|
1126
|
-
group_by=utils.get_pydantic_model(
|
1127
|
-
group_by, OptionalNullable[models.GroupByOptions]
|
1128
|
-
),
|
1129
|
-
sort=utils.get_pydantic_model(
|
1130
|
-
sort, OptionalNullable[models.SortOption]
|
1131
|
-
),
|
1132
|
-
select=select,
|
1133
|
-
reranking_options=utils.get_pydantic_model(
|
1134
|
-
reranking_options, OptionalNullable[models.RerankingOptions]
|
1135
|
-
),
|
1136
|
-
session_id=session_id,
|
1137
|
-
return_url=return_url,
|
1138
|
-
),
|
1139
|
-
)
|
1140
|
-
|
1141
|
-
req = self._build_request_async(
|
1142
|
-
method="POST",
|
1143
|
-
path="/features/search",
|
1144
|
-
base_url=base_url,
|
1145
|
-
url_variables=url_variables,
|
1146
|
-
request=request,
|
1147
|
-
request_body_required=True,
|
1148
|
-
request_has_path_params=False,
|
1149
|
-
request_has_query_params=True,
|
1150
|
-
user_agent_header="user-agent",
|
1151
|
-
accept_header_value="application/json",
|
1152
|
-
http_headers=http_headers,
|
1153
|
-
security=self.sdk_configuration.security,
|
1154
|
-
get_serialized_body=lambda: utils.serialize_request_body(
|
1155
|
-
request.search_request_features,
|
1156
|
-
False,
|
1157
|
-
False,
|
1158
|
-
"json",
|
1159
|
-
models.SearchRequestFeatures,
|
1160
|
-
),
|
1161
|
-
timeout_ms=timeout_ms,
|
1162
|
-
)
|
1163
|
-
|
1164
|
-
if retries == UNSET:
|
1165
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
1166
|
-
retries = self.sdk_configuration.retry_config
|
1167
|
-
|
1168
|
-
retry_config = None
|
1169
|
-
if isinstance(retries, utils.RetryConfig):
|
1170
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
1171
|
-
|
1172
|
-
http_res = await self.do_request_async(
|
1173
|
-
hook_ctx=HookContext(
|
1174
|
-
operation_id="search_features_features_search_post",
|
1175
|
-
oauth2_scopes=[],
|
1176
|
-
security_source=get_security_from_env(
|
1177
|
-
self.sdk_configuration.security, models.Security
|
1178
|
-
),
|
1179
|
-
),
|
1180
|
-
request=req,
|
1181
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
1182
|
-
retry_config=retry_config,
|
1183
|
-
)
|
1184
|
-
|
1185
|
-
data: Any = None
|
1186
|
-
if utils.match_response(http_res, "200", "application/json"):
|
1187
|
-
return utils.unmarshal_json(
|
1188
|
-
http_res.text,
|
1189
|
-
models.SearchFeaturesFeaturesSearchPostResponseSearchFeaturesFeaturesSearchPost,
|
1190
|
-
)
|
1191
|
-
if utils.match_response(
|
1192
|
-
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
1193
|
-
):
|
1194
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
1195
|
-
raise models.ErrorResponse(data=data)
|
1196
|
-
if utils.match_response(http_res, "422", "application/json"):
|
1197
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
1198
|
-
raise models.HTTPValidationError(data=data)
|
1199
|
-
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
1200
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1201
|
-
raise models.APIError(
|
1202
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
1203
|
-
)
|
1204
|
-
|
1205
|
-
content_type = http_res.headers.get("Content-Type")
|
1206
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
1207
|
-
raise models.APIError(
|
1208
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
1209
|
-
http_res.status_code,
|
1210
|
-
http_res_text,
|
1211
|
-
http_res,
|
1212
|
-
)
|