mixpeek 0.12.0__py3-none-any.whl → 0.13__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 (270) hide show
  1. mixpeek/__init__.py +5 -79
  2. mixpeek/_hooks/__init__.py +5 -0
  3. mixpeek/_hooks/registration.py +13 -0
  4. mixpeek/_hooks/sdkhooks.py +76 -0
  5. mixpeek/_hooks/types.py +94 -0
  6. mixpeek/_version.py +11 -3
  7. mixpeek/assets.py +1561 -0
  8. mixpeek/basesdk.py +350 -0
  9. mixpeek/collections.py +1029 -0
  10. mixpeek/featureextractors.py +205 -0
  11. mixpeek/features.py +1181 -0
  12. mixpeek/health.py +167 -0
  13. mixpeek/httpclient.py +84 -0
  14. mixpeek/ingest.py +831 -0
  15. mixpeek/interactions.py +221 -0
  16. mixpeek/models/__init__.py +751 -0
  17. mixpeek/models/actionusage.py +16 -0
  18. mixpeek/models/apierror.py +22 -0
  19. mixpeek/models/apikey.py +25 -0
  20. mixpeek/models/apikeyupdate.py +49 -0
  21. mixpeek/models/assetfeatures.py +55 -0
  22. mixpeek/models/assetresponse.py +166 -0
  23. mixpeek/models/assets_model_searchquery.py +21 -0
  24. mixpeek/models/assetupdate.py +28 -0
  25. mixpeek/models/availableindexesresponse.py +23 -0
  26. mixpeek/models/availablemodels.py +12 -0
  27. mixpeek/models/boolindexparams.py +18 -0
  28. mixpeek/models/collectionmodel.py +70 -0
  29. mixpeek/models/collectionresult.py +73 -0
  30. mixpeek/models/create_api_key_organizations_users_user_email_api_keys_postop.py +23 -0
  31. mixpeek/models/create_collection_collections_postop.py +62 -0
  32. mixpeek/models/create_interaction_features_search_interactions_postop.py +59 -0
  33. mixpeek/models/createcollectionrequest.py +59 -0
  34. mixpeek/models/createnamespacerequest.py +62 -0
  35. mixpeek/models/datetimeindexparams.py +18 -0
  36. mixpeek/models/dateusage.py +22 -0
  37. mixpeek/models/db_model_paginationresponse.py +59 -0
  38. mixpeek/models/db_model_taskresponse.py +20 -0
  39. mixpeek/models/delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py +23 -0
  40. mixpeek/models/delete_asset_assets_asset_id_deleteop.py +57 -0
  41. mixpeek/models/delete_collection_collections_collection_deleteop.py +59 -0
  42. mixpeek/models/delete_feature_features_feature_id_deleteop.py +57 -0
  43. mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +59 -0
  44. mixpeek/models/delete_namespace_namespaces_namespace_deleteop.py +18 -0
  45. mixpeek/models/delete_user_organizations_users_user_email_deleteop.py +16 -0
  46. mixpeek/models/denseembedding.py +16 -0
  47. mixpeek/models/embeddingrequest.py +59 -0
  48. mixpeek/models/embeddingresponse.py +64 -0
  49. mixpeek/models/errormessage.py +13 -0
  50. mixpeek/models/errorresponse.py +21 -0
  51. mixpeek/models/facedetectsettings.py +52 -0
  52. mixpeek/models/featureextractionembeddingrequest.py +54 -0
  53. mixpeek/models/featureresponse.py +74 -0
  54. mixpeek/models/features_model_paginationresponse.py +59 -0
  55. mixpeek/models/featureupdaterequest.py +21 -0
  56. mixpeek/models/filtercondition.py +74 -0
  57. mixpeek/models/floatindexparams.py +18 -0
  58. mixpeek/models/full_asset_update_assets_asset_id_putop.py +69 -0
  59. mixpeek/models/full_feature_update_features_feature_id_putop.py +69 -0
  60. mixpeek/models/geoindexparams.py +18 -0
  61. mixpeek/models/get_asset_assets_asset_id_getop.py +73 -0
  62. mixpeek/models/get_asset_with_features_assets_asset_id_features_getop.py +73 -0
  63. mixpeek/models/get_collection_collections_collection_getop.py +59 -0
  64. mixpeek/models/get_feature_features_feature_id_getop.py +70 -0
  65. mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +59 -0
  66. mixpeek/models/get_namespace_namespaces_namespace_getop.py +18 -0
  67. mixpeek/models/get_task_tasks_task_id_getop.py +57 -0
  68. mixpeek/models/get_user_organizations_users_user_email_getop.py +16 -0
  69. mixpeek/models/groupbyoptions.py +71 -0
  70. mixpeek/models/groupbyoptionsasset.py +71 -0
  71. mixpeek/models/groupedassetdata.py +18 -0
  72. mixpeek/models/healthcheckresponse.py +13 -0
  73. mixpeek/models/httpvalidationerror.py +21 -0
  74. mixpeek/models/imagedescribesettings.py +82 -0
  75. mixpeek/models/imagedetectsettings.py +53 -0
  76. mixpeek/models/imagereadsettings.py +71 -0
  77. mixpeek/models/imagesettings.py +79 -0
  78. mixpeek/models/ingest_image_url_ingest_images_url_postop.py +59 -0
  79. mixpeek/models/ingest_text_ingest_text_postop.py +59 -0
  80. mixpeek/models/ingest_video_url_ingest_videos_url_postop.py +59 -0
  81. mixpeek/models/inputtype.py +11 -0
  82. mixpeek/models/integerindexparams.py +24 -0
  83. mixpeek/models/interactionresponse.py +87 -0
  84. mixpeek/models/interactiontype.py +11 -0
  85. mixpeek/models/jsonimageoutputsettings.py +55 -0
  86. mixpeek/models/jsontextoutputsettings.py +55 -0
  87. mixpeek/models/jsonvideooutputsettings.py +55 -0
  88. mixpeek/models/keywordindexparams.py +21 -0
  89. mixpeek/models/kill_task_tasks_task_id_deleteop.py +57 -0
  90. mixpeek/models/list_assets_assets_postop.py +77 -0
  91. mixpeek/models/list_collections_collections_getop.py +65 -0
  92. mixpeek/models/list_features_features_postop.py +79 -0
  93. mixpeek/models/list_interactions_features_search_interactions_getop.py +96 -0
  94. mixpeek/models/listassetsrequest.py +75 -0
  95. mixpeek/models/listassetsresponse.py +22 -0
  96. mixpeek/models/listcollectionsresponse.py +22 -0
  97. mixpeek/models/listfeaturesrequest.py +77 -0
  98. mixpeek/models/listfeaturesresponse.py +22 -0
  99. mixpeek/models/logicaloperator_input.py +88 -0
  100. mixpeek/models/logicaloperator_output.py +103 -0
  101. mixpeek/models/logodetectsettings.py +52 -0
  102. mixpeek/models/modality.py +13 -0
  103. mixpeek/models/modeldetails.py +57 -0
  104. mixpeek/models/namespaceresponse.py +54 -0
  105. mixpeek/models/organizationmodel.py +45 -0
  106. mixpeek/models/partial_asset_update_assets_asset_id_patchop.py +69 -0
  107. mixpeek/models/payloadindexconfig.py +94 -0
  108. mixpeek/models/payloadindextype.py +17 -0
  109. mixpeek/models/payloadschematype.py +15 -0
  110. mixpeek/models/percolaterequest.py +57 -0
  111. mixpeek/models/permission.py +10 -0
  112. mixpeek/models/processimageurlinput.py +99 -0
  113. mixpeek/models/processtextinput.py +94 -0
  114. mixpeek/models/processvideourlinput.py +99 -0
  115. mixpeek/models/querysettings.py +56 -0
  116. mixpeek/models/rerankingoptions.py +47 -0
  117. mixpeek/models/search_assets_assets_search_postop.py +59 -0
  118. mixpeek/models/search_features_features_search_postop.py +96 -0
  119. mixpeek/models/search_model_searchquery_input.py +76 -0
  120. mixpeek/models/searchassetsrequest.py +78 -0
  121. mixpeek/models/searchinteraction.py +82 -0
  122. mixpeek/models/searchquery_output.py +79 -0
  123. mixpeek/models/searchrequestfeatures_input.py +151 -0
  124. mixpeek/models/searchrequestfeatures_output.py +151 -0
  125. mixpeek/models/sortoption.py +28 -0
  126. mixpeek/models/sparseembedding.py +21 -0
  127. mixpeek/models/tasks_model_taskresponse.py +24 -0
  128. mixpeek/models/taskstatus.py +16 -0
  129. mixpeek/models/textindexparams.py +31 -0
  130. mixpeek/models/textsettings.py +61 -0
  131. mixpeek/models/tokenizertype.py +11 -0
  132. mixpeek/models/update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py +30 -0
  133. mixpeek/models/update_collection_collections_collection_putop.py +74 -0
  134. mixpeek/models/update_namespace_namespaces_namespace_putop.py +28 -0
  135. mixpeek/models/updateassetrequest.py +60 -0
  136. mixpeek/models/updatenamespacerequest.py +26 -0
  137. mixpeek/models/usage.py +18 -0
  138. mixpeek/models/usermodel_input.py +36 -0
  139. mixpeek/models/usermodel_output.py +36 -0
  140. mixpeek/models/uuidindexparams.py +21 -0
  141. mixpeek/models/validationerror.py +26 -0
  142. mixpeek/models/vectormodel.py +11 -0
  143. mixpeek/models/vectortype.py +9 -0
  144. mixpeek/models/videodescribesettings.py +82 -0
  145. mixpeek/models/videodetectsettings.py +53 -0
  146. mixpeek/models/videoreadsettings.py +71 -0
  147. mixpeek/models/videosettings.py +101 -0
  148. mixpeek/models/videotranscriptionsettings.py +69 -0
  149. mixpeek/namespaces.py +1143 -0
  150. mixpeek/organizations.py +1508 -0
  151. mixpeek/py.typed +1 -0
  152. mixpeek/sdk.py +135 -0
  153. mixpeek/sdkconfiguration.py +45 -0
  154. mixpeek/searchinteractions.py +647 -0
  155. mixpeek/tasks.py +387 -0
  156. mixpeek/types/__init__.py +19 -29
  157. mixpeek/types/basemodel.py +39 -0
  158. mixpeek/utils/__init__.py +97 -0
  159. mixpeek/utils/annotations.py +55 -0
  160. mixpeek/utils/enums.py +34 -0
  161. mixpeek/utils/eventstreaming.py +238 -0
  162. mixpeek/utils/forms.py +202 -0
  163. mixpeek/utils/headers.py +136 -0
  164. mixpeek/utils/logger.py +27 -0
  165. mixpeek/utils/metadata.py +118 -0
  166. mixpeek/utils/queryparams.py +205 -0
  167. mixpeek/utils/requestbodies.py +66 -0
  168. mixpeek/utils/retries.py +217 -0
  169. mixpeek/utils/security.py +174 -0
  170. mixpeek/utils/serializers.py +215 -0
  171. mixpeek/utils/url.py +155 -0
  172. mixpeek/utils/values.py +134 -0
  173. mixpeek-0.13.dist-info/METADATA +439 -0
  174. mixpeek-0.13.dist-info/RECORD +176 -0
  175. {mixpeek-0.12.0.dist-info → mixpeek-0.13.dist-info}/WHEEL +1 -1
  176. py.typed +1 -0
  177. mixpeek/_base_client.py +0 -2041
  178. mixpeek/_client.py +0 -444
  179. mixpeek/_compat.py +0 -221
  180. mixpeek/_constants.py +0 -14
  181. mixpeek/_exceptions.py +0 -108
  182. mixpeek/_files.py +0 -123
  183. mixpeek/_models.py +0 -788
  184. mixpeek/_qs.py +0 -150
  185. mixpeek/_resource.py +0 -43
  186. mixpeek/_response.py +0 -824
  187. mixpeek/_streaming.py +0 -333
  188. mixpeek/_types.py +0 -219
  189. mixpeek/_utils/__init__.py +0 -56
  190. mixpeek/_utils/_logs.py +0 -25
  191. mixpeek/_utils/_proxy.py +0 -62
  192. mixpeek/_utils/_reflection.py +0 -42
  193. mixpeek/_utils/_streams.py +0 -12
  194. mixpeek/_utils/_sync.py +0 -81
  195. mixpeek/_utils/_transform.py +0 -387
  196. mixpeek/_utils/_typing.py +0 -120
  197. mixpeek/_utils/_utils.py +0 -414
  198. mixpeek/lib/.keep +0 -4
  199. mixpeek/resources/__init__.py +0 -117
  200. mixpeek/resources/accounts.py +0 -271
  201. mixpeek/resources/assets/__init__.py +0 -33
  202. mixpeek/resources/assets/assets.py +0 -708
  203. mixpeek/resources/assets/features.py +0 -172
  204. mixpeek/resources/collections.py +0 -283
  205. mixpeek/resources/entities/__init__.py +0 -47
  206. mixpeek/resources/entities/entities.py +0 -134
  207. mixpeek/resources/entities/faces.py +0 -514
  208. mixpeek/resources/entities/labels.py +0 -388
  209. mixpeek/resources/features/__init__.py +0 -33
  210. mixpeek/resources/features/features.py +0 -562
  211. mixpeek/resources/features/search.py +0 -731
  212. mixpeek/resources/healthcheck.py +0 -135
  213. mixpeek/resources/index/__init__.py +0 -47
  214. mixpeek/resources/index/images.py +0 -249
  215. mixpeek/resources/index/index.py +0 -289
  216. mixpeek/resources/index/videos.py +0 -249
  217. mixpeek/resources/tasks.py +0 -258
  218. mixpeek/types/account_update_params.py +0 -28
  219. mixpeek/types/asset_create_params.py +0 -36
  220. mixpeek/types/asset_create_response.py +0 -15
  221. mixpeek/types/asset_response.py +0 -46
  222. mixpeek/types/asset_search_params.py +0 -43
  223. mixpeek/types/asset_search_response.py +0 -15
  224. mixpeek/types/asset_update_params.py +0 -25
  225. mixpeek/types/asset_update_response.py +0 -11
  226. mixpeek/types/assets/__init__.py +0 -3
  227. mixpeek/types/collection_list_params.py +0 -19
  228. mixpeek/types/collection_list_response.py +0 -14
  229. mixpeek/types/entities/__init__.py +0 -13
  230. mixpeek/types/entities/face_create_params.py +0 -21
  231. mixpeek/types/entities/face_list_params.py +0 -18
  232. mixpeek/types/entities/face_list_response.py +0 -15
  233. mixpeek/types/entities/face_response.py +0 -17
  234. mixpeek/types/entities/face_update_params.py +0 -22
  235. mixpeek/types/entities/label_list_params.py +0 -18
  236. mixpeek/types/entities/label_list_response.py +0 -30
  237. mixpeek/types/entities/label_response.py +0 -30
  238. mixpeek/types/entities/label_update_params.py +0 -21
  239. mixpeek/types/feature.py +0 -32
  240. mixpeek/types/feature_list_params.py +0 -37
  241. mixpeek/types/feature_list_response.py +0 -28
  242. mixpeek/types/feature_retrieve_params.py +0 -18
  243. mixpeek/types/feature_update_params.py +0 -16
  244. mixpeek/types/features/__init__.py +0 -8
  245. mixpeek/types/features/search_feedback_params.py +0 -23
  246. mixpeek/types/features/search_file_params.py +0 -29
  247. mixpeek/types/features/search_text_params.py +0 -72
  248. mixpeek/types/features/search_url_params.py +0 -72
  249. mixpeek/types/grouped_asset_data.py +0 -24
  250. mixpeek/types/health_check_response.py +0 -10
  251. mixpeek/types/index/__init__.py +0 -8
  252. mixpeek/types/index/image_url_params.py +0 -135
  253. mixpeek/types/index/image_url_response.py +0 -20
  254. mixpeek/types/index/video_url_params.py +0 -154
  255. mixpeek/types/index/video_url_response.py +0 -20
  256. mixpeek/types/index_text_params.py +0 -77
  257. mixpeek/types/index_text_response.py +0 -14
  258. mixpeek/types/shared/__init__.py +0 -7
  259. mixpeek/types/shared/filter_condition.py +0 -19
  260. mixpeek/types/shared/logical_operator.py +0 -12
  261. mixpeek/types/shared/model_pagination_response.py +0 -21
  262. mixpeek/types/shared/sort_option.py +0 -15
  263. mixpeek/types/shared/task_response.py +0 -15
  264. mixpeek/types/shared_params/__init__.py +0 -4
  265. mixpeek/types/shared_params/logical_operator.py +0 -13
  266. mixpeek/types/shared_params/sort_option.py +0 -15
  267. mixpeek/types/user.py +0 -34
  268. mixpeek-0.12.0.dist-info/METADATA +0 -345
  269. mixpeek-0.12.0.dist-info/RECORD +0 -99
  270. mixpeek-0.12.0.dist-info/licenses/LICENSE +0 -201
@@ -1,562 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- from typing import List, Iterable, Optional
6
-
7
- import httpx
8
-
9
- from .search import (
10
- SearchResource,
11
- AsyncSearchResource,
12
- SearchResourceWithRawResponse,
13
- AsyncSearchResourceWithRawResponse,
14
- SearchResourceWithStreamingResponse,
15
- AsyncSearchResourceWithStreamingResponse,
16
- )
17
- from ...types import feature_list_params, feature_update_params, feature_retrieve_params
18
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
19
- from ..._utils import (
20
- maybe_transform,
21
- strip_not_given,
22
- async_maybe_transform,
23
- )
24
- from ..._compat import cached_property
25
- from ..._resource import SyncAPIResource, AsyncAPIResource
26
- from ..._response import (
27
- to_raw_response_wrapper,
28
- to_streamed_response_wrapper,
29
- async_to_raw_response_wrapper,
30
- async_to_streamed_response_wrapper,
31
- )
32
- from ..._base_client import make_request_options
33
- from ...types.feature import Feature
34
- from ...types.feature_list_response import FeatureListResponse
35
- from ...types.shared_params.sort_option import SortOption
36
- from ...types.shared_params.logical_operator import LogicalOperator
37
-
38
- __all__ = ["FeaturesResource", "AsyncFeaturesResource"]
39
-
40
-
41
- class FeaturesResource(SyncAPIResource):
42
- @cached_property
43
- def search(self) -> SearchResource:
44
- return SearchResource(self._client)
45
-
46
- @cached_property
47
- def with_raw_response(self) -> FeaturesResourceWithRawResponse:
48
- """
49
- This property can be used as a prefix for any HTTP method call to return the
50
- the raw response object instead of the parsed content.
51
-
52
- For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
53
- """
54
- return FeaturesResourceWithRawResponse(self)
55
-
56
- @cached_property
57
- def with_streaming_response(self) -> FeaturesResourceWithStreamingResponse:
58
- """
59
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
60
-
61
- For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
62
- """
63
- return FeaturesResourceWithStreamingResponse(self)
64
-
65
- def retrieve(
66
- self,
67
- feature_id: str,
68
- *,
69
- include_vectors: Optional[bool] | NotGiven = NOT_GIVEN,
70
- index_id: str | NotGiven = NOT_GIVEN,
71
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
72
- # The extra values given here take precedence over values defined on the client or passed to this method.
73
- extra_headers: Headers | None = None,
74
- extra_query: Query | None = None,
75
- extra_body: Body | None = None,
76
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
77
- ) -> Feature:
78
- """
79
- Get Feature
80
-
81
- Args:
82
- include_vectors: When true, includes the feature's vector embeddings in the response
83
-
84
- index_id: filter by organization
85
-
86
- extra_headers: Send extra headers
87
-
88
- extra_query: Add additional query parameters to the request
89
-
90
- extra_body: Add additional JSON properties to the request
91
-
92
- timeout: Override the client-level default timeout for this request, in seconds
93
- """
94
- if not feature_id:
95
- raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}")
96
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
97
- return self._get(
98
- f"/features/{feature_id}",
99
- options=make_request_options(
100
- extra_headers=extra_headers,
101
- extra_query=extra_query,
102
- extra_body=extra_body,
103
- timeout=timeout,
104
- query=maybe_transform(
105
- {"include_vectors": include_vectors}, feature_retrieve_params.FeatureRetrieveParams
106
- ),
107
- ),
108
- cast_to=Feature,
109
- )
110
-
111
- def update(
112
- self,
113
- feature_id: str,
114
- *,
115
- metadata: object,
116
- index_id: str | NotGiven = NOT_GIVEN,
117
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
118
- # The extra values given here take precedence over values defined on the client or passed to this method.
119
- extra_headers: Headers | None = None,
120
- extra_query: Query | None = None,
121
- extra_body: Body | None = None,
122
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
123
- ) -> Feature:
124
- """
125
- Full Feature Update
126
-
127
- Args:
128
- index_id: filter by organization
129
-
130
- extra_headers: Send extra headers
131
-
132
- extra_query: Add additional query parameters to the request
133
-
134
- extra_body: Add additional JSON properties to the request
135
-
136
- timeout: Override the client-level default timeout for this request, in seconds
137
- """
138
- if not feature_id:
139
- raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}")
140
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
141
- return self._put(
142
- f"/features/{feature_id}",
143
- body=maybe_transform({"metadata": metadata}, feature_update_params.FeatureUpdateParams),
144
- options=make_request_options(
145
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
146
- ),
147
- cast_to=Feature,
148
- )
149
-
150
- def list(
151
- self,
152
- *,
153
- collection_ids: List[str],
154
- offset_feature_id: Optional[str] | NotGiven = NOT_GIVEN,
155
- page_size: int | NotGiven = NOT_GIVEN,
156
- filters: Optional[LogicalOperator] | NotGiven = NOT_GIVEN,
157
- select: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
158
- sort: Optional[SortOption] | NotGiven = NOT_GIVEN,
159
- index_id: str | NotGiven = NOT_GIVEN,
160
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
161
- # The extra values given here take precedence over values defined on the client or passed to this method.
162
- extra_headers: Headers | None = None,
163
- extra_query: Query | None = None,
164
- extra_body: Body | None = None,
165
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
166
- ) -> FeatureListResponse:
167
- """
168
- Retrieves a list of features based on the provided filters and sorting criteria.
169
- If you provide a sort, then pagination isn't supported.
170
-
171
- Args:
172
- collection_ids: Collection IDs to filter features
173
-
174
- offset_feature_id: The offset id to start returning results from. Used for pagination
175
-
176
- filters: Complex nested query filters
177
-
178
- select: List of fields to return in results, supports dot notation.
179
-
180
- sort: List of fields to sort by, with direction (asc or desc).
181
- NOTE: fields will require a specialty index to use this, consult with the team.
182
-
183
- index_id: filter by organization
184
-
185
- extra_headers: Send extra headers
186
-
187
- extra_query: Add additional query parameters to the request
188
-
189
- extra_body: Add additional JSON properties to the request
190
-
191
- timeout: Override the client-level default timeout for this request, in seconds
192
- """
193
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
194
- return self._post(
195
- "/features",
196
- body=maybe_transform(
197
- {
198
- "collection_ids": collection_ids,
199
- "filters": filters,
200
- "select": select,
201
- "sort": sort,
202
- },
203
- feature_list_params.FeatureListParams,
204
- ),
205
- options=make_request_options(
206
- extra_headers=extra_headers,
207
- extra_query=extra_query,
208
- extra_body=extra_body,
209
- timeout=timeout,
210
- query=maybe_transform(
211
- {
212
- "offset_feature_id": offset_feature_id,
213
- "page_size": page_size,
214
- },
215
- feature_list_params.FeatureListParams,
216
- ),
217
- ),
218
- cast_to=FeatureListResponse,
219
- )
220
-
221
- def delete(
222
- self,
223
- feature_id: str,
224
- *,
225
- index_id: str | NotGiven = NOT_GIVEN,
226
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
227
- # The extra values given here take precedence over values defined on the client or passed to this method.
228
- extra_headers: Headers | None = None,
229
- extra_query: Query | None = None,
230
- extra_body: Body | None = None,
231
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
232
- ) -> object:
233
- """
234
- Delete Feature
235
-
236
- Args:
237
- index_id: filter by organization
238
-
239
- extra_headers: Send extra headers
240
-
241
- extra_query: Add additional query parameters to the request
242
-
243
- extra_body: Add additional JSON properties to the request
244
-
245
- timeout: Override the client-level default timeout for this request, in seconds
246
- """
247
- if not feature_id:
248
- raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}")
249
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
250
- return self._delete(
251
- f"/features/{feature_id}",
252
- options=make_request_options(
253
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
254
- ),
255
- cast_to=object,
256
- )
257
-
258
-
259
- class AsyncFeaturesResource(AsyncAPIResource):
260
- @cached_property
261
- def search(self) -> AsyncSearchResource:
262
- return AsyncSearchResource(self._client)
263
-
264
- @cached_property
265
- def with_raw_response(self) -> AsyncFeaturesResourceWithRawResponse:
266
- """
267
- This property can be used as a prefix for any HTTP method call to return the
268
- the raw response object instead of the parsed content.
269
-
270
- For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
271
- """
272
- return AsyncFeaturesResourceWithRawResponse(self)
273
-
274
- @cached_property
275
- def with_streaming_response(self) -> AsyncFeaturesResourceWithStreamingResponse:
276
- """
277
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
278
-
279
- For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
280
- """
281
- return AsyncFeaturesResourceWithStreamingResponse(self)
282
-
283
- async def retrieve(
284
- self,
285
- feature_id: str,
286
- *,
287
- include_vectors: Optional[bool] | NotGiven = NOT_GIVEN,
288
- index_id: str | NotGiven = NOT_GIVEN,
289
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
290
- # The extra values given here take precedence over values defined on the client or passed to this method.
291
- extra_headers: Headers | None = None,
292
- extra_query: Query | None = None,
293
- extra_body: Body | None = None,
294
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
295
- ) -> Feature:
296
- """
297
- Get Feature
298
-
299
- Args:
300
- include_vectors: When true, includes the feature's vector embeddings in the response
301
-
302
- index_id: filter by organization
303
-
304
- extra_headers: Send extra headers
305
-
306
- extra_query: Add additional query parameters to the request
307
-
308
- extra_body: Add additional JSON properties to the request
309
-
310
- timeout: Override the client-level default timeout for this request, in seconds
311
- """
312
- if not feature_id:
313
- raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}")
314
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
315
- return await self._get(
316
- f"/features/{feature_id}",
317
- options=make_request_options(
318
- extra_headers=extra_headers,
319
- extra_query=extra_query,
320
- extra_body=extra_body,
321
- timeout=timeout,
322
- query=await async_maybe_transform(
323
- {"include_vectors": include_vectors}, feature_retrieve_params.FeatureRetrieveParams
324
- ),
325
- ),
326
- cast_to=Feature,
327
- )
328
-
329
- async def update(
330
- self,
331
- feature_id: str,
332
- *,
333
- metadata: object,
334
- index_id: str | NotGiven = NOT_GIVEN,
335
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
336
- # The extra values given here take precedence over values defined on the client or passed to this method.
337
- extra_headers: Headers | None = None,
338
- extra_query: Query | None = None,
339
- extra_body: Body | None = None,
340
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
341
- ) -> Feature:
342
- """
343
- Full Feature Update
344
-
345
- Args:
346
- index_id: filter by organization
347
-
348
- extra_headers: Send extra headers
349
-
350
- extra_query: Add additional query parameters to the request
351
-
352
- extra_body: Add additional JSON properties to the request
353
-
354
- timeout: Override the client-level default timeout for this request, in seconds
355
- """
356
- if not feature_id:
357
- raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}")
358
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
359
- return await self._put(
360
- f"/features/{feature_id}",
361
- body=await async_maybe_transform({"metadata": metadata}, feature_update_params.FeatureUpdateParams),
362
- options=make_request_options(
363
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
364
- ),
365
- cast_to=Feature,
366
- )
367
-
368
- async def list(
369
- self,
370
- *,
371
- collection_ids: List[str],
372
- offset_feature_id: Optional[str] | NotGiven = NOT_GIVEN,
373
- page_size: int | NotGiven = NOT_GIVEN,
374
- filters: Optional[LogicalOperator] | NotGiven = NOT_GIVEN,
375
- select: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
376
- sort: Optional[SortOption] | NotGiven = NOT_GIVEN,
377
- index_id: str | NotGiven = NOT_GIVEN,
378
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
379
- # The extra values given here take precedence over values defined on the client or passed to this method.
380
- extra_headers: Headers | None = None,
381
- extra_query: Query | None = None,
382
- extra_body: Body | None = None,
383
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
384
- ) -> FeatureListResponse:
385
- """
386
- Retrieves a list of features based on the provided filters and sorting criteria.
387
- If you provide a sort, then pagination isn't supported.
388
-
389
- Args:
390
- collection_ids: Collection IDs to filter features
391
-
392
- offset_feature_id: The offset id to start returning results from. Used for pagination
393
-
394
- filters: Complex nested query filters
395
-
396
- select: List of fields to return in results, supports dot notation.
397
-
398
- sort: List of fields to sort by, with direction (asc or desc).
399
- NOTE: fields will require a specialty index to use this, consult with the team.
400
-
401
- index_id: filter by organization
402
-
403
- extra_headers: Send extra headers
404
-
405
- extra_query: Add additional query parameters to the request
406
-
407
- extra_body: Add additional JSON properties to the request
408
-
409
- timeout: Override the client-level default timeout for this request, in seconds
410
- """
411
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
412
- return await self._post(
413
- "/features",
414
- body=await async_maybe_transform(
415
- {
416
- "collection_ids": collection_ids,
417
- "filters": filters,
418
- "select": select,
419
- "sort": sort,
420
- },
421
- feature_list_params.FeatureListParams,
422
- ),
423
- options=make_request_options(
424
- extra_headers=extra_headers,
425
- extra_query=extra_query,
426
- extra_body=extra_body,
427
- timeout=timeout,
428
- query=await async_maybe_transform(
429
- {
430
- "offset_feature_id": offset_feature_id,
431
- "page_size": page_size,
432
- },
433
- feature_list_params.FeatureListParams,
434
- ),
435
- ),
436
- cast_to=FeatureListResponse,
437
- )
438
-
439
- async def delete(
440
- self,
441
- feature_id: str,
442
- *,
443
- index_id: str | NotGiven = NOT_GIVEN,
444
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
445
- # The extra values given here take precedence over values defined on the client or passed to this method.
446
- extra_headers: Headers | None = None,
447
- extra_query: Query | None = None,
448
- extra_body: Body | None = None,
449
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
450
- ) -> object:
451
- """
452
- Delete Feature
453
-
454
- Args:
455
- index_id: filter by organization
456
-
457
- extra_headers: Send extra headers
458
-
459
- extra_query: Add additional query parameters to the request
460
-
461
- extra_body: Add additional JSON properties to the request
462
-
463
- timeout: Override the client-level default timeout for this request, in seconds
464
- """
465
- if not feature_id:
466
- raise ValueError(f"Expected a non-empty value for `feature_id` but received {feature_id!r}")
467
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
468
- return await self._delete(
469
- f"/features/{feature_id}",
470
- options=make_request_options(
471
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
472
- ),
473
- cast_to=object,
474
- )
475
-
476
-
477
- class FeaturesResourceWithRawResponse:
478
- def __init__(self, features: FeaturesResource) -> None:
479
- self._features = features
480
-
481
- self.retrieve = to_raw_response_wrapper(
482
- features.retrieve,
483
- )
484
- self.update = to_raw_response_wrapper(
485
- features.update,
486
- )
487
- self.list = to_raw_response_wrapper(
488
- features.list,
489
- )
490
- self.delete = to_raw_response_wrapper(
491
- features.delete,
492
- )
493
-
494
- @cached_property
495
- def search(self) -> SearchResourceWithRawResponse:
496
- return SearchResourceWithRawResponse(self._features.search)
497
-
498
-
499
- class AsyncFeaturesResourceWithRawResponse:
500
- def __init__(self, features: AsyncFeaturesResource) -> None:
501
- self._features = features
502
-
503
- self.retrieve = async_to_raw_response_wrapper(
504
- features.retrieve,
505
- )
506
- self.update = async_to_raw_response_wrapper(
507
- features.update,
508
- )
509
- self.list = async_to_raw_response_wrapper(
510
- features.list,
511
- )
512
- self.delete = async_to_raw_response_wrapper(
513
- features.delete,
514
- )
515
-
516
- @cached_property
517
- def search(self) -> AsyncSearchResourceWithRawResponse:
518
- return AsyncSearchResourceWithRawResponse(self._features.search)
519
-
520
-
521
- class FeaturesResourceWithStreamingResponse:
522
- def __init__(self, features: FeaturesResource) -> None:
523
- self._features = features
524
-
525
- self.retrieve = to_streamed_response_wrapper(
526
- features.retrieve,
527
- )
528
- self.update = to_streamed_response_wrapper(
529
- features.update,
530
- )
531
- self.list = to_streamed_response_wrapper(
532
- features.list,
533
- )
534
- self.delete = to_streamed_response_wrapper(
535
- features.delete,
536
- )
537
-
538
- @cached_property
539
- def search(self) -> SearchResourceWithStreamingResponse:
540
- return SearchResourceWithStreamingResponse(self._features.search)
541
-
542
-
543
- class AsyncFeaturesResourceWithStreamingResponse:
544
- def __init__(self, features: AsyncFeaturesResource) -> None:
545
- self._features = features
546
-
547
- self.retrieve = async_to_streamed_response_wrapper(
548
- features.retrieve,
549
- )
550
- self.update = async_to_streamed_response_wrapper(
551
- features.update,
552
- )
553
- self.list = async_to_streamed_response_wrapper(
554
- features.list,
555
- )
556
- self.delete = async_to_streamed_response_wrapper(
557
- features.delete,
558
- )
559
-
560
- @cached_property
561
- def search(self) -> AsyncSearchResourceWithStreamingResponse:
562
- return AsyncSearchResourceWithStreamingResponse(self._features.search)