mixpeek 0.8.41__py3-none-any.whl → 0.10.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. mixpeek/__init__.py +93 -1
  2. mixpeek/_base_client.py +2041 -0
  3. mixpeek/_client.py +444 -0
  4. mixpeek/_compat.py +219 -0
  5. mixpeek/_constants.py +14 -0
  6. mixpeek/_exceptions.py +108 -0
  7. mixpeek/_files.py +123 -0
  8. mixpeek/_models.py +785 -0
  9. mixpeek/_qs.py +150 -0
  10. mixpeek/_resource.py +43 -0
  11. mixpeek/_response.py +824 -0
  12. mixpeek/_streaming.py +333 -0
  13. mixpeek/_types.py +217 -0
  14. mixpeek/_utils/__init__.py +55 -0
  15. mixpeek/_utils/_logs.py +25 -0
  16. mixpeek/_utils/_proxy.py +62 -0
  17. mixpeek/_utils/_reflection.py +42 -0
  18. mixpeek/_utils/_streams.py +12 -0
  19. mixpeek/_utils/_sync.py +81 -0
  20. mixpeek/_utils/_transform.py +382 -0
  21. mixpeek/_utils/_typing.py +120 -0
  22. mixpeek/_utils/_utils.py +397 -0
  23. mixpeek/_version.py +4 -0
  24. mixpeek/lib/.keep +4 -0
  25. mixpeek/resources/__init__.py +159 -0
  26. mixpeek/resources/accounts/__init__.py +33 -0
  27. mixpeek/resources/accounts/accounts.py +102 -0
  28. mixpeek/resources/accounts/private.py +232 -0
  29. mixpeek/resources/agent/__init__.py +33 -0
  30. mixpeek/resources/agent/agent.py +225 -0
  31. mixpeek/resources/agent/task.py +189 -0
  32. mixpeek/resources/collections/__init__.py +33 -0
  33. mixpeek/resources/collections/collections.py +459 -0
  34. mixpeek/resources/collections/files.py +679 -0
  35. mixpeek/resources/describe.py +338 -0
  36. mixpeek/resources/embed.py +234 -0
  37. mixpeek/resources/indexes.py +506 -0
  38. mixpeek/resources/read.py +183 -0
  39. mixpeek/resources/recognize.py +183 -0
  40. mixpeek/resources/search.py +542 -0
  41. mixpeek/resources/tasks.py +294 -0
  42. mixpeek/resources/transcribe.py +192 -0
  43. mixpeek/types/__init__.py +19 -0
  44. mixpeek/types/accounts/__init__.py +6 -0
  45. mixpeek/types/accounts/private_update_params.py +25 -0
  46. mixpeek/types/accounts/user.py +32 -0
  47. mixpeek/types/agent/__init__.py +3 -0
  48. mixpeek/types/agent_create_params.py +18 -0
  49. mixpeek/types/agentresponse.py +11 -0
  50. mixpeek/types/collection_search_params.py +29 -0
  51. mixpeek/types/collections/__init__.py +9 -0
  52. mixpeek/types/collections/file_create_params.py +31 -0
  53. mixpeek/types/collections/file_full_params.py +22 -0
  54. mixpeek/types/collections/file_update_params.py +18 -0
  55. mixpeek/types/collections/fileresponse.py +23 -0
  56. mixpeek/types/collections/groupedfiledata.py +38 -0
  57. mixpeek/types/describe_upload_params.py +21 -0
  58. mixpeek/types/describe_url_params.py +20 -0
  59. mixpeek/types/embed_create_params.py +29 -0
  60. mixpeek/types/embeddingresponse.py +15 -0
  61. mixpeek/types/index_face_params.py +23 -0
  62. mixpeek/types/index_upload_params.py +27 -0
  63. mixpeek/types/index_url_params.py +159 -0
  64. mixpeek/types/search_text_params.py +45 -0
  65. mixpeek/types/search_upload_params.py +25 -0
  66. mixpeek/types/search_url_params.py +45 -0
  67. mixpeek/types/taskresponse.py +15 -0
  68. mixpeek/types/transcribe_url_params.py +18 -0
  69. mixpeek-0.10.0.dist-info/METADATA +356 -0
  70. mixpeek-0.10.0.dist-info/RECORD +73 -0
  71. {mixpeek-0.8.41.dist-info → mixpeek-0.10.0.dist-info}/WHEEL +1 -2
  72. mixpeek-0.10.0.dist-info/licenses/LICENSE +201 -0
  73. mixpeek/client.py +0 -27
  74. mixpeek/endpoints/collections.py +0 -86
  75. mixpeek/endpoints/embed.py +0 -66
  76. mixpeek/endpoints/index.py +0 -51
  77. mixpeek/endpoints/register.py +0 -34
  78. mixpeek/endpoints/search.py +0 -67
  79. mixpeek/endpoints/tasks.py +0 -26
  80. mixpeek/endpoints/tools.py +0 -138
  81. mixpeek/exceptions.py +0 -13
  82. mixpeek-0.8.41.dist-info/METADATA +0 -375
  83. mixpeek-0.8.41.dist-info/RECORD +0 -15
  84. mixpeek-0.8.41.dist-info/top_level.txt +0 -1
  85. /mixpeek/{endpoints/__init__.py → py.typed} +0 -0
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .files import (
4
+ FilesResource,
5
+ AsyncFilesResource,
6
+ FilesResourceWithRawResponse,
7
+ AsyncFilesResourceWithRawResponse,
8
+ FilesResourceWithStreamingResponse,
9
+ AsyncFilesResourceWithStreamingResponse,
10
+ )
11
+ from .collections import (
12
+ CollectionsResource,
13
+ AsyncCollectionsResource,
14
+ CollectionsResourceWithRawResponse,
15
+ AsyncCollectionsResourceWithRawResponse,
16
+ CollectionsResourceWithStreamingResponse,
17
+ AsyncCollectionsResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "FilesResource",
22
+ "AsyncFilesResource",
23
+ "FilesResourceWithRawResponse",
24
+ "AsyncFilesResourceWithRawResponse",
25
+ "FilesResourceWithStreamingResponse",
26
+ "AsyncFilesResourceWithStreamingResponse",
27
+ "CollectionsResource",
28
+ "AsyncCollectionsResource",
29
+ "CollectionsResourceWithRawResponse",
30
+ "AsyncCollectionsResourceWithRawResponse",
31
+ "CollectionsResourceWithStreamingResponse",
32
+ "AsyncCollectionsResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,459 @@
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
+ from typing_extensions import Literal
7
+
8
+ import httpx
9
+
10
+ from .files import (
11
+ FilesResource,
12
+ AsyncFilesResource,
13
+ FilesResourceWithRawResponse,
14
+ AsyncFilesResourceWithRawResponse,
15
+ FilesResourceWithStreamingResponse,
16
+ AsyncFilesResourceWithStreamingResponse,
17
+ )
18
+ from ...types import collection_search_params
19
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
20
+ from ..._utils import (
21
+ maybe_transform,
22
+ strip_not_given,
23
+ async_maybe_transform,
24
+ )
25
+ from ..._compat import cached_property
26
+ from ..._resource import SyncAPIResource, AsyncAPIResource
27
+ from ..._response import (
28
+ to_raw_response_wrapper,
29
+ to_streamed_response_wrapper,
30
+ async_to_raw_response_wrapper,
31
+ async_to_streamed_response_wrapper,
32
+ )
33
+ from ..._base_client import make_request_options
34
+
35
+ __all__ = ["CollectionsResource", "AsyncCollectionsResource"]
36
+
37
+
38
+ class CollectionsResource(SyncAPIResource):
39
+ @cached_property
40
+ def files(self) -> FilesResource:
41
+ return FilesResource(self._client)
42
+
43
+ @cached_property
44
+ def with_raw_response(self) -> CollectionsResourceWithRawResponse:
45
+ """
46
+ This property can be used as a prefix for any HTTP method call to return the
47
+ the raw response object instead of the parsed content.
48
+
49
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
50
+ """
51
+ return CollectionsResourceWithRawResponse(self)
52
+
53
+ @cached_property
54
+ def with_streaming_response(self) -> CollectionsResourceWithStreamingResponse:
55
+ """
56
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
57
+
58
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
59
+ """
60
+ return CollectionsResourceWithStreamingResponse(self)
61
+
62
+ def list(
63
+ self,
64
+ *,
65
+ authorization: str | NotGiven = NOT_GIVEN,
66
+ index_id: str | NotGiven = NOT_GIVEN,
67
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
68
+ # The extra values given here take precedence over values defined on the client or passed to this method.
69
+ extra_headers: Headers | None = None,
70
+ extra_query: Query | None = None,
71
+ extra_body: Body | None = None,
72
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
73
+ ) -> object:
74
+ """
75
+ List Collections
76
+
77
+ Args:
78
+ index_id: filter by organization
79
+
80
+ extra_headers: Send extra headers
81
+
82
+ extra_query: Add additional query parameters to the request
83
+
84
+ extra_body: Add additional JSON properties to the request
85
+
86
+ timeout: Override the client-level default timeout for this request, in seconds
87
+ """
88
+ extra_headers = {
89
+ **strip_not_given(
90
+ {
91
+ "Authorization": authorization,
92
+ "index-id": index_id,
93
+ }
94
+ ),
95
+ **(extra_headers or {}),
96
+ }
97
+ return self._get(
98
+ "/collections/",
99
+ options=make_request_options(
100
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
101
+ ),
102
+ cast_to=object,
103
+ )
104
+
105
+ def delete(
106
+ self,
107
+ collection_id: str,
108
+ *,
109
+ authorization: str | NotGiven = NOT_GIVEN,
110
+ index_id: str | NotGiven = NOT_GIVEN,
111
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
112
+ # The extra values given here take precedence over values defined on the client or passed to this method.
113
+ extra_headers: Headers | None = None,
114
+ extra_query: Query | None = None,
115
+ extra_body: Body | None = None,
116
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
117
+ ) -> object:
118
+ """
119
+ Delete Collection
120
+
121
+ Args:
122
+ index_id: filter by organization
123
+
124
+ extra_headers: Send extra headers
125
+
126
+ extra_query: Add additional query parameters to the request
127
+
128
+ extra_body: Add additional JSON properties to the request
129
+
130
+ timeout: Override the client-level default timeout for this request, in seconds
131
+ """
132
+ if not collection_id:
133
+ raise ValueError(f"Expected a non-empty value for `collection_id` but received {collection_id!r}")
134
+ extra_headers = {
135
+ **strip_not_given(
136
+ {
137
+ "Authorization": authorization,
138
+ "index-id": index_id,
139
+ }
140
+ ),
141
+ **(extra_headers or {}),
142
+ }
143
+ return self._delete(
144
+ f"/collections/{collection_id}",
145
+ options=make_request_options(
146
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
147
+ ),
148
+ cast_to=object,
149
+ )
150
+
151
+ def search(
152
+ self,
153
+ *,
154
+ collection_id: str,
155
+ query: str,
156
+ page: int | NotGiven = NOT_GIVEN,
157
+ page_size: int | NotGiven = NOT_GIVEN,
158
+ sort_by: Optional[str] | NotGiven = NOT_GIVEN,
159
+ sort_order: Optional[Literal["asc", "desc"]] | NotGiven = NOT_GIVEN,
160
+ authorization: str | NotGiven = NOT_GIVEN,
161
+ index_id: str | NotGiven = NOT_GIVEN,
162
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
163
+ # The extra values given here take precedence over values defined on the client or passed to this method.
164
+ extra_headers: Headers | None = None,
165
+ extra_query: Query | None = None,
166
+ extra_body: Body | None = None,
167
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
168
+ ) -> object:
169
+ """
170
+ Search Files
171
+
172
+ Args:
173
+ index_id: filter by organization
174
+
175
+ extra_headers: Send extra headers
176
+
177
+ extra_query: Add additional query parameters to the request
178
+
179
+ extra_body: Add additional JSON properties to the request
180
+
181
+ timeout: Override the client-level default timeout for this request, in seconds
182
+ """
183
+ extra_headers = {
184
+ **strip_not_given(
185
+ {
186
+ "Authorization": authorization,
187
+ "index-id": index_id,
188
+ }
189
+ ),
190
+ **(extra_headers or {}),
191
+ }
192
+ return self._post(
193
+ "/collections/search",
194
+ body=maybe_transform(
195
+ {
196
+ "collection_id": collection_id,
197
+ "query": query,
198
+ "page": page,
199
+ "page_size": page_size,
200
+ "sort_by": sort_by,
201
+ "sort_order": sort_order,
202
+ },
203
+ collection_search_params.CollectionSearchParams,
204
+ ),
205
+ options=make_request_options(
206
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
207
+ ),
208
+ cast_to=object,
209
+ )
210
+
211
+
212
+ class AsyncCollectionsResource(AsyncAPIResource):
213
+ @cached_property
214
+ def files(self) -> AsyncFilesResource:
215
+ return AsyncFilesResource(self._client)
216
+
217
+ @cached_property
218
+ def with_raw_response(self) -> AsyncCollectionsResourceWithRawResponse:
219
+ """
220
+ This property can be used as a prefix for any HTTP method call to return the
221
+ the raw response object instead of the parsed content.
222
+
223
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
224
+ """
225
+ return AsyncCollectionsResourceWithRawResponse(self)
226
+
227
+ @cached_property
228
+ def with_streaming_response(self) -> AsyncCollectionsResourceWithStreamingResponse:
229
+ """
230
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
231
+
232
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
233
+ """
234
+ return AsyncCollectionsResourceWithStreamingResponse(self)
235
+
236
+ async def list(
237
+ self,
238
+ *,
239
+ authorization: str | NotGiven = NOT_GIVEN,
240
+ index_id: str | NotGiven = NOT_GIVEN,
241
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
242
+ # The extra values given here take precedence over values defined on the client or passed to this method.
243
+ extra_headers: Headers | None = None,
244
+ extra_query: Query | None = None,
245
+ extra_body: Body | None = None,
246
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
247
+ ) -> object:
248
+ """
249
+ List Collections
250
+
251
+ Args:
252
+ index_id: filter by organization
253
+
254
+ extra_headers: Send extra headers
255
+
256
+ extra_query: Add additional query parameters to the request
257
+
258
+ extra_body: Add additional JSON properties to the request
259
+
260
+ timeout: Override the client-level default timeout for this request, in seconds
261
+ """
262
+ extra_headers = {
263
+ **strip_not_given(
264
+ {
265
+ "Authorization": authorization,
266
+ "index-id": index_id,
267
+ }
268
+ ),
269
+ **(extra_headers or {}),
270
+ }
271
+ return await self._get(
272
+ "/collections/",
273
+ options=make_request_options(
274
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
275
+ ),
276
+ cast_to=object,
277
+ )
278
+
279
+ async def delete(
280
+ self,
281
+ collection_id: str,
282
+ *,
283
+ authorization: str | NotGiven = NOT_GIVEN,
284
+ index_id: str | NotGiven = NOT_GIVEN,
285
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
286
+ # The extra values given here take precedence over values defined on the client or passed to this method.
287
+ extra_headers: Headers | None = None,
288
+ extra_query: Query | None = None,
289
+ extra_body: Body | None = None,
290
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
291
+ ) -> object:
292
+ """
293
+ Delete Collection
294
+
295
+ Args:
296
+ index_id: filter by organization
297
+
298
+ extra_headers: Send extra headers
299
+
300
+ extra_query: Add additional query parameters to the request
301
+
302
+ extra_body: Add additional JSON properties to the request
303
+
304
+ timeout: Override the client-level default timeout for this request, in seconds
305
+ """
306
+ if not collection_id:
307
+ raise ValueError(f"Expected a non-empty value for `collection_id` but received {collection_id!r}")
308
+ extra_headers = {
309
+ **strip_not_given(
310
+ {
311
+ "Authorization": authorization,
312
+ "index-id": index_id,
313
+ }
314
+ ),
315
+ **(extra_headers or {}),
316
+ }
317
+ return await self._delete(
318
+ f"/collections/{collection_id}",
319
+ options=make_request_options(
320
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
321
+ ),
322
+ cast_to=object,
323
+ )
324
+
325
+ async def search(
326
+ self,
327
+ *,
328
+ collection_id: str,
329
+ query: str,
330
+ page: int | NotGiven = NOT_GIVEN,
331
+ page_size: int | NotGiven = NOT_GIVEN,
332
+ sort_by: Optional[str] | NotGiven = NOT_GIVEN,
333
+ sort_order: Optional[Literal["asc", "desc"]] | NotGiven = NOT_GIVEN,
334
+ authorization: str | NotGiven = NOT_GIVEN,
335
+ index_id: str | NotGiven = NOT_GIVEN,
336
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
337
+ # The extra values given here take precedence over values defined on the client or passed to this method.
338
+ extra_headers: Headers | None = None,
339
+ extra_query: Query | None = None,
340
+ extra_body: Body | None = None,
341
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
342
+ ) -> object:
343
+ """
344
+ Search Files
345
+
346
+ Args:
347
+ index_id: filter by organization
348
+
349
+ extra_headers: Send extra headers
350
+
351
+ extra_query: Add additional query parameters to the request
352
+
353
+ extra_body: Add additional JSON properties to the request
354
+
355
+ timeout: Override the client-level default timeout for this request, in seconds
356
+ """
357
+ extra_headers = {
358
+ **strip_not_given(
359
+ {
360
+ "Authorization": authorization,
361
+ "index-id": index_id,
362
+ }
363
+ ),
364
+ **(extra_headers or {}),
365
+ }
366
+ return await self._post(
367
+ "/collections/search",
368
+ body=await async_maybe_transform(
369
+ {
370
+ "collection_id": collection_id,
371
+ "query": query,
372
+ "page": page,
373
+ "page_size": page_size,
374
+ "sort_by": sort_by,
375
+ "sort_order": sort_order,
376
+ },
377
+ collection_search_params.CollectionSearchParams,
378
+ ),
379
+ options=make_request_options(
380
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
381
+ ),
382
+ cast_to=object,
383
+ )
384
+
385
+
386
+ class CollectionsResourceWithRawResponse:
387
+ def __init__(self, collections: CollectionsResource) -> None:
388
+ self._collections = collections
389
+
390
+ self.list = to_raw_response_wrapper(
391
+ collections.list,
392
+ )
393
+ self.delete = to_raw_response_wrapper(
394
+ collections.delete,
395
+ )
396
+ self.search = to_raw_response_wrapper(
397
+ collections.search,
398
+ )
399
+
400
+ @cached_property
401
+ def files(self) -> FilesResourceWithRawResponse:
402
+ return FilesResourceWithRawResponse(self._collections.files)
403
+
404
+
405
+ class AsyncCollectionsResourceWithRawResponse:
406
+ def __init__(self, collections: AsyncCollectionsResource) -> None:
407
+ self._collections = collections
408
+
409
+ self.list = async_to_raw_response_wrapper(
410
+ collections.list,
411
+ )
412
+ self.delete = async_to_raw_response_wrapper(
413
+ collections.delete,
414
+ )
415
+ self.search = async_to_raw_response_wrapper(
416
+ collections.search,
417
+ )
418
+
419
+ @cached_property
420
+ def files(self) -> AsyncFilesResourceWithRawResponse:
421
+ return AsyncFilesResourceWithRawResponse(self._collections.files)
422
+
423
+
424
+ class CollectionsResourceWithStreamingResponse:
425
+ def __init__(self, collections: CollectionsResource) -> None:
426
+ self._collections = collections
427
+
428
+ self.list = to_streamed_response_wrapper(
429
+ collections.list,
430
+ )
431
+ self.delete = to_streamed_response_wrapper(
432
+ collections.delete,
433
+ )
434
+ self.search = to_streamed_response_wrapper(
435
+ collections.search,
436
+ )
437
+
438
+ @cached_property
439
+ def files(self) -> FilesResourceWithStreamingResponse:
440
+ return FilesResourceWithStreamingResponse(self._collections.files)
441
+
442
+
443
+ class AsyncCollectionsResourceWithStreamingResponse:
444
+ def __init__(self, collections: AsyncCollectionsResource) -> None:
445
+ self._collections = collections
446
+
447
+ self.list = async_to_streamed_response_wrapper(
448
+ collections.list,
449
+ )
450
+ self.delete = async_to_streamed_response_wrapper(
451
+ collections.delete,
452
+ )
453
+ self.search = async_to_streamed_response_wrapper(
454
+ collections.search,
455
+ )
456
+
457
+ @cached_property
458
+ def files(self) -> AsyncFilesResourceWithStreamingResponse:
459
+ return AsyncFilesResourceWithStreamingResponse(self._collections.files)