mixpeek 0.20.20__py3-none-any.whl → 0.21.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. mixpeek/_version.py +3 -3
  2. mixpeek/{assets.py → bucketobjects.py} +309 -793
  3. mixpeek/buckets.py +1292 -0
  4. mixpeek/clusters.py +306 -0
  5. mixpeek/collectioncache.py +820 -0
  6. mixpeek/{taxonomyentities.py → collectiondocuments.py} +305 -559
  7. mixpeek/collections.py +120 -994
  8. mixpeek/features.py +45 -991
  9. mixpeek/models/__init__.py +625 -570
  10. mixpeek/models/aggregationtype.py +13 -0
  11. mixpeek/models/apikeyupdate.py +1 -1
  12. mixpeek/models/attributebasedconfig.py +21 -0
  13. mixpeek/models/automaticnaming.py +29 -0
  14. mixpeek/models/basicfeatureextractor.py +35 -0
  15. mixpeek/models/{classify_features_v1_entities_taxonomies_taxonomy_classify_postop.py → batch_delete_documents_v1_collections_collection_identifier_documents_batch_deleteop.py} +17 -15
  16. mixpeek/models/{update_collection_v1_collections_collection_putop.py → batch_update_documents_v1_collections_collection_identifier_documents_batch_putop.py} +29 -19
  17. mixpeek/models/blobdetails.py +72 -0
  18. mixpeek/models/blobmodel.py +107 -0
  19. mixpeek/models/bucketcreaterequest.py +75 -0
  20. mixpeek/models/bucketresponse.py +90 -0
  21. mixpeek/models/bucketschema_input.py +37 -0
  22. mixpeek/models/bucketschema_output.py +37 -0
  23. mixpeek/models/{featureresponse.py → bucketschemafield_input.py} +45 -18
  24. mixpeek/models/bucketschemafield_output.py +101 -0
  25. mixpeek/models/bucketschemafieldtype.py +29 -0
  26. mixpeek/models/bucketupdaterequest.py +68 -0
  27. mixpeek/models/cachestats.py +40 -0
  28. mixpeek/models/{list_collections_v1_collections_getop.py → cleanup_cache_v1_collections_cache_cleanup_postop.py} +23 -12
  29. mixpeek/models/{inputtype.py → clusteringmethod.py} +3 -5
  30. mixpeek/models/clustertype.py +9 -0
  31. mixpeek/models/collectioncacheconfig_input.py +92 -0
  32. mixpeek/models/collectioncacheconfig_output.py +92 -0
  33. mixpeek/models/collectionconfig.py +32 -0
  34. mixpeek/models/collectionmodel.py +79 -8
  35. mixpeek/models/{create_taxonomy_v1_entities_taxonomies_postop.py → create_bucket_v1_buckets_create_postop.py} +7 -7
  36. mixpeek/models/{search_assets_v1_assets_search_postop.py → create_cluster_v1_clusters_postop.py} +7 -7
  37. mixpeek/models/{create_collection_v1_collections_postop.py → create_collection_v1_collections_create_postop.py} +3 -3
  38. mixpeek/models/{ingest_video_url_v1_ingest_videos_url_postop.py → create_interaction_v1_retrievers_interactions_postop.py} +7 -7
  39. mixpeek/models/{partial_asset_update_v1_assets_asset_id_patchop.py → create_object_v1_buckets_bucket_identifier_objects_create_postop.py} +11 -9
  40. mixpeek/models/{ingest_text_v1_ingest_text_postop.py → create_retriever_v1_retrievers_retrievers_postop.py} +10 -7
  41. mixpeek/models/{ingest_image_url_v1_ingest_images_url_postop.py → create_taxonomy_v1_taxonomies_postop.py} +7 -7
  42. mixpeek/models/createblobrequest.py +80 -0
  43. mixpeek/models/createclusterrequest.py +74 -0
  44. mixpeek/models/createcollectionrequest.py +72 -3
  45. mixpeek/models/createnamespacerequest.py +14 -8
  46. mixpeek/models/createobjectrequest.py +75 -0
  47. mixpeek/models/createretrieverrequest.py +90 -0
  48. mixpeek/models/{taxonomyupdate.py → createtaxonomyrequest.py} +15 -13
  49. mixpeek/models/{delete_asset_v1_assets_asset_id_deleteop.py → delete_bucket_v1_buckets_bucket_identifier_deleteop.py} +5 -5
  50. mixpeek/models/{delete_classifications_v1_entities_taxonomies_taxonomy_classifications_classification_id_deleteop.py → delete_document_v1_collections_collection_identifier_documents_document_id_deleteop.py} +11 -11
  51. mixpeek/models/{get_taxonomy_v1_entities_taxonomies_taxonomy_getop.py → delete_interaction_v1_retrievers_interactions_interaction_id_deleteop.py} +7 -7
  52. mixpeek/models/delete_object_v1_buckets_bucket_identifier_objects_object_identifier_deleteop.py +70 -0
  53. mixpeek/models/{featureextractionembeddingrequest.py → documenthandlingconfig.py} +12 -15
  54. mixpeek/models/documentinputhandling.py +11 -0
  55. mixpeek/models/{jsontextoutputsettings.py → documentlistresponse.py} +15 -14
  56. mixpeek/models/documentoutputhandling.py +10 -0
  57. mixpeek/models/documentoutputtype.py +11 -0
  58. mixpeek/models/documentresponse.py +87 -0
  59. mixpeek/models/{nodeupdate.py → documentupdate.py} +22 -13
  60. mixpeek/models/enrichmentfield.py +25 -0
  61. mixpeek/models/errordetail.py +1 -1
  62. mixpeek/models/{update_node_v1_entities_taxonomies_nodes_node_patchop.py → execute_retriever_v1_retrievers_retrievers_retriever_id_execute_postop.py} +11 -11
  63. mixpeek/models/featureextractorconfig.py +116 -0
  64. mixpeek/models/featureextractordefinition.py +192 -0
  65. mixpeek/models/filtercondition.py +25 -25
  66. mixpeek/models/filteroperator.py +24 -0
  67. mixpeek/models/generativemodels.py +10 -0
  68. mixpeek/models/{delete_feature_v1_features_feature_id_deleteop.py → get_bucket_v1_buckets_bucket_identifier_getop.py} +5 -5
  69. mixpeek/models/{list_taxonomies_v1_entities_taxonomies_getop.py → get_cache_stats_v1_collections_cache_stats_getop.py} +16 -14
  70. mixpeek/models/get_collection_v1_collections_collection_id_getop.py +59 -0
  71. mixpeek/models/get_document_v1_collections_collection_identifier_documents_document_id_getop.py +70 -0
  72. mixpeek/models/get_feature_extractor_v1_features_extractors_feature_id_getop.py +16 -0
  73. mixpeek/models/get_interaction_v1_retrievers_interactions_interaction_id_getop.py +57 -0
  74. mixpeek/models/{delete_collection_v1_collections_collection_deleteop.py → get_object_v1_buckets_bucket_identifier_objects_object_identifier_getop.py} +16 -7
  75. mixpeek/models/get_research_v1_research_getop.py +52 -0
  76. mixpeek/models/get_retriever_stages_v1_retrievers_stages_getop.py +52 -0
  77. mixpeek/models/{delete_taxonomy_v1_entities_taxonomies_taxonomy_deleteop.py → get_retriever_v1_retrievers_retrievers_retriever_id_getop.py} +5 -7
  78. mixpeek/models/get_task_v1_tasks_task_id_getop.py +1 -1
  79. mixpeek/models/getusagerequestmodel.py +91 -0
  80. mixpeek/models/hdbscanparameters.py +26 -0
  81. mixpeek/models/interactionresponse.py +86 -0
  82. mixpeek/models/interactiontype.py +22 -0
  83. mixpeek/models/{search_features_v1_features_search_postop.py → invalidate_cache_v1_collections_cache_invalidate_postop.py} +60 -34
  84. mixpeek/models/invalidationevent.py +67 -0
  85. mixpeek/models/invalidationstrategy.py +12 -0
  86. mixpeek/models/kill_task_v1_tasks_task_id_deleteop.py +1 -1
  87. mixpeek/models/list_active_tasks_v1_tasks_getop.py +1 -1
  88. mixpeek/models/{list_assets_v1_assets_postop.py → list_buckets_v1_buckets_postop.py} +18 -18
  89. mixpeek/models/{list_features_v1_features_postop.py → list_documents_v1_collections_collection_identifier_documents_getop.py} +54 -19
  90. mixpeek/models/list_interactions_v1_retrievers_interactions_getop.py +96 -0
  91. mixpeek/models/{list_classifications_v1_entities_taxonomies_taxonomy_classifications_postop.py → list_objects_v1_buckets_bucket_identifier_objects_postop.py} +22 -29
  92. mixpeek/models/{groupbyoptionsasset.py → listbucketsrequest.py} +19 -28
  93. mixpeek/models/listbucketsresponse.py +23 -0
  94. mixpeek/models/{groupbyoptions.py → listobjectsrequest.py} +19 -28
  95. mixpeek/models/listobjectsresponse.py +25 -0
  96. mixpeek/models/listtasksresponse.py +3 -6
  97. mixpeek/models/{logicaloperator.py → logicaloperator_input.py} +42 -24
  98. mixpeek/models/logicaloperator_output.py +121 -0
  99. mixpeek/models/multivectorindex.py +25 -0
  100. mixpeek/models/namespaceresponse.py +1 -1
  101. mixpeek/models/namespaceusage.py +45 -0
  102. mixpeek/models/namingmethod.py +8 -0
  103. mixpeek/models/objectresponse.py +124 -0
  104. mixpeek/models/{db_model_paginationresponse.py → paginationresponse.py} +3 -3
  105. mixpeek/models/payloadindexconfig.py +1 -1
  106. mixpeek/models/plan.py +82 -0
  107. mixpeek/models/recomputestrategy.py +12 -0
  108. mixpeek/models/resourcetotals.py +39 -0
  109. mixpeek/models/{jsonvideooutputsettings.py → retrieverbinding.py} +19 -11
  110. mixpeek/models/{logodetectsettings.py → retrievercacheconfig.py} +20 -11
  111. mixpeek/models/retrievermodel.py +95 -0
  112. mixpeek/models/retrieverqueryrequest.py +114 -0
  113. mixpeek/models/retrieverresponse.py +24 -0
  114. mixpeek/models/searchinteraction.py +81 -0
  115. mixpeek/models/singlelineageentry.py +99 -0
  116. mixpeek/models/sortdirection.py +11 -0
  117. mixpeek/models/sortoption.py +20 -12
  118. mixpeek/models/sourceconfig_input.py +72 -0
  119. mixpeek/models/sourceconfig_output.py +75 -0
  120. mixpeek/models/sourcetype.py +11 -0
  121. mixpeek/models/stageconfig_input.py +111 -0
  122. mixpeek/models/stageconfig_output.py +114 -0
  123. mixpeek/models/stagedefinition.py +110 -0
  124. mixpeek/models/{jsonimageoutputsettings.py → stageresponse.py} +21 -11
  125. mixpeek/models/taskresponse.py +1 -1
  126. mixpeek/models/taskstatus.py +1 -0
  127. mixpeek/models/{assetfeatures.py → taxonomyapplicationconfig.py} +23 -15
  128. mixpeek/models/taxonomyconfig.py +19 -0
  129. mixpeek/models/timeseriesdatapoint.py +25 -0
  130. mixpeek/models/timeseriesusage.py +36 -0
  131. mixpeek/models/{full_asset_update_v1_assets_asset_id_putop.py → update_bucket_v1_buckets_bucket_identifier_putop.py} +9 -9
  132. mixpeek/models/{update_taxonomy_v1_entities_taxonomies_taxonomy_patchop.py → update_document_v1_collections_collection_identifier_documents_document_id_putop.py} +25 -13
  133. mixpeek/models/{full_feature_update_v1_features_feature_id_putop.py → update_object_v1_buckets_bucket_identifier_objects_object_identifier_putop.py} +20 -9
  134. mixpeek/models/updatenamespacerequest.py +1 -1
  135. mixpeek/models/updateobjectrequest.py +75 -0
  136. mixpeek/models/usageresponse.py +86 -0
  137. mixpeek/models/usagesummary.py +39 -0
  138. mixpeek/models/usagetimerange.py +16 -0
  139. mixpeek/models/usermodel_input.py +3 -0
  140. mixpeek/models/usermodel_output.py +3 -0
  141. mixpeek/models/vectorbasedconfig.py +60 -0
  142. mixpeek/models/{collectionresult.py → vectorindex.py} +20 -15
  143. mixpeek/models/vectorindexdefinition.py +43 -0
  144. mixpeek/models/vectortype.py +4 -1
  145. mixpeek/namespaces.py +26 -480
  146. mixpeek/organizationnotifications.py +214 -0
  147. mixpeek/organizations.py +6 -210
  148. mixpeek/{featureextractors.py → organizationsusage.py} +31 -39
  149. mixpeek/research.py +228 -0
  150. mixpeek/retrieverinteractions.py +1036 -0
  151. mixpeek/{ingestassets.py → retrievers.py} +209 -271
  152. mixpeek/retrieverstages.py +232 -0
  153. mixpeek/sdk.py +40 -23
  154. mixpeek/taxonomies.py +43 -513
  155. mixpeek/types/basemodel.py +3 -3
  156. mixpeek/utils/enums.py +67 -27
  157. {mixpeek-0.20.20.dist-info → mixpeek-0.21.6.dist-info}/METADATA +68 -50
  158. mixpeek-0.21.6.dist-info/RECORD +216 -0
  159. {mixpeek-0.20.20.dist-info → mixpeek-0.21.6.dist-info}/WHEEL +1 -1
  160. mixpeek/models/actionusage.py +0 -16
  161. mixpeek/models/assetresponse.py +0 -166
  162. mixpeek/models/assets_model_searchquery.py +0 -21
  163. mixpeek/models/assetupdate.py +0 -28
  164. mixpeek/models/assignmentconfig.py +0 -67
  165. mixpeek/models/assignmentmode.py +0 -11
  166. mixpeek/models/availablemodels.py +0 -16
  167. mixpeek/models/availablemodelsresponse.py +0 -27
  168. mixpeek/models/classificationmatch.py +0 -77
  169. mixpeek/models/classificationwithfeature.py +0 -73
  170. mixpeek/models/collectiondetailsresponse.py +0 -83
  171. mixpeek/models/dateusage.py +0 -22
  172. mixpeek/models/denseembedding.py +0 -16
  173. mixpeek/models/discoverrequest.py +0 -64
  174. mixpeek/models/embeddingconfig.py +0 -33
  175. mixpeek/models/embeddingrequest.py +0 -92
  176. mixpeek/models/embeddingresponse.py +0 -64
  177. mixpeek/models/entitysettings.py +0 -50
  178. mixpeek/models/featureoptions.py +0 -25
  179. mixpeek/models/features_model_paginationresponse.py +0 -59
  180. mixpeek/models/featureupdaterequest.py +0 -21
  181. mixpeek/models/get_asset_v1_assets_asset_id_getop.py +0 -73
  182. mixpeek/models/get_asset_with_features_v1_assets_asset_id_features_getop.py +0 -73
  183. mixpeek/models/get_collection_details_v1_collections_collection_details_getop.py +0 -59
  184. mixpeek/models/get_collection_details_v1_collections_collection_getop.py +0 -59
  185. mixpeek/models/get_feature_v1_features_feature_id_getop.py +0 -70
  186. mixpeek/models/get_taxonomy_node_v1_entities_taxonomies_nodes_node_getop.py +0 -59
  187. mixpeek/models/groupedassetdata.py +0 -18
  188. mixpeek/models/imagedescribesettings.py +0 -82
  189. mixpeek/models/imagedetectsettings.py +0 -47
  190. mixpeek/models/imagereadsettings.py +0 -71
  191. mixpeek/models/imagesettings.py +0 -92
  192. mixpeek/models/listassetsrequest.py +0 -75
  193. mixpeek/models/listassetsresponse.py +0 -22
  194. mixpeek/models/listclassificationsrequest.py +0 -69
  195. mixpeek/models/listclassificationsresponse.py +0 -31
  196. mixpeek/models/listcollectionsresponse.py +0 -22
  197. mixpeek/models/listfeaturesrequest.py +0 -77
  198. mixpeek/models/listfeaturesresponse.py +0 -22
  199. mixpeek/models/listtaxonomiesresponse.py +0 -24
  200. mixpeek/models/modality.py +0 -13
  201. mixpeek/models/modeldetails.py +0 -61
  202. mixpeek/models/nodeoptions.py +0 -16
  203. mixpeek/models/patch_namespace_v1_namespaces_namespace_patchop.py +0 -28
  204. mixpeek/models/payloadindextype.py +0 -17
  205. mixpeek/models/processimageurlinput.py +0 -87
  206. mixpeek/models/processtextinput.py +0 -82
  207. mixpeek/models/processvideourlinput.py +0 -87
  208. mixpeek/models/querysettings.py +0 -56
  209. mixpeek/models/rerankingoptions.py +0 -47
  210. mixpeek/models/search_model_searchquery.py +0 -76
  211. mixpeek/models/searchassetsrequest.py +0 -78
  212. mixpeek/models/searchrequestfeatures.py +0 -153
  213. mixpeek/models/sparseembedding.py +0 -21
  214. mixpeek/models/taxonomycreate.py +0 -20
  215. mixpeek/models/taxonomyextractionconfig.py +0 -26
  216. mixpeek/models/taxonomymodel.py +0 -27
  217. mixpeek/models/taxonomynode.py +0 -101
  218. mixpeek/models/taxonomynodecreate.py +0 -63
  219. mixpeek/models/textsettings.py +0 -67
  220. mixpeek/models/updateassetrequest.py +0 -60
  221. mixpeek/models/usage.py +0 -18
  222. mixpeek/models/vectormodel.py +0 -15
  223. mixpeek/models/videodescribesettings.py +0 -82
  224. mixpeek/models/videodetectsettings.py +0 -47
  225. mixpeek/models/videoreadsettings.py +0 -71
  226. mixpeek/models/videosettings.py +0 -115
  227. mixpeek/models/videotranscriptionsettings.py +0 -69
  228. mixpeek-0.20.20.dist-info/RECORD +0 -201
mixpeek/collections.py CHANGED
@@ -5,251 +5,43 @@ 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, List, Mapping, Optional, Union
9
9
 
10
10
 
11
11
  class Collections(BaseSDK):
12
- def list(
13
- self,
14
- *,
15
- page: OptionalNullable[int] = UNSET,
16
- page_size: Optional[int] = 10,
17
- x_namespace: OptionalNullable[str] = UNSET,
18
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
19
- server_url: Optional[str] = None,
20
- timeout_ms: Optional[int] = None,
21
- http_headers: Optional[Mapping[str, str]] = None,
22
- ) -> models.ListCollectionsResponse:
23
- r"""List Collections
24
-
25
- :param page:
26
- :param page_size:
27
- :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.
28
- :param retries: Override the default retry configuration for this method
29
- :param server_url: Override the default server URL for this method
30
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
31
- :param http_headers: Additional headers to set or replace on requests.
32
- """
33
- base_url = None
34
- url_variables = None
35
- if timeout_ms is None:
36
- timeout_ms = self.sdk_configuration.timeout_ms
37
-
38
- if server_url is not None:
39
- base_url = server_url
40
- else:
41
- base_url = self._get_url(base_url, url_variables)
42
-
43
- request = models.ListCollectionsV1CollectionsGetRequest(
44
- page=page,
45
- page_size=page_size,
46
- x_namespace=x_namespace,
47
- )
48
-
49
- req = self._build_request(
50
- method="GET",
51
- path="/v1/collections",
52
- base_url=base_url,
53
- url_variables=url_variables,
54
- request=request,
55
- request_body_required=False,
56
- request_has_path_params=False,
57
- request_has_query_params=True,
58
- user_agent_header="user-agent",
59
- accept_header_value="application/json",
60
- http_headers=http_headers,
61
- security=self.sdk_configuration.security,
62
- timeout_ms=timeout_ms,
63
- )
64
-
65
- if retries == UNSET:
66
- if self.sdk_configuration.retry_config is not UNSET:
67
- retries = self.sdk_configuration.retry_config
68
-
69
- retry_config = None
70
- if isinstance(retries, utils.RetryConfig):
71
- retry_config = (retries, ["429", "500", "502", "503", "504"])
72
-
73
- http_res = self.do_request(
74
- hook_ctx=HookContext(
75
- base_url=base_url or "",
76
- operation_id="list_collections_v1_collections_get",
77
- oauth2_scopes=[],
78
- security_source=get_security_from_env(
79
- self.sdk_configuration.security, models.Security
80
- ),
81
- ),
82
- request=req,
83
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
84
- retry_config=retry_config,
85
- )
86
-
87
- response_data: Any = None
88
- if utils.match_response(http_res, "200", "application/json"):
89
- return utils.unmarshal_json(http_res.text, models.ListCollectionsResponse)
90
- if utils.match_response(
91
- http_res, ["400", "401", "403", "404"], "application/json"
92
- ):
93
- response_data = utils.unmarshal_json(
94
- http_res.text, models.ErrorResponseData
95
- )
96
- raise models.ErrorResponse(data=response_data)
97
- if utils.match_response(http_res, "422", "application/json"):
98
- response_data = utils.unmarshal_json(
99
- http_res.text, models.HTTPValidationErrorData
100
- )
101
- raise models.HTTPValidationError(data=response_data)
102
- if utils.match_response(http_res, "500", "application/json"):
103
- response_data = utils.unmarshal_json(
104
- http_res.text, models.ErrorResponseData
105
- )
106
- raise models.ErrorResponse(data=response_data)
107
- if utils.match_response(http_res, "4XX", "*"):
108
- http_res_text = utils.stream_to_text(http_res)
109
- raise models.APIError(
110
- "API error occurred", http_res.status_code, http_res_text, http_res
111
- )
112
- if utils.match_response(http_res, "5XX", "*"):
113
- http_res_text = utils.stream_to_text(http_res)
114
- raise models.APIError(
115
- "API error occurred", http_res.status_code, http_res_text, http_res
116
- )
117
-
118
- content_type = http_res.headers.get("Content-Type")
119
- http_res_text = utils.stream_to_text(http_res)
120
- raise models.APIError(
121
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
122
- http_res.status_code,
123
- http_res_text,
124
- http_res,
125
- )
126
-
127
- async def list_async(
128
- self,
129
- *,
130
- page: OptionalNullable[int] = UNSET,
131
- page_size: Optional[int] = 10,
132
- x_namespace: OptionalNullable[str] = UNSET,
133
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
134
- server_url: Optional[str] = None,
135
- timeout_ms: Optional[int] = None,
136
- http_headers: Optional[Mapping[str, str]] = None,
137
- ) -> models.ListCollectionsResponse:
138
- r"""List Collections
139
-
140
- :param page:
141
- :param page_size:
142
- :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.
143
- :param retries: Override the default retry configuration for this method
144
- :param server_url: Override the default server URL for this method
145
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
146
- :param http_headers: Additional headers to set or replace on requests.
147
- """
148
- base_url = None
149
- url_variables = None
150
- if timeout_ms is None:
151
- timeout_ms = self.sdk_configuration.timeout_ms
152
-
153
- if server_url is not None:
154
- base_url = server_url
155
- else:
156
- base_url = self._get_url(base_url, url_variables)
157
-
158
- request = models.ListCollectionsV1CollectionsGetRequest(
159
- page=page,
160
- page_size=page_size,
161
- x_namespace=x_namespace,
162
- )
163
-
164
- req = self._build_request_async(
165
- method="GET",
166
- path="/v1/collections",
167
- base_url=base_url,
168
- url_variables=url_variables,
169
- request=request,
170
- request_body_required=False,
171
- request_has_path_params=False,
172
- request_has_query_params=True,
173
- user_agent_header="user-agent",
174
- accept_header_value="application/json",
175
- http_headers=http_headers,
176
- security=self.sdk_configuration.security,
177
- timeout_ms=timeout_ms,
178
- )
179
-
180
- if retries == UNSET:
181
- if self.sdk_configuration.retry_config is not UNSET:
182
- retries = self.sdk_configuration.retry_config
183
-
184
- retry_config = None
185
- if isinstance(retries, utils.RetryConfig):
186
- retry_config = (retries, ["429", "500", "502", "503", "504"])
187
-
188
- http_res = await self.do_request_async(
189
- hook_ctx=HookContext(
190
- base_url=base_url or "",
191
- operation_id="list_collections_v1_collections_get",
192
- oauth2_scopes=[],
193
- security_source=get_security_from_env(
194
- self.sdk_configuration.security, models.Security
195
- ),
196
- ),
197
- request=req,
198
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
199
- retry_config=retry_config,
200
- )
201
-
202
- response_data: Any = None
203
- if utils.match_response(http_res, "200", "application/json"):
204
- return utils.unmarshal_json(http_res.text, models.ListCollectionsResponse)
205
- if utils.match_response(
206
- http_res, ["400", "401", "403", "404"], "application/json"
207
- ):
208
- response_data = utils.unmarshal_json(
209
- http_res.text, models.ErrorResponseData
210
- )
211
- raise models.ErrorResponse(data=response_data)
212
- if utils.match_response(http_res, "422", "application/json"):
213
- response_data = utils.unmarshal_json(
214
- http_res.text, models.HTTPValidationErrorData
215
- )
216
- raise models.HTTPValidationError(data=response_data)
217
- if utils.match_response(http_res, "500", "application/json"):
218
- response_data = utils.unmarshal_json(
219
- http_res.text, models.ErrorResponseData
220
- )
221
- raise models.ErrorResponse(data=response_data)
222
- if utils.match_response(http_res, "4XX", "*"):
223
- http_res_text = await utils.stream_to_text_async(http_res)
224
- raise models.APIError(
225
- "API error occurred", http_res.status_code, http_res_text, http_res
226
- )
227
- if utils.match_response(http_res, "5XX", "*"):
228
- http_res_text = await utils.stream_to_text_async(http_res)
229
- raise models.APIError(
230
- "API error occurred", http_res.status_code, http_res_text, http_res
231
- )
232
-
233
- content_type = http_res.headers.get("Content-Type")
234
- http_res_text = await utils.stream_to_text_async(http_res)
235
- raise models.APIError(
236
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
237
- http_res.status_code,
238
- http_res_text,
239
- http_res,
240
- )
241
-
242
12
  def create(
243
13
  self,
244
14
  *,
245
15
  collection_name: str,
16
+ source: Union[models.SourceConfigInput, models.SourceConfigInputTypedDict],
17
+ feature_extractors: Union[
18
+ List[models.FeatureExtractorConfig],
19
+ List[models.FeatureExtractorConfigTypedDict],
20
+ ],
246
21
  x_namespace: OptionalNullable[str] = UNSET,
22
+ description: OptionalNullable[str] = UNSET,
23
+ taxonomy_applications: Optional[
24
+ Union[
25
+ List[models.TaxonomyApplicationConfig],
26
+ List[models.TaxonomyApplicationConfigTypedDict],
27
+ ]
28
+ ] = None,
29
+ enabled: Optional[bool] = True,
247
30
  metadata: OptionalNullable[
248
31
  Union[
249
32
  models.CreateCollectionRequestMetadata,
250
33
  models.CreateCollectionRequestMetadataTypedDict,
251
34
  ]
252
35
  ] = UNSET,
36
+ document_handling: OptionalNullable[
37
+ Union[models.DocumentHandlingConfig, models.DocumentHandlingConfigTypedDict]
38
+ ] = UNSET,
39
+ cache_config: OptionalNullable[
40
+ Union[
41
+ models.CollectionCacheConfigInput,
42
+ models.CollectionCacheConfigInputTypedDict,
43
+ ]
44
+ ] = UNSET,
253
45
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
254
46
  server_url: Optional[str] = None,
255
47
  timeout_ms: Optional[int] = None,
@@ -257,12 +49,18 @@ class Collections(BaseSDK):
257
49
  ) -> models.CollectionModel:
258
50
  r"""Create Collection
259
51
 
260
- **Requirements:**
261
- - Required permissions: write
52
+ This endpoint allows you to create a new collection.
262
53
 
263
54
  :param collection_name: Name for the collection
55
+ :param source: Configuration for a collection source
56
+ :param feature_extractors: List of feature extractor configurations to use
264
57
  :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.
58
+ :param description: Description for the collection
59
+ :param taxonomy_applications: List of taxonomy application configurations. there are two options: on ingestion store the taxonomy application results to this collection, or on demand compute the taxonomy application results at query time
60
+ :param enabled: Enable or disable processing of this collection
265
61
  :param metadata: Optional metadata for the collection
62
+ :param document_handling: Configuration for how documents are handled by this extractor
63
+ :param cache_config: Configuration for collection-level caching
266
64
  :param retries: Override the default retry configuration for this method
267
65
  :param server_url: Override the default server URL for this method
268
66
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -278,19 +76,35 @@ class Collections(BaseSDK):
278
76
  else:
279
77
  base_url = self._get_url(base_url, url_variables)
280
78
 
281
- request = models.CreateCollectionV1CollectionsPostRequest(
79
+ request = models.CreateCollectionV1CollectionsCreatePostRequest(
282
80
  x_namespace=x_namespace,
283
81
  create_collection_request=models.CreateCollectionRequest(
284
82
  collection_name=collection_name,
83
+ description=description,
84
+ source=utils.get_pydantic_model(source, models.SourceConfigInput),
85
+ feature_extractors=utils.get_pydantic_model(
86
+ feature_extractors, List[models.FeatureExtractorConfig]
87
+ ),
88
+ taxonomy_applications=utils.get_pydantic_model(
89
+ taxonomy_applications,
90
+ Optional[List[models.TaxonomyApplicationConfig]],
91
+ ),
92
+ enabled=enabled,
285
93
  metadata=utils.get_pydantic_model(
286
94
  metadata, OptionalNullable[models.CreateCollectionRequestMetadata]
287
95
  ),
96
+ document_handling=utils.get_pydantic_model(
97
+ document_handling, OptionalNullable[models.DocumentHandlingConfig]
98
+ ),
99
+ cache_config=utils.get_pydantic_model(
100
+ cache_config, OptionalNullable[models.CollectionCacheConfigInput]
101
+ ),
288
102
  ),
289
103
  )
290
104
 
291
105
  req = self._build_request(
292
106
  method="POST",
293
- path="/v1/collections",
107
+ path="/v1/collections/create",
294
108
  base_url=base_url,
295
109
  url_variables=url_variables,
296
110
  request=request,
@@ -322,7 +136,7 @@ class Collections(BaseSDK):
322
136
  http_res = self.do_request(
323
137
  hook_ctx=HookContext(
324
138
  base_url=base_url or "",
325
- operation_id="create_collection_v1_collections_post",
139
+ operation_id="create_collection_v1_collections_create_post",
326
140
  oauth2_scopes=[],
327
141
  security_source=get_security_from_env(
328
142
  self.sdk_configuration.security, models.Security
@@ -377,13 +191,35 @@ class Collections(BaseSDK):
377
191
  self,
378
192
  *,
379
193
  collection_name: str,
194
+ source: Union[models.SourceConfigInput, models.SourceConfigInputTypedDict],
195
+ feature_extractors: Union[
196
+ List[models.FeatureExtractorConfig],
197
+ List[models.FeatureExtractorConfigTypedDict],
198
+ ],
380
199
  x_namespace: OptionalNullable[str] = UNSET,
200
+ description: OptionalNullable[str] = UNSET,
201
+ taxonomy_applications: Optional[
202
+ Union[
203
+ List[models.TaxonomyApplicationConfig],
204
+ List[models.TaxonomyApplicationConfigTypedDict],
205
+ ]
206
+ ] = None,
207
+ enabled: Optional[bool] = True,
381
208
  metadata: OptionalNullable[
382
209
  Union[
383
210
  models.CreateCollectionRequestMetadata,
384
211
  models.CreateCollectionRequestMetadataTypedDict,
385
212
  ]
386
213
  ] = UNSET,
214
+ document_handling: OptionalNullable[
215
+ Union[models.DocumentHandlingConfig, models.DocumentHandlingConfigTypedDict]
216
+ ] = UNSET,
217
+ cache_config: OptionalNullable[
218
+ Union[
219
+ models.CollectionCacheConfigInput,
220
+ models.CollectionCacheConfigInputTypedDict,
221
+ ]
222
+ ] = UNSET,
387
223
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
388
224
  server_url: Optional[str] = None,
389
225
  timeout_ms: Optional[int] = None,
@@ -391,12 +227,18 @@ class Collections(BaseSDK):
391
227
  ) -> models.CollectionModel:
392
228
  r"""Create Collection
393
229
 
394
- **Requirements:**
395
- - Required permissions: write
230
+ This endpoint allows you to create a new collection.
396
231
 
397
232
  :param collection_name: Name for the collection
233
+ :param source: Configuration for a collection source
234
+ :param feature_extractors: List of feature extractor configurations to use
398
235
  :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.
236
+ :param description: Description for the collection
237
+ :param taxonomy_applications: List of taxonomy application configurations. there are two options: on ingestion store the taxonomy application results to this collection, or on demand compute the taxonomy application results at query time
238
+ :param enabled: Enable or disable processing of this collection
399
239
  :param metadata: Optional metadata for the collection
240
+ :param document_handling: Configuration for how documents are handled by this extractor
241
+ :param cache_config: Configuration for collection-level caching
400
242
  :param retries: Override the default retry configuration for this method
401
243
  :param server_url: Override the default server URL for this method
402
244
  :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
@@ -412,19 +254,35 @@ class Collections(BaseSDK):
412
254
  else:
413
255
  base_url = self._get_url(base_url, url_variables)
414
256
 
415
- request = models.CreateCollectionV1CollectionsPostRequest(
257
+ request = models.CreateCollectionV1CollectionsCreatePostRequest(
416
258
  x_namespace=x_namespace,
417
259
  create_collection_request=models.CreateCollectionRequest(
418
260
  collection_name=collection_name,
261
+ description=description,
262
+ source=utils.get_pydantic_model(source, models.SourceConfigInput),
263
+ feature_extractors=utils.get_pydantic_model(
264
+ feature_extractors, List[models.FeatureExtractorConfig]
265
+ ),
266
+ taxonomy_applications=utils.get_pydantic_model(
267
+ taxonomy_applications,
268
+ Optional[List[models.TaxonomyApplicationConfig]],
269
+ ),
270
+ enabled=enabled,
419
271
  metadata=utils.get_pydantic_model(
420
272
  metadata, OptionalNullable[models.CreateCollectionRequestMetadata]
421
273
  ),
274
+ document_handling=utils.get_pydantic_model(
275
+ document_handling, OptionalNullable[models.DocumentHandlingConfig]
276
+ ),
277
+ cache_config=utils.get_pydantic_model(
278
+ cache_config, OptionalNullable[models.CollectionCacheConfigInput]
279
+ ),
422
280
  ),
423
281
  )
424
282
 
425
283
  req = self._build_request_async(
426
284
  method="POST",
427
- path="/v1/collections",
285
+ path="/v1/collections/create",
428
286
  base_url=base_url,
429
287
  url_variables=url_variables,
430
288
  request=request,
@@ -456,7 +314,7 @@ class Collections(BaseSDK):
456
314
  http_res = await self.do_request_async(
457
315
  hook_ctx=HookContext(
458
316
  base_url=base_url or "",
459
- operation_id="create_collection_v1_collections_post",
317
+ operation_id="create_collection_v1_collections_create_post",
460
318
  oauth2_scopes=[],
461
319
  security_source=get_security_from_env(
462
320
  self.sdk_configuration.security, models.Security
@@ -507,21 +365,19 @@ class Collections(BaseSDK):
507
365
  http_res,
508
366
  )
509
367
 
510
- def delete(
368
+ def get(
511
369
  self,
512
370
  *,
513
- collection: str,
371
+ collection_id: str,
514
372
  x_namespace: OptionalNullable[str] = UNSET,
515
373
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
516
374
  server_url: Optional[str] = None,
517
375
  timeout_ms: Optional[int] = None,
518
376
  http_headers: Optional[Mapping[str, str]] = None,
519
- ) -> models.TaskResponse:
520
- r"""Delete Collection
521
-
522
- Delete a collection using either its name or ID
377
+ ) -> models.CollectionModel:
378
+ r"""Get Collection
523
379
 
524
- :param collection: Either the collection name or collection ID
380
+ :param collection_id: The ID of the collection to retrieve
525
381
  :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.
526
382
  :param retries: Override the default retry configuration for this method
527
383
  :param server_url: Override the default server URL for this method
@@ -538,14 +394,14 @@ class Collections(BaseSDK):
538
394
  else:
539
395
  base_url = self._get_url(base_url, url_variables)
540
396
 
541
- request = models.DeleteCollectionV1CollectionsCollectionDeleteRequest(
542
- collection=collection,
397
+ request = models.GetCollectionV1CollectionsCollectionIDGetRequest(
398
+ collection_id=collection_id,
543
399
  x_namespace=x_namespace,
544
400
  )
545
401
 
546
402
  req = self._build_request(
547
- method="DELETE",
548
- path="/v1/collections/{collection}",
403
+ method="GET",
404
+ path="/v1/collections/{collection_id}",
549
405
  base_url=base_url,
550
406
  url_variables=url_variables,
551
407
  request=request,
@@ -570,7 +426,7 @@ class Collections(BaseSDK):
570
426
  http_res = self.do_request(
571
427
  hook_ctx=HookContext(
572
428
  base_url=base_url or "",
573
- operation_id="delete_collection_v1_collections__collection__delete",
429
+ operation_id="get_collection_v1_collections__collection_id__get",
574
430
  oauth2_scopes=[],
575
431
  security_source=get_security_from_env(
576
432
  self.sdk_configuration.security, models.Security
@@ -583,7 +439,7 @@ class Collections(BaseSDK):
583
439
 
584
440
  response_data: Any = None
585
441
  if utils.match_response(http_res, "200", "application/json"):
586
- return utils.unmarshal_json(http_res.text, models.TaskResponse)
442
+ return utils.unmarshal_json(http_res.text, models.CollectionModel)
587
443
  if utils.match_response(
588
444
  http_res, ["400", "401", "403", "404"], "application/json"
589
445
  ):
@@ -621,21 +477,19 @@ class Collections(BaseSDK):
621
477
  http_res,
622
478
  )
623
479
 
624
- async def delete_async(
480
+ async def get_async(
625
481
  self,
626
482
  *,
627
- collection: str,
483
+ collection_id: str,
628
484
  x_namespace: OptionalNullable[str] = UNSET,
629
485
  retries: OptionalNullable[utils.RetryConfig] = UNSET,
630
486
  server_url: Optional[str] = None,
631
487
  timeout_ms: Optional[int] = None,
632
488
  http_headers: Optional[Mapping[str, str]] = None,
633
- ) -> models.TaskResponse:
634
- r"""Delete Collection
635
-
636
- Delete a collection using either its name or ID
489
+ ) -> models.CollectionModel:
490
+ r"""Get Collection
637
491
 
638
- :param collection: Either the collection name or collection ID
492
+ :param collection_id: The ID of the collection to retrieve
639
493
  :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.
640
494
  :param retries: Override the default retry configuration for this method
641
495
  :param server_url: Override the default server URL for this method
@@ -652,14 +506,14 @@ class Collections(BaseSDK):
652
506
  else:
653
507
  base_url = self._get_url(base_url, url_variables)
654
508
 
655
- request = models.DeleteCollectionV1CollectionsCollectionDeleteRequest(
656
- collection=collection,
509
+ request = models.GetCollectionV1CollectionsCollectionIDGetRequest(
510
+ collection_id=collection_id,
657
511
  x_namespace=x_namespace,
658
512
  )
659
513
 
660
514
  req = self._build_request_async(
661
- method="DELETE",
662
- path="/v1/collections/{collection}",
515
+ method="GET",
516
+ path="/v1/collections/{collection_id}",
663
517
  base_url=base_url,
664
518
  url_variables=url_variables,
665
519
  request=request,
@@ -684,279 +538,7 @@ class Collections(BaseSDK):
684
538
  http_res = await self.do_request_async(
685
539
  hook_ctx=HookContext(
686
540
  base_url=base_url or "",
687
- operation_id="delete_collection_v1_collections__collection__delete",
688
- oauth2_scopes=[],
689
- security_source=get_security_from_env(
690
- self.sdk_configuration.security, models.Security
691
- ),
692
- ),
693
- request=req,
694
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
695
- retry_config=retry_config,
696
- )
697
-
698
- response_data: Any = None
699
- if utils.match_response(http_res, "200", "application/json"):
700
- return utils.unmarshal_json(http_res.text, models.TaskResponse)
701
- if utils.match_response(
702
- http_res, ["400", "401", "403", "404"], "application/json"
703
- ):
704
- response_data = utils.unmarshal_json(
705
- http_res.text, models.ErrorResponseData
706
- )
707
- raise models.ErrorResponse(data=response_data)
708
- if utils.match_response(http_res, "422", "application/json"):
709
- response_data = utils.unmarshal_json(
710
- http_res.text, models.HTTPValidationErrorData
711
- )
712
- raise models.HTTPValidationError(data=response_data)
713
- if utils.match_response(http_res, "500", "application/json"):
714
- response_data = utils.unmarshal_json(
715
- http_res.text, models.ErrorResponseData
716
- )
717
- raise models.ErrorResponse(data=response_data)
718
- if utils.match_response(http_res, "4XX", "*"):
719
- http_res_text = await utils.stream_to_text_async(http_res)
720
- raise models.APIError(
721
- "API error occurred", http_res.status_code, http_res_text, http_res
722
- )
723
- if utils.match_response(http_res, "5XX", "*"):
724
- http_res_text = await utils.stream_to_text_async(http_res)
725
- raise models.APIError(
726
- "API error occurred", http_res.status_code, http_res_text, http_res
727
- )
728
-
729
- content_type = http_res.headers.get("Content-Type")
730
- http_res_text = await utils.stream_to_text_async(http_res)
731
- raise models.APIError(
732
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
733
- http_res.status_code,
734
- http_res_text,
735
- http_res,
736
- )
737
-
738
- def update(
739
- self,
740
- *,
741
- collection: str,
742
- collection_name: str,
743
- x_namespace: OptionalNullable[str] = UNSET,
744
- metadata: OptionalNullable[
745
- Union[
746
- models.CreateCollectionRequestMetadata,
747
- models.CreateCollectionRequestMetadataTypedDict,
748
- ]
749
- ] = UNSET,
750
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
751
- server_url: Optional[str] = None,
752
- timeout_ms: Optional[int] = None,
753
- http_headers: Optional[Mapping[str, str]] = None,
754
- ) -> models.CollectionModel:
755
- r"""Update Collection
756
-
757
- Update a collection using either its name or ID
758
-
759
- :param collection: Either the collection name or collection ID
760
- :param collection_name: Name for the collection
761
- :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.
762
- :param metadata: Optional metadata for the collection
763
- :param retries: Override the default retry configuration for this method
764
- :param server_url: Override the default server URL for this method
765
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
766
- :param http_headers: Additional headers to set or replace on requests.
767
- """
768
- base_url = None
769
- url_variables = None
770
- if timeout_ms is None:
771
- timeout_ms = self.sdk_configuration.timeout_ms
772
-
773
- if server_url is not None:
774
- base_url = server_url
775
- else:
776
- base_url = self._get_url(base_url, url_variables)
777
-
778
- request = models.UpdateCollectionV1CollectionsCollectionPutRequest(
779
- collection=collection,
780
- x_namespace=x_namespace,
781
- create_collection_request=models.CreateCollectionRequest(
782
- collection_name=collection_name,
783
- metadata=utils.get_pydantic_model(
784
- metadata, OptionalNullable[models.CreateCollectionRequestMetadata]
785
- ),
786
- ),
787
- )
788
-
789
- req = self._build_request(
790
- method="PUT",
791
- path="/v1/collections/{collection}",
792
- base_url=base_url,
793
- url_variables=url_variables,
794
- request=request,
795
- request_body_required=True,
796
- request_has_path_params=True,
797
- request_has_query_params=True,
798
- user_agent_header="user-agent",
799
- accept_header_value="application/json",
800
- http_headers=http_headers,
801
- security=self.sdk_configuration.security,
802
- get_serialized_body=lambda: utils.serialize_request_body(
803
- request.create_collection_request,
804
- False,
805
- False,
806
- "json",
807
- models.CreateCollectionRequest,
808
- ),
809
- timeout_ms=timeout_ms,
810
- )
811
-
812
- if retries == UNSET:
813
- if self.sdk_configuration.retry_config is not UNSET:
814
- retries = self.sdk_configuration.retry_config
815
-
816
- retry_config = None
817
- if isinstance(retries, utils.RetryConfig):
818
- retry_config = (retries, ["429", "500", "502", "503", "504"])
819
-
820
- http_res = self.do_request(
821
- hook_ctx=HookContext(
822
- base_url=base_url or "",
823
- operation_id="update_collection_v1_collections__collection__put",
824
- oauth2_scopes=[],
825
- security_source=get_security_from_env(
826
- self.sdk_configuration.security, models.Security
827
- ),
828
- ),
829
- request=req,
830
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
831
- retry_config=retry_config,
832
- )
833
-
834
- response_data: Any = None
835
- if utils.match_response(http_res, "200", "application/json"):
836
- return utils.unmarshal_json(http_res.text, models.CollectionModel)
837
- if utils.match_response(
838
- http_res, ["400", "401", "403", "404"], "application/json"
839
- ):
840
- response_data = utils.unmarshal_json(
841
- http_res.text, models.ErrorResponseData
842
- )
843
- raise models.ErrorResponse(data=response_data)
844
- if utils.match_response(http_res, "422", "application/json"):
845
- response_data = utils.unmarshal_json(
846
- http_res.text, models.HTTPValidationErrorData
847
- )
848
- raise models.HTTPValidationError(data=response_data)
849
- if utils.match_response(http_res, "500", "application/json"):
850
- response_data = utils.unmarshal_json(
851
- http_res.text, models.ErrorResponseData
852
- )
853
- raise models.ErrorResponse(data=response_data)
854
- if utils.match_response(http_res, "4XX", "*"):
855
- http_res_text = utils.stream_to_text(http_res)
856
- raise models.APIError(
857
- "API error occurred", http_res.status_code, http_res_text, http_res
858
- )
859
- if utils.match_response(http_res, "5XX", "*"):
860
- http_res_text = utils.stream_to_text(http_res)
861
- raise models.APIError(
862
- "API error occurred", http_res.status_code, http_res_text, http_res
863
- )
864
-
865
- content_type = http_res.headers.get("Content-Type")
866
- http_res_text = utils.stream_to_text(http_res)
867
- raise models.APIError(
868
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
869
- http_res.status_code,
870
- http_res_text,
871
- http_res,
872
- )
873
-
874
- async def update_async(
875
- self,
876
- *,
877
- collection: str,
878
- collection_name: str,
879
- x_namespace: OptionalNullable[str] = UNSET,
880
- metadata: OptionalNullable[
881
- Union[
882
- models.CreateCollectionRequestMetadata,
883
- models.CreateCollectionRequestMetadataTypedDict,
884
- ]
885
- ] = UNSET,
886
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
887
- server_url: Optional[str] = None,
888
- timeout_ms: Optional[int] = None,
889
- http_headers: Optional[Mapping[str, str]] = None,
890
- ) -> models.CollectionModel:
891
- r"""Update Collection
892
-
893
- Update a collection using either its name or ID
894
-
895
- :param collection: Either the collection name or collection ID
896
- :param collection_name: Name for the collection
897
- :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.
898
- :param metadata: Optional metadata for the collection
899
- :param retries: Override the default retry configuration for this method
900
- :param server_url: Override the default server URL for this method
901
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
902
- :param http_headers: Additional headers to set or replace on requests.
903
- """
904
- base_url = None
905
- url_variables = None
906
- if timeout_ms is None:
907
- timeout_ms = self.sdk_configuration.timeout_ms
908
-
909
- if server_url is not None:
910
- base_url = server_url
911
- else:
912
- base_url = self._get_url(base_url, url_variables)
913
-
914
- request = models.UpdateCollectionV1CollectionsCollectionPutRequest(
915
- collection=collection,
916
- x_namespace=x_namespace,
917
- create_collection_request=models.CreateCollectionRequest(
918
- collection_name=collection_name,
919
- metadata=utils.get_pydantic_model(
920
- metadata, OptionalNullable[models.CreateCollectionRequestMetadata]
921
- ),
922
- ),
923
- )
924
-
925
- req = self._build_request_async(
926
- method="PUT",
927
- path="/v1/collections/{collection}",
928
- base_url=base_url,
929
- url_variables=url_variables,
930
- request=request,
931
- request_body_required=True,
932
- request_has_path_params=True,
933
- request_has_query_params=True,
934
- user_agent_header="user-agent",
935
- accept_header_value="application/json",
936
- http_headers=http_headers,
937
- security=self.sdk_configuration.security,
938
- get_serialized_body=lambda: utils.serialize_request_body(
939
- request.create_collection_request,
940
- False,
941
- False,
942
- "json",
943
- models.CreateCollectionRequest,
944
- ),
945
- timeout_ms=timeout_ms,
946
- )
947
-
948
- if retries == UNSET:
949
- if self.sdk_configuration.retry_config is not UNSET:
950
- retries = self.sdk_configuration.retry_config
951
-
952
- retry_config = None
953
- if isinstance(retries, utils.RetryConfig):
954
- retry_config = (retries, ["429", "500", "502", "503", "504"])
955
-
956
- http_res = await self.do_request_async(
957
- hook_ctx=HookContext(
958
- base_url=base_url or "",
959
- operation_id="update_collection_v1_collections__collection__put",
541
+ operation_id="get_collection_v1_collections__collection_id__get",
960
542
  oauth2_scopes=[],
961
543
  security_source=get_security_from_env(
962
544
  self.sdk_configuration.security, models.Security
@@ -1006,459 +588,3 @@ class Collections(BaseSDK):
1006
588
  http_res_text,
1007
589
  http_res,
1008
590
  )
1009
-
1010
- def get(
1011
- self,
1012
- *,
1013
- collection: str,
1014
- x_namespace: OptionalNullable[str] = UNSET,
1015
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1016
- server_url: Optional[str] = None,
1017
- timeout_ms: Optional[int] = None,
1018
- http_headers: Optional[Mapping[str, str]] = None,
1019
- ) -> models.CollectionDetailsResponse:
1020
- r"""Get Collection Details
1021
-
1022
- Get a collection using either its name or ID
1023
-
1024
- :param collection: Either the collection name or collection ID
1025
- :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.
1026
- :param retries: Override the default retry configuration for this method
1027
- :param server_url: Override the default server URL for this method
1028
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1029
- :param http_headers: Additional headers to set or replace on requests.
1030
- """
1031
- base_url = None
1032
- url_variables = None
1033
- if timeout_ms is None:
1034
- timeout_ms = self.sdk_configuration.timeout_ms
1035
-
1036
- if server_url is not None:
1037
- base_url = server_url
1038
- else:
1039
- base_url = self._get_url(base_url, url_variables)
1040
-
1041
- request = models.GetCollectionDetailsV1CollectionsCollectionGetRequest(
1042
- collection=collection,
1043
- x_namespace=x_namespace,
1044
- )
1045
-
1046
- req = self._build_request(
1047
- method="GET",
1048
- path="/v1/collections/{collection}",
1049
- base_url=base_url,
1050
- url_variables=url_variables,
1051
- request=request,
1052
- request_body_required=False,
1053
- request_has_path_params=True,
1054
- request_has_query_params=True,
1055
- user_agent_header="user-agent",
1056
- accept_header_value="application/json",
1057
- http_headers=http_headers,
1058
- security=self.sdk_configuration.security,
1059
- timeout_ms=timeout_ms,
1060
- )
1061
-
1062
- if retries == UNSET:
1063
- if self.sdk_configuration.retry_config is not UNSET:
1064
- retries = self.sdk_configuration.retry_config
1065
-
1066
- retry_config = None
1067
- if isinstance(retries, utils.RetryConfig):
1068
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1069
-
1070
- http_res = self.do_request(
1071
- hook_ctx=HookContext(
1072
- base_url=base_url or "",
1073
- operation_id="get_collection_details_v1_collections__collection__get",
1074
- oauth2_scopes=[],
1075
- security_source=get_security_from_env(
1076
- self.sdk_configuration.security, models.Security
1077
- ),
1078
- ),
1079
- request=req,
1080
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
1081
- retry_config=retry_config,
1082
- )
1083
-
1084
- response_data: Any = None
1085
- if utils.match_response(http_res, "200", "application/json"):
1086
- return utils.unmarshal_json(http_res.text, models.CollectionDetailsResponse)
1087
- if utils.match_response(
1088
- http_res, ["400", "401", "403", "404"], "application/json"
1089
- ):
1090
- response_data = utils.unmarshal_json(
1091
- http_res.text, models.ErrorResponseData
1092
- )
1093
- raise models.ErrorResponse(data=response_data)
1094
- if utils.match_response(http_res, "422", "application/json"):
1095
- response_data = utils.unmarshal_json(
1096
- http_res.text, models.HTTPValidationErrorData
1097
- )
1098
- raise models.HTTPValidationError(data=response_data)
1099
- if utils.match_response(http_res, "500", "application/json"):
1100
- response_data = utils.unmarshal_json(
1101
- http_res.text, models.ErrorResponseData
1102
- )
1103
- raise models.ErrorResponse(data=response_data)
1104
- if utils.match_response(http_res, "4XX", "*"):
1105
- http_res_text = utils.stream_to_text(http_res)
1106
- raise models.APIError(
1107
- "API error occurred", http_res.status_code, http_res_text, http_res
1108
- )
1109
- if utils.match_response(http_res, "5XX", "*"):
1110
- http_res_text = utils.stream_to_text(http_res)
1111
- raise models.APIError(
1112
- "API error occurred", http_res.status_code, http_res_text, http_res
1113
- )
1114
-
1115
- content_type = http_res.headers.get("Content-Type")
1116
- http_res_text = utils.stream_to_text(http_res)
1117
- raise models.APIError(
1118
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1119
- http_res.status_code,
1120
- http_res_text,
1121
- http_res,
1122
- )
1123
-
1124
- async def get_async(
1125
- self,
1126
- *,
1127
- collection: str,
1128
- x_namespace: OptionalNullable[str] = UNSET,
1129
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1130
- server_url: Optional[str] = None,
1131
- timeout_ms: Optional[int] = None,
1132
- http_headers: Optional[Mapping[str, str]] = None,
1133
- ) -> models.CollectionDetailsResponse:
1134
- r"""Get Collection Details
1135
-
1136
- Get a collection using either its name or ID
1137
-
1138
- :param collection: Either the collection name or collection ID
1139
- :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.
1140
- :param retries: Override the default retry configuration for this method
1141
- :param server_url: Override the default server URL for this method
1142
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1143
- :param http_headers: Additional headers to set or replace on requests.
1144
- """
1145
- base_url = None
1146
- url_variables = None
1147
- if timeout_ms is None:
1148
- timeout_ms = self.sdk_configuration.timeout_ms
1149
-
1150
- if server_url is not None:
1151
- base_url = server_url
1152
- else:
1153
- base_url = self._get_url(base_url, url_variables)
1154
-
1155
- request = models.GetCollectionDetailsV1CollectionsCollectionGetRequest(
1156
- collection=collection,
1157
- x_namespace=x_namespace,
1158
- )
1159
-
1160
- req = self._build_request_async(
1161
- method="GET",
1162
- path="/v1/collections/{collection}",
1163
- base_url=base_url,
1164
- url_variables=url_variables,
1165
- request=request,
1166
- request_body_required=False,
1167
- request_has_path_params=True,
1168
- request_has_query_params=True,
1169
- user_agent_header="user-agent",
1170
- accept_header_value="application/json",
1171
- http_headers=http_headers,
1172
- security=self.sdk_configuration.security,
1173
- timeout_ms=timeout_ms,
1174
- )
1175
-
1176
- if retries == UNSET:
1177
- if self.sdk_configuration.retry_config is not UNSET:
1178
- retries = self.sdk_configuration.retry_config
1179
-
1180
- retry_config = None
1181
- if isinstance(retries, utils.RetryConfig):
1182
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1183
-
1184
- http_res = await self.do_request_async(
1185
- hook_ctx=HookContext(
1186
- base_url=base_url or "",
1187
- operation_id="get_collection_details_v1_collections__collection__get",
1188
- oauth2_scopes=[],
1189
- security_source=get_security_from_env(
1190
- self.sdk_configuration.security, models.Security
1191
- ),
1192
- ),
1193
- request=req,
1194
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
1195
- retry_config=retry_config,
1196
- )
1197
-
1198
- response_data: Any = None
1199
- if utils.match_response(http_res, "200", "application/json"):
1200
- return utils.unmarshal_json(http_res.text, models.CollectionDetailsResponse)
1201
- if utils.match_response(
1202
- http_res, ["400", "401", "403", "404"], "application/json"
1203
- ):
1204
- response_data = utils.unmarshal_json(
1205
- http_res.text, models.ErrorResponseData
1206
- )
1207
- raise models.ErrorResponse(data=response_data)
1208
- if utils.match_response(http_res, "422", "application/json"):
1209
- response_data = utils.unmarshal_json(
1210
- http_res.text, models.HTTPValidationErrorData
1211
- )
1212
- raise models.HTTPValidationError(data=response_data)
1213
- if utils.match_response(http_res, "500", "application/json"):
1214
- response_data = utils.unmarshal_json(
1215
- http_res.text, models.ErrorResponseData
1216
- )
1217
- raise models.ErrorResponse(data=response_data)
1218
- if utils.match_response(http_res, "4XX", "*"):
1219
- http_res_text = await utils.stream_to_text_async(http_res)
1220
- raise models.APIError(
1221
- "API error occurred", http_res.status_code, http_res_text, http_res
1222
- )
1223
- if utils.match_response(http_res, "5XX", "*"):
1224
- http_res_text = await utils.stream_to_text_async(http_res)
1225
- raise models.APIError(
1226
- "API error occurred", http_res.status_code, http_res_text, http_res
1227
- )
1228
-
1229
- content_type = http_res.headers.get("Content-Type")
1230
- http_res_text = await utils.stream_to_text_async(http_res)
1231
- raise models.APIError(
1232
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1233
- http_res.status_code,
1234
- http_res_text,
1235
- http_res,
1236
- )
1237
-
1238
- def get_collection_details_v1_collections_collection_details_get(
1239
- self,
1240
- *,
1241
- collection: str,
1242
- x_namespace: OptionalNullable[str] = UNSET,
1243
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1244
- server_url: Optional[str] = None,
1245
- timeout_ms: Optional[int] = None,
1246
- http_headers: Optional[Mapping[str, str]] = None,
1247
- ) -> models.CollectionDetailsResponse:
1248
- r"""Get Collection Details
1249
-
1250
- Get a collection using either its name or ID
1251
-
1252
- :param collection: Either the collection name or collection ID
1253
- :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.
1254
- :param retries: Override the default retry configuration for this method
1255
- :param server_url: Override the default server URL for this method
1256
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1257
- :param http_headers: Additional headers to set or replace on requests.
1258
- """
1259
- base_url = None
1260
- url_variables = None
1261
- if timeout_ms is None:
1262
- timeout_ms = self.sdk_configuration.timeout_ms
1263
-
1264
- if server_url is not None:
1265
- base_url = server_url
1266
- else:
1267
- base_url = self._get_url(base_url, url_variables)
1268
-
1269
- request = models.GetCollectionDetailsV1CollectionsCollectionDetailsGetRequest(
1270
- collection=collection,
1271
- x_namespace=x_namespace,
1272
- )
1273
-
1274
- req = self._build_request(
1275
- method="GET",
1276
- path="/v1/collections/{collection}/details",
1277
- base_url=base_url,
1278
- url_variables=url_variables,
1279
- request=request,
1280
- request_body_required=False,
1281
- request_has_path_params=True,
1282
- request_has_query_params=True,
1283
- user_agent_header="user-agent",
1284
- accept_header_value="application/json",
1285
- http_headers=http_headers,
1286
- security=self.sdk_configuration.security,
1287
- timeout_ms=timeout_ms,
1288
- )
1289
-
1290
- if retries == UNSET:
1291
- if self.sdk_configuration.retry_config is not UNSET:
1292
- retries = self.sdk_configuration.retry_config
1293
-
1294
- retry_config = None
1295
- if isinstance(retries, utils.RetryConfig):
1296
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1297
-
1298
- http_res = self.do_request(
1299
- hook_ctx=HookContext(
1300
- base_url=base_url or "",
1301
- operation_id="get_collection_details_v1_collections__collection__details_get",
1302
- oauth2_scopes=[],
1303
- security_source=get_security_from_env(
1304
- self.sdk_configuration.security, models.Security
1305
- ),
1306
- ),
1307
- request=req,
1308
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
1309
- retry_config=retry_config,
1310
- )
1311
-
1312
- response_data: Any = None
1313
- if utils.match_response(http_res, "200", "application/json"):
1314
- return utils.unmarshal_json(http_res.text, models.CollectionDetailsResponse)
1315
- if utils.match_response(
1316
- http_res, ["400", "401", "403", "404"], "application/json"
1317
- ):
1318
- response_data = utils.unmarshal_json(
1319
- http_res.text, models.ErrorResponseData
1320
- )
1321
- raise models.ErrorResponse(data=response_data)
1322
- if utils.match_response(http_res, "422", "application/json"):
1323
- response_data = utils.unmarshal_json(
1324
- http_res.text, models.HTTPValidationErrorData
1325
- )
1326
- raise models.HTTPValidationError(data=response_data)
1327
- if utils.match_response(http_res, "500", "application/json"):
1328
- response_data = utils.unmarshal_json(
1329
- http_res.text, models.ErrorResponseData
1330
- )
1331
- raise models.ErrorResponse(data=response_data)
1332
- if utils.match_response(http_res, "4XX", "*"):
1333
- http_res_text = utils.stream_to_text(http_res)
1334
- raise models.APIError(
1335
- "API error occurred", http_res.status_code, http_res_text, http_res
1336
- )
1337
- if utils.match_response(http_res, "5XX", "*"):
1338
- http_res_text = utils.stream_to_text(http_res)
1339
- raise models.APIError(
1340
- "API error occurred", http_res.status_code, http_res_text, http_res
1341
- )
1342
-
1343
- content_type = http_res.headers.get("Content-Type")
1344
- http_res_text = utils.stream_to_text(http_res)
1345
- raise models.APIError(
1346
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1347
- http_res.status_code,
1348
- http_res_text,
1349
- http_res,
1350
- )
1351
-
1352
- async def get_collection_details_v1_collections_collection_details_get_async(
1353
- self,
1354
- *,
1355
- collection: str,
1356
- x_namespace: OptionalNullable[str] = UNSET,
1357
- retries: OptionalNullable[utils.RetryConfig] = UNSET,
1358
- server_url: Optional[str] = None,
1359
- timeout_ms: Optional[int] = None,
1360
- http_headers: Optional[Mapping[str, str]] = None,
1361
- ) -> models.CollectionDetailsResponse:
1362
- r"""Get Collection Details
1363
-
1364
- Get a collection using either its name or ID
1365
-
1366
- :param collection: Either the collection name or collection ID
1367
- :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.
1368
- :param retries: Override the default retry configuration for this method
1369
- :param server_url: Override the default server URL for this method
1370
- :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
1371
- :param http_headers: Additional headers to set or replace on requests.
1372
- """
1373
- base_url = None
1374
- url_variables = None
1375
- if timeout_ms is None:
1376
- timeout_ms = self.sdk_configuration.timeout_ms
1377
-
1378
- if server_url is not None:
1379
- base_url = server_url
1380
- else:
1381
- base_url = self._get_url(base_url, url_variables)
1382
-
1383
- request = models.GetCollectionDetailsV1CollectionsCollectionDetailsGetRequest(
1384
- collection=collection,
1385
- x_namespace=x_namespace,
1386
- )
1387
-
1388
- req = self._build_request_async(
1389
- method="GET",
1390
- path="/v1/collections/{collection}/details",
1391
- base_url=base_url,
1392
- url_variables=url_variables,
1393
- request=request,
1394
- request_body_required=False,
1395
- request_has_path_params=True,
1396
- request_has_query_params=True,
1397
- user_agent_header="user-agent",
1398
- accept_header_value="application/json",
1399
- http_headers=http_headers,
1400
- security=self.sdk_configuration.security,
1401
- timeout_ms=timeout_ms,
1402
- )
1403
-
1404
- if retries == UNSET:
1405
- if self.sdk_configuration.retry_config is not UNSET:
1406
- retries = self.sdk_configuration.retry_config
1407
-
1408
- retry_config = None
1409
- if isinstance(retries, utils.RetryConfig):
1410
- retry_config = (retries, ["429", "500", "502", "503", "504"])
1411
-
1412
- http_res = await self.do_request_async(
1413
- hook_ctx=HookContext(
1414
- base_url=base_url or "",
1415
- operation_id="get_collection_details_v1_collections__collection__details_get",
1416
- oauth2_scopes=[],
1417
- security_source=get_security_from_env(
1418
- self.sdk_configuration.security, models.Security
1419
- ),
1420
- ),
1421
- request=req,
1422
- error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
1423
- retry_config=retry_config,
1424
- )
1425
-
1426
- response_data: Any = None
1427
- if utils.match_response(http_res, "200", "application/json"):
1428
- return utils.unmarshal_json(http_res.text, models.CollectionDetailsResponse)
1429
- if utils.match_response(
1430
- http_res, ["400", "401", "403", "404"], "application/json"
1431
- ):
1432
- response_data = utils.unmarshal_json(
1433
- http_res.text, models.ErrorResponseData
1434
- )
1435
- raise models.ErrorResponse(data=response_data)
1436
- if utils.match_response(http_res, "422", "application/json"):
1437
- response_data = utils.unmarshal_json(
1438
- http_res.text, models.HTTPValidationErrorData
1439
- )
1440
- raise models.HTTPValidationError(data=response_data)
1441
- if utils.match_response(http_res, "500", "application/json"):
1442
- response_data = utils.unmarshal_json(
1443
- http_res.text, models.ErrorResponseData
1444
- )
1445
- raise models.ErrorResponse(data=response_data)
1446
- if utils.match_response(http_res, "4XX", "*"):
1447
- http_res_text = await utils.stream_to_text_async(http_res)
1448
- raise models.APIError(
1449
- "API error occurred", http_res.status_code, http_res_text, http_res
1450
- )
1451
- if utils.match_response(http_res, "5XX", "*"):
1452
- http_res_text = await utils.stream_to_text_async(http_res)
1453
- raise models.APIError(
1454
- "API error occurred", http_res.status_code, http_res_text, http_res
1455
- )
1456
-
1457
- content_type = http_res.headers.get("Content-Type")
1458
- http_res_text = await utils.stream_to_text_async(http_res)
1459
- raise models.APIError(
1460
- f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
1461
- http_res.status_code,
1462
- http_res_text,
1463
- http_res,
1464
- )