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,289 +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 Optional
6
-
7
- import httpx
8
-
9
- from .images import (
10
- ImagesResource,
11
- AsyncImagesResource,
12
- ImagesResourceWithRawResponse,
13
- AsyncImagesResourceWithRawResponse,
14
- ImagesResourceWithStreamingResponse,
15
- AsyncImagesResourceWithStreamingResponse,
16
- )
17
- from .videos import (
18
- VideosResource,
19
- AsyncVideosResource,
20
- VideosResourceWithRawResponse,
21
- AsyncVideosResourceWithRawResponse,
22
- VideosResourceWithStreamingResponse,
23
- AsyncVideosResourceWithStreamingResponse,
24
- )
25
- from ...types import index_text_params
26
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
27
- from ..._utils import (
28
- maybe_transform,
29
- strip_not_given,
30
- async_maybe_transform,
31
- )
32
- from ..._compat import cached_property
33
- from ..._resource import SyncAPIResource, AsyncAPIResource
34
- from ..._response import (
35
- to_raw_response_wrapper,
36
- to_streamed_response_wrapper,
37
- async_to_raw_response_wrapper,
38
- async_to_streamed_response_wrapper,
39
- )
40
- from ..._base_client import make_request_options
41
- from ...types.index_text_response import IndexTextResponse
42
-
43
- __all__ = ["IndexResource", "AsyncIndexResource"]
44
-
45
-
46
- class IndexResource(SyncAPIResource):
47
- @cached_property
48
- def videos(self) -> VideosResource:
49
- return VideosResource(self._client)
50
-
51
- @cached_property
52
- def images(self) -> ImagesResource:
53
- return ImagesResource(self._client)
54
-
55
- @cached_property
56
- def with_raw_response(self) -> IndexResourceWithRawResponse:
57
- """
58
- This property can be used as a prefix for any HTTP method call to return the
59
- the raw response object instead of the parsed content.
60
-
61
- For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
62
- """
63
- return IndexResourceWithRawResponse(self)
64
-
65
- @cached_property
66
- def with_streaming_response(self) -> IndexResourceWithStreamingResponse:
67
- """
68
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
69
-
70
- For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
71
- """
72
- return IndexResourceWithStreamingResponse(self)
73
-
74
- def text(
75
- self,
76
- *,
77
- collection_id: str,
78
- text: str,
79
- asset_update: Optional[index_text_params.AssetUpdate] | NotGiven = NOT_GIVEN,
80
- metadata: object | NotGiven = NOT_GIVEN,
81
- text_settings: Optional[index_text_params.TextSettings] | NotGiven = NOT_GIVEN,
82
- index_id: str | NotGiven = NOT_GIVEN,
83
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
84
- # The extra values given here take precedence over values defined on the client or passed to this method.
85
- extra_headers: Headers | None = None,
86
- extra_query: Query | None = None,
87
- extra_body: Body | None = None,
88
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
89
- ) -> IndexTextResponse:
90
- """
91
- Index Text
92
-
93
- Args:
94
- collection_id: Unique identifier for the collection where the processed asset will be stored.
95
-
96
- text: The text to be processed.
97
-
98
- asset_update: Asset update information for existing assets
99
-
100
- metadata: Additional metadata associated with the file. Can include any key-value pairs
101
- relevant to the file.
102
-
103
- text_settings: Settings for text processing.
104
-
105
- index_id: filter by organization
106
-
107
- extra_headers: Send extra headers
108
-
109
- extra_query: Add additional query parameters to the request
110
-
111
- extra_body: Add additional JSON properties to the request
112
-
113
- timeout: Override the client-level default timeout for this request, in seconds
114
- """
115
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
116
- return self._post(
117
- "/index/text",
118
- body=maybe_transform(
119
- {
120
- "collection_id": collection_id,
121
- "text": text,
122
- "asset_update": asset_update,
123
- "metadata": metadata,
124
- "text_settings": text_settings,
125
- },
126
- index_text_params.IndexTextParams,
127
- ),
128
- options=make_request_options(
129
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
130
- ),
131
- cast_to=IndexTextResponse,
132
- )
133
-
134
-
135
- class AsyncIndexResource(AsyncAPIResource):
136
- @cached_property
137
- def videos(self) -> AsyncVideosResource:
138
- return AsyncVideosResource(self._client)
139
-
140
- @cached_property
141
- def images(self) -> AsyncImagesResource:
142
- return AsyncImagesResource(self._client)
143
-
144
- @cached_property
145
- def with_raw_response(self) -> AsyncIndexResourceWithRawResponse:
146
- """
147
- This property can be used as a prefix for any HTTP method call to return the
148
- the raw response object instead of the parsed content.
149
-
150
- For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
151
- """
152
- return AsyncIndexResourceWithRawResponse(self)
153
-
154
- @cached_property
155
- def with_streaming_response(self) -> AsyncIndexResourceWithStreamingResponse:
156
- """
157
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
158
-
159
- For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
160
- """
161
- return AsyncIndexResourceWithStreamingResponse(self)
162
-
163
- async def text(
164
- self,
165
- *,
166
- collection_id: str,
167
- text: str,
168
- asset_update: Optional[index_text_params.AssetUpdate] | NotGiven = NOT_GIVEN,
169
- metadata: object | NotGiven = NOT_GIVEN,
170
- text_settings: Optional[index_text_params.TextSettings] | NotGiven = NOT_GIVEN,
171
- index_id: str | NotGiven = NOT_GIVEN,
172
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
173
- # The extra values given here take precedence over values defined on the client or passed to this method.
174
- extra_headers: Headers | None = None,
175
- extra_query: Query | None = None,
176
- extra_body: Body | None = None,
177
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
178
- ) -> IndexTextResponse:
179
- """
180
- Index Text
181
-
182
- Args:
183
- collection_id: Unique identifier for the collection where the processed asset will be stored.
184
-
185
- text: The text to be processed.
186
-
187
- asset_update: Asset update information for existing assets
188
-
189
- metadata: Additional metadata associated with the file. Can include any key-value pairs
190
- relevant to the file.
191
-
192
- text_settings: Settings for text processing.
193
-
194
- index_id: filter by organization
195
-
196
- extra_headers: Send extra headers
197
-
198
- extra_query: Add additional query parameters to the request
199
-
200
- extra_body: Add additional JSON properties to the request
201
-
202
- timeout: Override the client-level default timeout for this request, in seconds
203
- """
204
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
205
- return await self._post(
206
- "/index/text",
207
- body=await async_maybe_transform(
208
- {
209
- "collection_id": collection_id,
210
- "text": text,
211
- "asset_update": asset_update,
212
- "metadata": metadata,
213
- "text_settings": text_settings,
214
- },
215
- index_text_params.IndexTextParams,
216
- ),
217
- options=make_request_options(
218
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
219
- ),
220
- cast_to=IndexTextResponse,
221
- )
222
-
223
-
224
- class IndexResourceWithRawResponse:
225
- def __init__(self, index: IndexResource) -> None:
226
- self._index = index
227
-
228
- self.text = to_raw_response_wrapper(
229
- index.text,
230
- )
231
-
232
- @cached_property
233
- def videos(self) -> VideosResourceWithRawResponse:
234
- return VideosResourceWithRawResponse(self._index.videos)
235
-
236
- @cached_property
237
- def images(self) -> ImagesResourceWithRawResponse:
238
- return ImagesResourceWithRawResponse(self._index.images)
239
-
240
-
241
- class AsyncIndexResourceWithRawResponse:
242
- def __init__(self, index: AsyncIndexResource) -> None:
243
- self._index = index
244
-
245
- self.text = async_to_raw_response_wrapper(
246
- index.text,
247
- )
248
-
249
- @cached_property
250
- def videos(self) -> AsyncVideosResourceWithRawResponse:
251
- return AsyncVideosResourceWithRawResponse(self._index.videos)
252
-
253
- @cached_property
254
- def images(self) -> AsyncImagesResourceWithRawResponse:
255
- return AsyncImagesResourceWithRawResponse(self._index.images)
256
-
257
-
258
- class IndexResourceWithStreamingResponse:
259
- def __init__(self, index: IndexResource) -> None:
260
- self._index = index
261
-
262
- self.text = to_streamed_response_wrapper(
263
- index.text,
264
- )
265
-
266
- @cached_property
267
- def videos(self) -> VideosResourceWithStreamingResponse:
268
- return VideosResourceWithStreamingResponse(self._index.videos)
269
-
270
- @cached_property
271
- def images(self) -> ImagesResourceWithStreamingResponse:
272
- return ImagesResourceWithStreamingResponse(self._index.images)
273
-
274
-
275
- class AsyncIndexResourceWithStreamingResponse:
276
- def __init__(self, index: AsyncIndexResource) -> None:
277
- self._index = index
278
-
279
- self.text = async_to_streamed_response_wrapper(
280
- index.text,
281
- )
282
-
283
- @cached_property
284
- def videos(self) -> AsyncVideosResourceWithStreamingResponse:
285
- return AsyncVideosResourceWithStreamingResponse(self._index.videos)
286
-
287
- @cached_property
288
- def images(self) -> AsyncImagesResourceWithStreamingResponse:
289
- return AsyncImagesResourceWithStreamingResponse(self._index.images)
@@ -1,249 +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 Any, Iterable, Optional, cast
6
-
7
- import httpx
8
-
9
- from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
10
- from ..._utils import (
11
- maybe_transform,
12
- strip_not_given,
13
- async_maybe_transform,
14
- )
15
- from ..._compat import cached_property
16
- from ..._resource import SyncAPIResource, AsyncAPIResource
17
- from ..._response import (
18
- to_raw_response_wrapper,
19
- to_streamed_response_wrapper,
20
- async_to_raw_response_wrapper,
21
- async_to_streamed_response_wrapper,
22
- )
23
- from ...types.index import video_url_params
24
- from ..._base_client import make_request_options
25
- from ...types.index.video_url_response import VideoURLResponse
26
-
27
- __all__ = ["VideosResource", "AsyncVideosResource"]
28
-
29
-
30
- class VideosResource(SyncAPIResource):
31
- @cached_property
32
- def with_raw_response(self) -> VideosResourceWithRawResponse:
33
- """
34
- This property can be used as a prefix for any HTTP method call to return the
35
- the raw response object instead of the parsed content.
36
-
37
- For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
38
- """
39
- return VideosResourceWithRawResponse(self)
40
-
41
- @cached_property
42
- def with_streaming_response(self) -> VideosResourceWithStreamingResponse:
43
- """
44
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
45
-
46
- For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
47
- """
48
- return VideosResourceWithStreamingResponse(self)
49
-
50
- def url(
51
- self,
52
- *,
53
- collection_id: str,
54
- url: str,
55
- asset_update: Optional[video_url_params.AssetUpdate] | NotGiven = NOT_GIVEN,
56
- metadata: object | NotGiven = NOT_GIVEN,
57
- prevent_duplicate: Optional[bool] | NotGiven = NOT_GIVEN,
58
- should_save: Optional[bool] | NotGiven = NOT_GIVEN,
59
- video_settings: Optional[Iterable[video_url_params.VideoSetting]] | NotGiven = NOT_GIVEN,
60
- index_id: str | NotGiven = NOT_GIVEN,
61
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
62
- # The extra values given here take precedence over values defined on the client or passed to this method.
63
- extra_headers: Headers | None = None,
64
- extra_query: Query | None = None,
65
- extra_body: Body | None = None,
66
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
67
- ) -> VideoURLResponse:
68
- """
69
- Index Video Url
70
-
71
- Args:
72
- collection_id: Unique identifier for the collection where the processed asset will be stored.
73
-
74
- url: The URL of the asset to be processed. Must be a valid HTTP or HTTPS URL.
75
-
76
- asset_update: Asset update information for existing assets
77
-
78
- metadata: Additional metadata associated with the asset. Can include any key-value pairs
79
- relevant to the asset.
80
-
81
- prevent_duplicate: Indicates whether to prevent duplicate processing of the same URL.
82
-
83
- should_save: Indicates whether the processed asset should be uploaded to S3 storage.
84
-
85
- video_settings: Settings for video processing. Only applicable if the URL points to a video
86
- file.
87
-
88
- index_id: filter by organization
89
-
90
- extra_headers: Send extra headers
91
-
92
- extra_query: Add additional query parameters to the request
93
-
94
- extra_body: Add additional JSON properties to the request
95
-
96
- timeout: Override the client-level default timeout for this request, in seconds
97
- """
98
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
99
- return cast(
100
- VideoURLResponse,
101
- self._post(
102
- "/index/videos/url",
103
- body=maybe_transform(
104
- {
105
- "collection_id": collection_id,
106
- "url": url,
107
- "asset_update": asset_update,
108
- "metadata": metadata,
109
- "prevent_duplicate": prevent_duplicate,
110
- "should_save": should_save,
111
- "video_settings": video_settings,
112
- },
113
- video_url_params.VideoURLParams,
114
- ),
115
- options=make_request_options(
116
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
117
- ),
118
- cast_to=cast(Any, VideoURLResponse), # Union types cannot be passed in as arguments in the type system
119
- ),
120
- )
121
-
122
-
123
- class AsyncVideosResource(AsyncAPIResource):
124
- @cached_property
125
- def with_raw_response(self) -> AsyncVideosResourceWithRawResponse:
126
- """
127
- This property can be used as a prefix for any HTTP method call to return the
128
- the raw response object instead of the parsed content.
129
-
130
- For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
131
- """
132
- return AsyncVideosResourceWithRawResponse(self)
133
-
134
- @cached_property
135
- def with_streaming_response(self) -> AsyncVideosResourceWithStreamingResponse:
136
- """
137
- An alternative to `.with_raw_response` that doesn't eagerly read the response body.
138
-
139
- For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
140
- """
141
- return AsyncVideosResourceWithStreamingResponse(self)
142
-
143
- async def url(
144
- self,
145
- *,
146
- collection_id: str,
147
- url: str,
148
- asset_update: Optional[video_url_params.AssetUpdate] | NotGiven = NOT_GIVEN,
149
- metadata: object | NotGiven = NOT_GIVEN,
150
- prevent_duplicate: Optional[bool] | NotGiven = NOT_GIVEN,
151
- should_save: Optional[bool] | NotGiven = NOT_GIVEN,
152
- video_settings: Optional[Iterable[video_url_params.VideoSetting]] | NotGiven = NOT_GIVEN,
153
- index_id: str | NotGiven = NOT_GIVEN,
154
- # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
155
- # The extra values given here take precedence over values defined on the client or passed to this method.
156
- extra_headers: Headers | None = None,
157
- extra_query: Query | None = None,
158
- extra_body: Body | None = None,
159
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
160
- ) -> VideoURLResponse:
161
- """
162
- Index Video Url
163
-
164
- Args:
165
- collection_id: Unique identifier for the collection where the processed asset will be stored.
166
-
167
- url: The URL of the asset to be processed. Must be a valid HTTP or HTTPS URL.
168
-
169
- asset_update: Asset update information for existing assets
170
-
171
- metadata: Additional metadata associated with the asset. Can include any key-value pairs
172
- relevant to the asset.
173
-
174
- prevent_duplicate: Indicates whether to prevent duplicate processing of the same URL.
175
-
176
- should_save: Indicates whether the processed asset should be uploaded to S3 storage.
177
-
178
- video_settings: Settings for video processing. Only applicable if the URL points to a video
179
- file.
180
-
181
- index_id: filter by organization
182
-
183
- extra_headers: Send extra headers
184
-
185
- extra_query: Add additional query parameters to the request
186
-
187
- extra_body: Add additional JSON properties to the request
188
-
189
- timeout: Override the client-level default timeout for this request, in seconds
190
- """
191
- extra_headers = {**strip_not_given({"index-id": index_id}), **(extra_headers or {})}
192
- return cast(
193
- VideoURLResponse,
194
- await self._post(
195
- "/index/videos/url",
196
- body=await async_maybe_transform(
197
- {
198
- "collection_id": collection_id,
199
- "url": url,
200
- "asset_update": asset_update,
201
- "metadata": metadata,
202
- "prevent_duplicate": prevent_duplicate,
203
- "should_save": should_save,
204
- "video_settings": video_settings,
205
- },
206
- video_url_params.VideoURLParams,
207
- ),
208
- options=make_request_options(
209
- extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
210
- ),
211
- cast_to=cast(Any, VideoURLResponse), # Union types cannot be passed in as arguments in the type system
212
- ),
213
- )
214
-
215
-
216
- class VideosResourceWithRawResponse:
217
- def __init__(self, videos: VideosResource) -> None:
218
- self._videos = videos
219
-
220
- self.url = to_raw_response_wrapper(
221
- videos.url,
222
- )
223
-
224
-
225
- class AsyncVideosResourceWithRawResponse:
226
- def __init__(self, videos: AsyncVideosResource) -> None:
227
- self._videos = videos
228
-
229
- self.url = async_to_raw_response_wrapper(
230
- videos.url,
231
- )
232
-
233
-
234
- class VideosResourceWithStreamingResponse:
235
- def __init__(self, videos: VideosResource) -> None:
236
- self._videos = videos
237
-
238
- self.url = to_streamed_response_wrapper(
239
- videos.url,
240
- )
241
-
242
-
243
- class AsyncVideosResourceWithStreamingResponse:
244
- def __init__(self, videos: AsyncVideosResource) -> None:
245
- self._videos = videos
246
-
247
- self.url = async_to_streamed_response_wrapper(
248
- videos.url,
249
- )