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,397 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import re
5
+ import inspect
6
+ import functools
7
+ from typing import (
8
+ Any,
9
+ Tuple,
10
+ Mapping,
11
+ TypeVar,
12
+ Callable,
13
+ Iterable,
14
+ Sequence,
15
+ cast,
16
+ overload,
17
+ )
18
+ from pathlib import Path
19
+ from typing_extensions import TypeGuard
20
+
21
+ import sniffio
22
+
23
+ from .._types import NotGiven, FileTypes, NotGivenOr, HeadersLike
24
+ from .._compat import parse_date as parse_date, parse_datetime as parse_datetime
25
+
26
+ _T = TypeVar("_T")
27
+ _TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
28
+ _MappingT = TypeVar("_MappingT", bound=Mapping[str, object])
29
+ _SequenceT = TypeVar("_SequenceT", bound=Sequence[object])
30
+ CallableT = TypeVar("CallableT", bound=Callable[..., Any])
31
+
32
+
33
+ def flatten(t: Iterable[Iterable[_T]]) -> list[_T]:
34
+ return [item for sublist in t for item in sublist]
35
+
36
+
37
+ def extract_files(
38
+ # TODO: this needs to take Dict but variance issues.....
39
+ # create protocol type ?
40
+ query: Mapping[str, object],
41
+ *,
42
+ paths: Sequence[Sequence[str]],
43
+ ) -> list[tuple[str, FileTypes]]:
44
+ """Recursively extract files from the given dictionary based on specified paths.
45
+
46
+ A path may look like this ['foo', 'files', '<array>', 'data'].
47
+
48
+ Note: this mutates the given dictionary.
49
+ """
50
+ files: list[tuple[str, FileTypes]] = []
51
+ for path in paths:
52
+ files.extend(_extract_items(query, path, index=0, flattened_key=None))
53
+ return files
54
+
55
+
56
+ def _extract_items(
57
+ obj: object,
58
+ path: Sequence[str],
59
+ *,
60
+ index: int,
61
+ flattened_key: str | None,
62
+ ) -> list[tuple[str, FileTypes]]:
63
+ try:
64
+ key = path[index]
65
+ except IndexError:
66
+ if isinstance(obj, NotGiven):
67
+ # no value was provided - we can safely ignore
68
+ return []
69
+
70
+ # cyclical import
71
+ from .._files import assert_is_file_content
72
+
73
+ # We have exhausted the path, return the entry we found.
74
+ assert_is_file_content(obj, key=flattened_key)
75
+ assert flattened_key is not None
76
+ return [(flattened_key, cast(FileTypes, obj))]
77
+
78
+ index += 1
79
+ if is_dict(obj):
80
+ try:
81
+ # We are at the last entry in the path so we must remove the field
82
+ if (len(path)) == index:
83
+ item = obj.pop(key)
84
+ else:
85
+ item = obj[key]
86
+ except KeyError:
87
+ # Key was not present in the dictionary, this is not indicative of an error
88
+ # as the given path may not point to a required field. We also do not want
89
+ # to enforce required fields as the API may differ from the spec in some cases.
90
+ return []
91
+ if flattened_key is None:
92
+ flattened_key = key
93
+ else:
94
+ flattened_key += f"[{key}]"
95
+ return _extract_items(
96
+ item,
97
+ path,
98
+ index=index,
99
+ flattened_key=flattened_key,
100
+ )
101
+ elif is_list(obj):
102
+ if key != "<array>":
103
+ return []
104
+
105
+ return flatten(
106
+ [
107
+ _extract_items(
108
+ item,
109
+ path,
110
+ index=index,
111
+ flattened_key=flattened_key + "[]" if flattened_key is not None else "[]",
112
+ )
113
+ for item in obj
114
+ ]
115
+ )
116
+
117
+ # Something unexpected was passed, just ignore it.
118
+ return []
119
+
120
+
121
+ def is_given(obj: NotGivenOr[_T]) -> TypeGuard[_T]:
122
+ return not isinstance(obj, NotGiven)
123
+
124
+
125
+ # Type safe methods for narrowing types with TypeVars.
126
+ # The default narrowing for isinstance(obj, dict) is dict[unknown, unknown],
127
+ # however this cause Pyright to rightfully report errors. As we know we don't
128
+ # care about the contained types we can safely use `object` in it's place.
129
+ #
130
+ # There are two separate functions defined, `is_*` and `is_*_t` for different use cases.
131
+ # `is_*` is for when you're dealing with an unknown input
132
+ # `is_*_t` is for when you're narrowing a known union type to a specific subset
133
+
134
+
135
+ def is_tuple(obj: object) -> TypeGuard[tuple[object, ...]]:
136
+ return isinstance(obj, tuple)
137
+
138
+
139
+ def is_tuple_t(obj: _TupleT | object) -> TypeGuard[_TupleT]:
140
+ return isinstance(obj, tuple)
141
+
142
+
143
+ def is_sequence(obj: object) -> TypeGuard[Sequence[object]]:
144
+ return isinstance(obj, Sequence)
145
+
146
+
147
+ def is_sequence_t(obj: _SequenceT | object) -> TypeGuard[_SequenceT]:
148
+ return isinstance(obj, Sequence)
149
+
150
+
151
+ def is_mapping(obj: object) -> TypeGuard[Mapping[str, object]]:
152
+ return isinstance(obj, Mapping)
153
+
154
+
155
+ def is_mapping_t(obj: _MappingT | object) -> TypeGuard[_MappingT]:
156
+ return isinstance(obj, Mapping)
157
+
158
+
159
+ def is_dict(obj: object) -> TypeGuard[dict[object, object]]:
160
+ return isinstance(obj, dict)
161
+
162
+
163
+ def is_list(obj: object) -> TypeGuard[list[object]]:
164
+ return isinstance(obj, list)
165
+
166
+
167
+ def is_iterable(obj: object) -> TypeGuard[Iterable[object]]:
168
+ return isinstance(obj, Iterable)
169
+
170
+
171
+ def deepcopy_minimal(item: _T) -> _T:
172
+ """Minimal reimplementation of copy.deepcopy() that will only copy certain object types:
173
+
174
+ - mappings, e.g. `dict`
175
+ - list
176
+
177
+ This is done for performance reasons.
178
+ """
179
+ if is_mapping(item):
180
+ return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()})
181
+ if is_list(item):
182
+ return cast(_T, [deepcopy_minimal(entry) for entry in item])
183
+ return item
184
+
185
+
186
+ # copied from https://github.com/Rapptz/RoboDanny
187
+ def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str:
188
+ size = len(seq)
189
+ if size == 0:
190
+ return ""
191
+
192
+ if size == 1:
193
+ return seq[0]
194
+
195
+ if size == 2:
196
+ return f"{seq[0]} {final} {seq[1]}"
197
+
198
+ return delim.join(seq[:-1]) + f" {final} {seq[-1]}"
199
+
200
+
201
+ def quote(string: str) -> str:
202
+ """Add single quotation marks around the given string. Does *not* do any escaping."""
203
+ return f"'{string}'"
204
+
205
+
206
+ def required_args(*variants: Sequence[str]) -> Callable[[CallableT], CallableT]:
207
+ """Decorator to enforce a given set of arguments or variants of arguments are passed to the decorated function.
208
+
209
+ Useful for enforcing runtime validation of overloaded functions.
210
+
211
+ Example usage:
212
+ ```py
213
+ @overload
214
+ def foo(*, a: str) -> str: ...
215
+
216
+
217
+ @overload
218
+ def foo(*, b: bool) -> str: ...
219
+
220
+
221
+ # This enforces the same constraints that a static type checker would
222
+ # i.e. that either a or b must be passed to the function
223
+ @required_args(["a"], ["b"])
224
+ def foo(*, a: str | None = None, b: bool | None = None) -> str: ...
225
+ ```
226
+ """
227
+
228
+ def inner(func: CallableT) -> CallableT:
229
+ params = inspect.signature(func).parameters
230
+ positional = [
231
+ name
232
+ for name, param in params.items()
233
+ if param.kind
234
+ in {
235
+ param.POSITIONAL_ONLY,
236
+ param.POSITIONAL_OR_KEYWORD,
237
+ }
238
+ ]
239
+
240
+ @functools.wraps(func)
241
+ def wrapper(*args: object, **kwargs: object) -> object:
242
+ given_params: set[str] = set()
243
+ for i, _ in enumerate(args):
244
+ try:
245
+ given_params.add(positional[i])
246
+ except IndexError:
247
+ raise TypeError(
248
+ f"{func.__name__}() takes {len(positional)} argument(s) but {len(args)} were given"
249
+ ) from None
250
+
251
+ for key in kwargs.keys():
252
+ given_params.add(key)
253
+
254
+ for variant in variants:
255
+ matches = all((param in given_params for param in variant))
256
+ if matches:
257
+ break
258
+ else: # no break
259
+ if len(variants) > 1:
260
+ variations = human_join(
261
+ ["(" + human_join([quote(arg) for arg in variant], final="and") + ")" for variant in variants]
262
+ )
263
+ msg = f"Missing required arguments; Expected either {variations} arguments to be given"
264
+ else:
265
+ assert len(variants) > 0
266
+
267
+ # TODO: this error message is not deterministic
268
+ missing = list(set(variants[0]) - given_params)
269
+ if len(missing) > 1:
270
+ msg = f"Missing required arguments: {human_join([quote(arg) for arg in missing])}"
271
+ else:
272
+ msg = f"Missing required argument: {quote(missing[0])}"
273
+ raise TypeError(msg)
274
+ return func(*args, **kwargs)
275
+
276
+ return wrapper # type: ignore
277
+
278
+ return inner
279
+
280
+
281
+ _K = TypeVar("_K")
282
+ _V = TypeVar("_V")
283
+
284
+
285
+ @overload
286
+ def strip_not_given(obj: None) -> None: ...
287
+
288
+
289
+ @overload
290
+ def strip_not_given(obj: Mapping[_K, _V | NotGiven]) -> dict[_K, _V]: ...
291
+
292
+
293
+ @overload
294
+ def strip_not_given(obj: object) -> object: ...
295
+
296
+
297
+ def strip_not_given(obj: object | None) -> object:
298
+ """Remove all top-level keys where their values are instances of `NotGiven`"""
299
+ if obj is None:
300
+ return None
301
+
302
+ if not is_mapping(obj):
303
+ return obj
304
+
305
+ return {key: value for key, value in obj.items() if not isinstance(value, NotGiven)}
306
+
307
+
308
+ def coerce_integer(val: str) -> int:
309
+ return int(val, base=10)
310
+
311
+
312
+ def coerce_float(val: str) -> float:
313
+ return float(val)
314
+
315
+
316
+ def coerce_boolean(val: str) -> bool:
317
+ return val == "true" or val == "1" or val == "on"
318
+
319
+
320
+ def maybe_coerce_integer(val: str | None) -> int | None:
321
+ if val is None:
322
+ return None
323
+ return coerce_integer(val)
324
+
325
+
326
+ def maybe_coerce_float(val: str | None) -> float | None:
327
+ if val is None:
328
+ return None
329
+ return coerce_float(val)
330
+
331
+
332
+ def maybe_coerce_boolean(val: str | None) -> bool | None:
333
+ if val is None:
334
+ return None
335
+ return coerce_boolean(val)
336
+
337
+
338
+ def removeprefix(string: str, prefix: str) -> str:
339
+ """Remove a prefix from a string.
340
+
341
+ Backport of `str.removeprefix` for Python < 3.9
342
+ """
343
+ if string.startswith(prefix):
344
+ return string[len(prefix) :]
345
+ return string
346
+
347
+
348
+ def removesuffix(string: str, suffix: str) -> str:
349
+ """Remove a suffix from a string.
350
+
351
+ Backport of `str.removesuffix` for Python < 3.9
352
+ """
353
+ if string.endswith(suffix):
354
+ return string[: -len(suffix)]
355
+ return string
356
+
357
+
358
+ def file_from_path(path: str) -> FileTypes:
359
+ contents = Path(path).read_bytes()
360
+ file_name = os.path.basename(path)
361
+ return (file_name, contents)
362
+
363
+
364
+ def get_required_header(headers: HeadersLike, header: str) -> str:
365
+ lower_header = header.lower()
366
+ if is_mapping_t(headers):
367
+ # mypy doesn't understand the type narrowing here
368
+ for k, v in headers.items(): # type: ignore
369
+ if k.lower() == lower_header and isinstance(v, str):
370
+ return v
371
+
372
+ # to deal with the case where the header looks like Stainless-Event-Id
373
+ intercaps_header = re.sub(r"([^\w])(\w)", lambda pat: pat.group(1) + pat.group(2).upper(), header.capitalize())
374
+
375
+ for normalized_header in [header, lower_header, header.upper(), intercaps_header]:
376
+ value = headers.get(normalized_header)
377
+ if value:
378
+ return value
379
+
380
+ raise ValueError(f"Could not find {header} header")
381
+
382
+
383
+ def get_async_library() -> str:
384
+ try:
385
+ return sniffio.current_async_library()
386
+ except Exception:
387
+ return "false"
388
+
389
+
390
+ def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]:
391
+ """A version of functools.lru_cache that retains the type signature
392
+ for the wrapped function arguments.
393
+ """
394
+ wrapper = functools.lru_cache( # noqa: TID251
395
+ maxsize=maxsize,
396
+ )
397
+ return cast(Any, wrapper) # type: ignore[no-any-return]
mixpeek/_version.py ADDED
@@ -0,0 +1,4 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ __title__ = "mixpeek"
4
+ __version__ = "0.10.0" # x-release-please-version
mixpeek/lib/.keep ADDED
@@ -0,0 +1,4 @@
1
+ File generated from our OpenAPI spec by Stainless.
2
+
3
+ This directory can be used to store custom files to expand the SDK.
4
+ It is ignored by Stainless code generation and its content (other than this keep file) won't be touched.
@@ -0,0 +1,159 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .read import (
4
+ ReadResource,
5
+ AsyncReadResource,
6
+ ReadResourceWithRawResponse,
7
+ AsyncReadResourceWithRawResponse,
8
+ ReadResourceWithStreamingResponse,
9
+ AsyncReadResourceWithStreamingResponse,
10
+ )
11
+ from .agent import (
12
+ AgentResource,
13
+ AsyncAgentResource,
14
+ AgentResourceWithRawResponse,
15
+ AsyncAgentResourceWithRawResponse,
16
+ AgentResourceWithStreamingResponse,
17
+ AsyncAgentResourceWithStreamingResponse,
18
+ )
19
+ from .embed import (
20
+ EmbedResource,
21
+ AsyncEmbedResource,
22
+ EmbedResourceWithRawResponse,
23
+ AsyncEmbedResourceWithRawResponse,
24
+ EmbedResourceWithStreamingResponse,
25
+ AsyncEmbedResourceWithStreamingResponse,
26
+ )
27
+ from .tasks import (
28
+ TasksResource,
29
+ AsyncTasksResource,
30
+ TasksResourceWithRawResponse,
31
+ AsyncTasksResourceWithRawResponse,
32
+ TasksResourceWithStreamingResponse,
33
+ AsyncTasksResourceWithStreamingResponse,
34
+ )
35
+ from .search import (
36
+ SearchResource,
37
+ AsyncSearchResource,
38
+ SearchResourceWithRawResponse,
39
+ AsyncSearchResourceWithRawResponse,
40
+ SearchResourceWithStreamingResponse,
41
+ AsyncSearchResourceWithStreamingResponse,
42
+ )
43
+ from .indexes import (
44
+ IndexesResource,
45
+ AsyncIndexesResource,
46
+ IndexesResourceWithRawResponse,
47
+ AsyncIndexesResourceWithRawResponse,
48
+ IndexesResourceWithStreamingResponse,
49
+ AsyncIndexesResourceWithStreamingResponse,
50
+ )
51
+ from .accounts import (
52
+ AccountsResource,
53
+ AsyncAccountsResource,
54
+ AccountsResourceWithRawResponse,
55
+ AsyncAccountsResourceWithRawResponse,
56
+ AccountsResourceWithStreamingResponse,
57
+ AsyncAccountsResourceWithStreamingResponse,
58
+ )
59
+ from .describe import (
60
+ DescribeResource,
61
+ AsyncDescribeResource,
62
+ DescribeResourceWithRawResponse,
63
+ AsyncDescribeResourceWithRawResponse,
64
+ DescribeResourceWithStreamingResponse,
65
+ AsyncDescribeResourceWithStreamingResponse,
66
+ )
67
+ from .recognize import (
68
+ RecognizeResource,
69
+ AsyncRecognizeResource,
70
+ RecognizeResourceWithRawResponse,
71
+ AsyncRecognizeResourceWithRawResponse,
72
+ RecognizeResourceWithStreamingResponse,
73
+ AsyncRecognizeResourceWithStreamingResponse,
74
+ )
75
+ from .transcribe import (
76
+ TranscribeResource,
77
+ AsyncTranscribeResource,
78
+ TranscribeResourceWithRawResponse,
79
+ AsyncTranscribeResourceWithRawResponse,
80
+ TranscribeResourceWithStreamingResponse,
81
+ AsyncTranscribeResourceWithStreamingResponse,
82
+ )
83
+ from .collections import (
84
+ CollectionsResource,
85
+ AsyncCollectionsResource,
86
+ CollectionsResourceWithRawResponse,
87
+ AsyncCollectionsResourceWithRawResponse,
88
+ CollectionsResourceWithStreamingResponse,
89
+ AsyncCollectionsResourceWithStreamingResponse,
90
+ )
91
+
92
+ __all__ = [
93
+ "AccountsResource",
94
+ "AsyncAccountsResource",
95
+ "AccountsResourceWithRawResponse",
96
+ "AsyncAccountsResourceWithRawResponse",
97
+ "AccountsResourceWithStreamingResponse",
98
+ "AsyncAccountsResourceWithStreamingResponse",
99
+ "DescribeResource",
100
+ "AsyncDescribeResource",
101
+ "DescribeResourceWithRawResponse",
102
+ "AsyncDescribeResourceWithRawResponse",
103
+ "DescribeResourceWithStreamingResponse",
104
+ "AsyncDescribeResourceWithStreamingResponse",
105
+ "EmbedResource",
106
+ "AsyncEmbedResource",
107
+ "EmbedResourceWithRawResponse",
108
+ "AsyncEmbedResourceWithRawResponse",
109
+ "EmbedResourceWithStreamingResponse",
110
+ "AsyncEmbedResourceWithStreamingResponse",
111
+ "TranscribeResource",
112
+ "AsyncTranscribeResource",
113
+ "TranscribeResourceWithRawResponse",
114
+ "AsyncTranscribeResourceWithRawResponse",
115
+ "TranscribeResourceWithStreamingResponse",
116
+ "AsyncTranscribeResourceWithStreamingResponse",
117
+ "ReadResource",
118
+ "AsyncReadResource",
119
+ "ReadResourceWithRawResponse",
120
+ "AsyncReadResourceWithRawResponse",
121
+ "ReadResourceWithStreamingResponse",
122
+ "AsyncReadResourceWithStreamingResponse",
123
+ "RecognizeResource",
124
+ "AsyncRecognizeResource",
125
+ "RecognizeResourceWithRawResponse",
126
+ "AsyncRecognizeResourceWithRawResponse",
127
+ "RecognizeResourceWithStreamingResponse",
128
+ "AsyncRecognizeResourceWithStreamingResponse",
129
+ "AgentResource",
130
+ "AsyncAgentResource",
131
+ "AgentResourceWithRawResponse",
132
+ "AsyncAgentResourceWithRawResponse",
133
+ "AgentResourceWithStreamingResponse",
134
+ "AsyncAgentResourceWithStreamingResponse",
135
+ "IndexesResource",
136
+ "AsyncIndexesResource",
137
+ "IndexesResourceWithRawResponse",
138
+ "AsyncIndexesResourceWithRawResponse",
139
+ "IndexesResourceWithStreamingResponse",
140
+ "AsyncIndexesResourceWithStreamingResponse",
141
+ "SearchResource",
142
+ "AsyncSearchResource",
143
+ "SearchResourceWithRawResponse",
144
+ "AsyncSearchResourceWithRawResponse",
145
+ "SearchResourceWithStreamingResponse",
146
+ "AsyncSearchResourceWithStreamingResponse",
147
+ "CollectionsResource",
148
+ "AsyncCollectionsResource",
149
+ "CollectionsResourceWithRawResponse",
150
+ "AsyncCollectionsResourceWithRawResponse",
151
+ "CollectionsResourceWithStreamingResponse",
152
+ "AsyncCollectionsResourceWithStreamingResponse",
153
+ "TasksResource",
154
+ "AsyncTasksResource",
155
+ "TasksResourceWithRawResponse",
156
+ "AsyncTasksResourceWithRawResponse",
157
+ "TasksResourceWithStreamingResponse",
158
+ "AsyncTasksResourceWithStreamingResponse",
159
+ ]
@@ -0,0 +1,33 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from .private import (
4
+ PrivateResource,
5
+ AsyncPrivateResource,
6
+ PrivateResourceWithRawResponse,
7
+ AsyncPrivateResourceWithRawResponse,
8
+ PrivateResourceWithStreamingResponse,
9
+ AsyncPrivateResourceWithStreamingResponse,
10
+ )
11
+ from .accounts import (
12
+ AccountsResource,
13
+ AsyncAccountsResource,
14
+ AccountsResourceWithRawResponse,
15
+ AsyncAccountsResourceWithRawResponse,
16
+ AccountsResourceWithStreamingResponse,
17
+ AsyncAccountsResourceWithStreamingResponse,
18
+ )
19
+
20
+ __all__ = [
21
+ "PrivateResource",
22
+ "AsyncPrivateResource",
23
+ "PrivateResourceWithRawResponse",
24
+ "AsyncPrivateResourceWithRawResponse",
25
+ "PrivateResourceWithStreamingResponse",
26
+ "AsyncPrivateResourceWithStreamingResponse",
27
+ "AccountsResource",
28
+ "AsyncAccountsResource",
29
+ "AccountsResourceWithRawResponse",
30
+ "AsyncAccountsResourceWithRawResponse",
31
+ "AccountsResourceWithStreamingResponse",
32
+ "AsyncAccountsResourceWithStreamingResponse",
33
+ ]
@@ -0,0 +1,102 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .private import (
6
+ PrivateResource,
7
+ AsyncPrivateResource,
8
+ PrivateResourceWithRawResponse,
9
+ AsyncPrivateResourceWithRawResponse,
10
+ PrivateResourceWithStreamingResponse,
11
+ AsyncPrivateResourceWithStreamingResponse,
12
+ )
13
+ from ..._compat import cached_property
14
+ from ..._resource import SyncAPIResource, AsyncAPIResource
15
+
16
+ __all__ = ["AccountsResource", "AsyncAccountsResource"]
17
+
18
+
19
+ class AccountsResource(SyncAPIResource):
20
+ @cached_property
21
+ def private(self) -> PrivateResource:
22
+ return PrivateResource(self._client)
23
+
24
+ @cached_property
25
+ def with_raw_response(self) -> AccountsResourceWithRawResponse:
26
+ """
27
+ This property can be used as a prefix for any HTTP method call to return the
28
+ the raw response object instead of the parsed content.
29
+
30
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
31
+ """
32
+ return AccountsResourceWithRawResponse(self)
33
+
34
+ @cached_property
35
+ def with_streaming_response(self) -> AccountsResourceWithStreamingResponse:
36
+ """
37
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
38
+
39
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
40
+ """
41
+ return AccountsResourceWithStreamingResponse(self)
42
+
43
+
44
+ class AsyncAccountsResource(AsyncAPIResource):
45
+ @cached_property
46
+ def private(self) -> AsyncPrivateResource:
47
+ return AsyncPrivateResource(self._client)
48
+
49
+ @cached_property
50
+ def with_raw_response(self) -> AsyncAccountsResourceWithRawResponse:
51
+ """
52
+ This property can be used as a prefix for any HTTP method call to return the
53
+ the raw response object instead of the parsed content.
54
+
55
+ For more information, see https://www.github.com/mixpeek/python-client#accessing-raw-response-data-eg-headers
56
+ """
57
+ return AsyncAccountsResourceWithRawResponse(self)
58
+
59
+ @cached_property
60
+ def with_streaming_response(self) -> AsyncAccountsResourceWithStreamingResponse:
61
+ """
62
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
63
+
64
+ For more information, see https://www.github.com/mixpeek/python-client#with_streaming_response
65
+ """
66
+ return AsyncAccountsResourceWithStreamingResponse(self)
67
+
68
+
69
+ class AccountsResourceWithRawResponse:
70
+ def __init__(self, accounts: AccountsResource) -> None:
71
+ self._accounts = accounts
72
+
73
+ @cached_property
74
+ def private(self) -> PrivateResourceWithRawResponse:
75
+ return PrivateResourceWithRawResponse(self._accounts.private)
76
+
77
+
78
+ class AsyncAccountsResourceWithRawResponse:
79
+ def __init__(self, accounts: AsyncAccountsResource) -> None:
80
+ self._accounts = accounts
81
+
82
+ @cached_property
83
+ def private(self) -> AsyncPrivateResourceWithRawResponse:
84
+ return AsyncPrivateResourceWithRawResponse(self._accounts.private)
85
+
86
+
87
+ class AccountsResourceWithStreamingResponse:
88
+ def __init__(self, accounts: AccountsResource) -> None:
89
+ self._accounts = accounts
90
+
91
+ @cached_property
92
+ def private(self) -> PrivateResourceWithStreamingResponse:
93
+ return PrivateResourceWithStreamingResponse(self._accounts.private)
94
+
95
+
96
+ class AsyncAccountsResourceWithStreamingResponse:
97
+ def __init__(self, accounts: AsyncAccountsResource) -> None:
98
+ self._accounts = accounts
99
+
100
+ @cached_property
101
+ def private(self) -> AsyncPrivateResourceWithStreamingResponse:
102
+ return AsyncPrivateResourceWithStreamingResponse(self._accounts.private)