mixpeek 0.11.0__py3-none-any.whl → 0.11.2__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 +1 -93
  2. mixpeek/client.py +27 -0
  3. mixpeek/endpoints/collections.py +86 -0
  4. mixpeek/endpoints/embed.py +66 -0
  5. mixpeek/endpoints/index.py +51 -0
  6. mixpeek/endpoints/register.py +34 -0
  7. mixpeek/endpoints/search.py +44 -0
  8. mixpeek/endpoints/tasks.py +26 -0
  9. mixpeek/endpoints/tools.py +138 -0
  10. mixpeek/exceptions.py +13 -0
  11. mixpeek-0.11.2.dist-info/METADATA +375 -0
  12. mixpeek-0.11.2.dist-info/RECORD +15 -0
  13. {mixpeek-0.11.0.dist-info → mixpeek-0.11.2.dist-info}/WHEEL +2 -1
  14. mixpeek-0.11.2.dist-info/top_level.txt +1 -0
  15. mixpeek/_base_client.py +0 -2041
  16. mixpeek/_client.py +0 -444
  17. mixpeek/_compat.py +0 -219
  18. mixpeek/_constants.py +0 -14
  19. mixpeek/_exceptions.py +0 -108
  20. mixpeek/_files.py +0 -123
  21. mixpeek/_models.py +0 -785
  22. mixpeek/_qs.py +0 -150
  23. mixpeek/_resource.py +0 -43
  24. mixpeek/_response.py +0 -824
  25. mixpeek/_streaming.py +0 -333
  26. mixpeek/_types.py +0 -217
  27. mixpeek/_utils/__init__.py +0 -55
  28. mixpeek/_utils/_logs.py +0 -25
  29. mixpeek/_utils/_proxy.py +0 -62
  30. mixpeek/_utils/_reflection.py +0 -42
  31. mixpeek/_utils/_streams.py +0 -12
  32. mixpeek/_utils/_sync.py +0 -81
  33. mixpeek/_utils/_transform.py +0 -382
  34. mixpeek/_utils/_typing.py +0 -120
  35. mixpeek/_utils/_utils.py +0 -397
  36. mixpeek/_version.py +0 -4
  37. mixpeek/lib/.keep +0 -4
  38. mixpeek/resources/__init__.py +0 -159
  39. mixpeek/resources/accounts/__init__.py +0 -33
  40. mixpeek/resources/accounts/accounts.py +0 -102
  41. mixpeek/resources/accounts/private.py +0 -232
  42. mixpeek/resources/agent/__init__.py +0 -33
  43. mixpeek/resources/agent/agent.py +0 -225
  44. mixpeek/resources/agent/task.py +0 -189
  45. mixpeek/resources/collections/__init__.py +0 -33
  46. mixpeek/resources/collections/collections.py +0 -459
  47. mixpeek/resources/collections/files.py +0 -679
  48. mixpeek/resources/describe.py +0 -338
  49. mixpeek/resources/embed.py +0 -234
  50. mixpeek/resources/indexes.py +0 -506
  51. mixpeek/resources/read.py +0 -183
  52. mixpeek/resources/recognize.py +0 -183
  53. mixpeek/resources/search.py +0 -542
  54. mixpeek/resources/tasks.py +0 -297
  55. mixpeek/resources/transcribe.py +0 -192
  56. mixpeek/types/__init__.py +0 -19
  57. mixpeek/types/accounts/__init__.py +0 -6
  58. mixpeek/types/accounts/private_update_params.py +0 -25
  59. mixpeek/types/accounts/user.py +0 -32
  60. mixpeek/types/agent/__init__.py +0 -3
  61. mixpeek/types/agent_create_params.py +0 -18
  62. mixpeek/types/agentresponse.py +0 -11
  63. mixpeek/types/collection_search_params.py +0 -29
  64. mixpeek/types/collections/__init__.py +0 -9
  65. mixpeek/types/collections/file_create_params.py +0 -31
  66. mixpeek/types/collections/file_full_params.py +0 -22
  67. mixpeek/types/collections/file_update_params.py +0 -18
  68. mixpeek/types/collections/fileresponse.py +0 -23
  69. mixpeek/types/collections/groupedfiledata.py +0 -38
  70. mixpeek/types/describe_upload_params.py +0 -21
  71. mixpeek/types/describe_url_params.py +0 -20
  72. mixpeek/types/embed_create_params.py +0 -29
  73. mixpeek/types/embeddingresponse.py +0 -15
  74. mixpeek/types/index_face_params.py +0 -23
  75. mixpeek/types/index_upload_params.py +0 -27
  76. mixpeek/types/index_url_params.py +0 -159
  77. mixpeek/types/search_text_params.py +0 -45
  78. mixpeek/types/search_upload_params.py +0 -25
  79. mixpeek/types/search_url_params.py +0 -45
  80. mixpeek/types/taskresponse.py +0 -15
  81. mixpeek/types/transcribe_url_params.py +0 -18
  82. mixpeek-0.11.0.dist-info/METADATA +0 -356
  83. mixpeek-0.11.0.dist-info/RECORD +0 -73
  84. mixpeek-0.11.0.dist-info/licenses/LICENSE +0 -201
  85. /mixpeek/{py.typed → endpoints/__init__.py} +0 -0
mixpeek/_exceptions.py DELETED
@@ -1,108 +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_extensions import Literal
6
-
7
- import httpx
8
-
9
- __all__ = [
10
- "BadRequestError",
11
- "AuthenticationError",
12
- "PermissionDeniedError",
13
- "NotFoundError",
14
- "ConflictError",
15
- "UnprocessableEntityError",
16
- "RateLimitError",
17
- "InternalServerError",
18
- ]
19
-
20
-
21
- class MixpeekSDKError(Exception):
22
- pass
23
-
24
-
25
- class APIError(MixpeekSDKError):
26
- message: str
27
- request: httpx.Request
28
-
29
- body: object | None
30
- """The API response body.
31
-
32
- If the API responded with a valid JSON structure then this property will be the
33
- decoded result.
34
-
35
- If it isn't a valid JSON structure then this will be the raw response.
36
-
37
- If there was no response associated with this error then it will be `None`.
38
- """
39
-
40
- def __init__(self, message: str, request: httpx.Request, *, body: object | None) -> None: # noqa: ARG002
41
- super().__init__(message)
42
- self.request = request
43
- self.message = message
44
- self.body = body
45
-
46
-
47
- class APIResponseValidationError(APIError):
48
- response: httpx.Response
49
- status_code: int
50
-
51
- def __init__(self, response: httpx.Response, body: object | None, *, message: str | None = None) -> None:
52
- super().__init__(message or "Data returned by API invalid for expected schema.", response.request, body=body)
53
- self.response = response
54
- self.status_code = response.status_code
55
-
56
-
57
- class APIStatusError(APIError):
58
- """Raised when an API response has a status code of 4xx or 5xx."""
59
-
60
- response: httpx.Response
61
- status_code: int
62
-
63
- def __init__(self, message: str, *, response: httpx.Response, body: object | None) -> None:
64
- super().__init__(message, response.request, body=body)
65
- self.response = response
66
- self.status_code = response.status_code
67
-
68
-
69
- class APIConnectionError(APIError):
70
- def __init__(self, *, message: str = "Connection error.", request: httpx.Request) -> None:
71
- super().__init__(message, request, body=None)
72
-
73
-
74
- class APITimeoutError(APIConnectionError):
75
- def __init__(self, request: httpx.Request) -> None:
76
- super().__init__(message="Request timed out.", request=request)
77
-
78
-
79
- class BadRequestError(APIStatusError):
80
- status_code: Literal[400] = 400 # pyright: ignore[reportIncompatibleVariableOverride]
81
-
82
-
83
- class AuthenticationError(APIStatusError):
84
- status_code: Literal[401] = 401 # pyright: ignore[reportIncompatibleVariableOverride]
85
-
86
-
87
- class PermissionDeniedError(APIStatusError):
88
- status_code: Literal[403] = 403 # pyright: ignore[reportIncompatibleVariableOverride]
89
-
90
-
91
- class NotFoundError(APIStatusError):
92
- status_code: Literal[404] = 404 # pyright: ignore[reportIncompatibleVariableOverride]
93
-
94
-
95
- class ConflictError(APIStatusError):
96
- status_code: Literal[409] = 409 # pyright: ignore[reportIncompatibleVariableOverride]
97
-
98
-
99
- class UnprocessableEntityError(APIStatusError):
100
- status_code: Literal[422] = 422 # pyright: ignore[reportIncompatibleVariableOverride]
101
-
102
-
103
- class RateLimitError(APIStatusError):
104
- status_code: Literal[429] = 429 # pyright: ignore[reportIncompatibleVariableOverride]
105
-
106
-
107
- class InternalServerError(APIStatusError):
108
- pass
mixpeek/_files.py DELETED
@@ -1,123 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import io
4
- import os
5
- import pathlib
6
- from typing import overload
7
- from typing_extensions import TypeGuard
8
-
9
- import anyio
10
-
11
- from ._types import (
12
- FileTypes,
13
- FileContent,
14
- RequestFiles,
15
- HttpxFileTypes,
16
- Base64FileInput,
17
- HttpxFileContent,
18
- HttpxRequestFiles,
19
- )
20
- from ._utils import is_tuple_t, is_mapping_t, is_sequence_t
21
-
22
-
23
- def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]:
24
- return isinstance(obj, io.IOBase) or isinstance(obj, os.PathLike)
25
-
26
-
27
- def is_file_content(obj: object) -> TypeGuard[FileContent]:
28
- return (
29
- isinstance(obj, bytes) or isinstance(obj, tuple) or isinstance(obj, io.IOBase) or isinstance(obj, os.PathLike)
30
- )
31
-
32
-
33
- def assert_is_file_content(obj: object, *, key: str | None = None) -> None:
34
- if not is_file_content(obj):
35
- prefix = f"Expected entry at `{key}`" if key is not None else f"Expected file input `{obj!r}`"
36
- raise RuntimeError(
37
- f"{prefix} to be bytes, an io.IOBase instance, PathLike or a tuple but received {type(obj)} instead."
38
- ) from None
39
-
40
-
41
- @overload
42
- def to_httpx_files(files: None) -> None: ...
43
-
44
-
45
- @overload
46
- def to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ...
47
-
48
-
49
- def to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None:
50
- if files is None:
51
- return None
52
-
53
- if is_mapping_t(files):
54
- files = {key: _transform_file(file) for key, file in files.items()}
55
- elif is_sequence_t(files):
56
- files = [(key, _transform_file(file)) for key, file in files]
57
- else:
58
- raise TypeError(f"Unexpected file type input {type(files)}, expected mapping or sequence")
59
-
60
- return files
61
-
62
-
63
- def _transform_file(file: FileTypes) -> HttpxFileTypes:
64
- if is_file_content(file):
65
- if isinstance(file, os.PathLike):
66
- path = pathlib.Path(file)
67
- return (path.name, path.read_bytes())
68
-
69
- return file
70
-
71
- if is_tuple_t(file):
72
- return (file[0], _read_file_content(file[1]), *file[2:])
73
-
74
- raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
75
-
76
-
77
- def _read_file_content(file: FileContent) -> HttpxFileContent:
78
- if isinstance(file, os.PathLike):
79
- return pathlib.Path(file).read_bytes()
80
- return file
81
-
82
-
83
- @overload
84
- async def async_to_httpx_files(files: None) -> None: ...
85
-
86
-
87
- @overload
88
- async def async_to_httpx_files(files: RequestFiles) -> HttpxRequestFiles: ...
89
-
90
-
91
- async def async_to_httpx_files(files: RequestFiles | None) -> HttpxRequestFiles | None:
92
- if files is None:
93
- return None
94
-
95
- if is_mapping_t(files):
96
- files = {key: await _async_transform_file(file) for key, file in files.items()}
97
- elif is_sequence_t(files):
98
- files = [(key, await _async_transform_file(file)) for key, file in files]
99
- else:
100
- raise TypeError("Unexpected file type input {type(files)}, expected mapping or sequence")
101
-
102
- return files
103
-
104
-
105
- async def _async_transform_file(file: FileTypes) -> HttpxFileTypes:
106
- if is_file_content(file):
107
- if isinstance(file, os.PathLike):
108
- path = anyio.Path(file)
109
- return (path.name, await path.read_bytes())
110
-
111
- return file
112
-
113
- if is_tuple_t(file):
114
- return (file[0], await _async_read_file_content(file[1]), *file[2:])
115
-
116
- raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple")
117
-
118
-
119
- async def _async_read_file_content(file: FileContent) -> HttpxFileContent:
120
- if isinstance(file, os.PathLike):
121
- return await anyio.Path(file).read_bytes()
122
-
123
- return file