mixpeek 0.8.3__py3-none-any.whl → 0.8.4__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 (86) hide show
  1. mixpeek/__init__.py +1 -0
  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 +67 -0
  8. mixpeek/endpoints/tasks.py +26 -0
  9. mixpeek/endpoints/tools.py +138 -0
  10. mixpeek/exceptions.py +13 -0
  11. mixpeek-0.8.4.dist-info/METADATA +375 -0
  12. mixpeek-0.8.4.dist-info/RECORD +15 -0
  13. {mixpeek-0.8.3.dist-info → mixpeek-0.8.4.dist-info}/WHEEL +2 -1
  14. mixpeek-0.8.4.dist-info/top_level.txt +1 -0
  15. mixpeek-0.8.3.dist-info/METADATA +0 -356
  16. mixpeek-0.8.3.dist-info/RECORD +0 -73
  17. mixpeek-0.8.3.dist-info/licenses/LICENSE +0 -201
  18. mixpeek_sdk/__init__.py +0 -93
  19. mixpeek_sdk/_base_client.py +0 -2041
  20. mixpeek_sdk/_client.py +0 -444
  21. mixpeek_sdk/_compat.py +0 -219
  22. mixpeek_sdk/_constants.py +0 -14
  23. mixpeek_sdk/_exceptions.py +0 -108
  24. mixpeek_sdk/_files.py +0 -123
  25. mixpeek_sdk/_models.py +0 -785
  26. mixpeek_sdk/_qs.py +0 -150
  27. mixpeek_sdk/_resource.py +0 -43
  28. mixpeek_sdk/_response.py +0 -826
  29. mixpeek_sdk/_streaming.py +0 -333
  30. mixpeek_sdk/_types.py +0 -217
  31. mixpeek_sdk/_utils/__init__.py +0 -55
  32. mixpeek_sdk/_utils/_logs.py +0 -25
  33. mixpeek_sdk/_utils/_proxy.py +0 -62
  34. mixpeek_sdk/_utils/_reflection.py +0 -42
  35. mixpeek_sdk/_utils/_streams.py +0 -12
  36. mixpeek_sdk/_utils/_sync.py +0 -81
  37. mixpeek_sdk/_utils/_transform.py +0 -382
  38. mixpeek_sdk/_utils/_typing.py +0 -120
  39. mixpeek_sdk/_utils/_utils.py +0 -397
  40. mixpeek_sdk/_version.py +0 -4
  41. mixpeek_sdk/lib/.keep +0 -4
  42. mixpeek_sdk/resources/__init__.py +0 -159
  43. mixpeek_sdk/resources/accounts/__init__.py +0 -33
  44. mixpeek_sdk/resources/accounts/accounts.py +0 -102
  45. mixpeek_sdk/resources/accounts/private.py +0 -232
  46. mixpeek_sdk/resources/agent/__init__.py +0 -33
  47. mixpeek_sdk/resources/agent/agent.py +0 -225
  48. mixpeek_sdk/resources/agent/task.py +0 -189
  49. mixpeek_sdk/resources/collections/__init__.py +0 -33
  50. mixpeek_sdk/resources/collections/collections.py +0 -459
  51. mixpeek_sdk/resources/collections/files.py +0 -679
  52. mixpeek_sdk/resources/describe.py +0 -338
  53. mixpeek_sdk/resources/embed.py +0 -234
  54. mixpeek_sdk/resources/index.py +0 -506
  55. mixpeek_sdk/resources/read.py +0 -183
  56. mixpeek_sdk/resources/recognize.py +0 -183
  57. mixpeek_sdk/resources/search.py +0 -542
  58. mixpeek_sdk/resources/tasks.py +0 -294
  59. mixpeek_sdk/resources/transcribe.py +0 -192
  60. mixpeek_sdk/types/__init__.py +0 -19
  61. mixpeek_sdk/types/accounts/__init__.py +0 -6
  62. mixpeek_sdk/types/accounts/private_update_params.py +0 -25
  63. mixpeek_sdk/types/accounts/user.py +0 -32
  64. mixpeek_sdk/types/agent/__init__.py +0 -3
  65. mixpeek_sdk/types/agent_create_params.py +0 -18
  66. mixpeek_sdk/types/agentresponse.py +0 -11
  67. mixpeek_sdk/types/collection_search_params.py +0 -29
  68. mixpeek_sdk/types/collections/__init__.py +0 -9
  69. mixpeek_sdk/types/collections/file_create_params.py +0 -31
  70. mixpeek_sdk/types/collections/file_full_params.py +0 -22
  71. mixpeek_sdk/types/collections/file_update_params.py +0 -18
  72. mixpeek_sdk/types/collections/fileresponse.py +0 -23
  73. mixpeek_sdk/types/collections/groupedfiledata.py +0 -38
  74. mixpeek_sdk/types/describe_upload_params.py +0 -21
  75. mixpeek_sdk/types/describe_url_params.py +0 -20
  76. mixpeek_sdk/types/embed_create_params.py +0 -29
  77. mixpeek_sdk/types/embeddingresponse.py +0 -15
  78. mixpeek_sdk/types/index_face_params.py +0 -23
  79. mixpeek_sdk/types/index_upload_params.py +0 -27
  80. mixpeek_sdk/types/index_url_params.py +0 -159
  81. mixpeek_sdk/types/search_text_params.py +0 -45
  82. mixpeek_sdk/types/search_upload_params.py +0 -25
  83. mixpeek_sdk/types/search_url_params.py +0 -45
  84. mixpeek_sdk/types/taskresponse.py +0 -15
  85. mixpeek_sdk/types/transcribe_url_params.py +0 -18
  86. /mixpeek_sdk/py.typed → /mixpeek/endpoints/__init__.py +0 -0
mixpeek_sdk/_qs.py DELETED
@@ -1,150 +0,0 @@
1
- from __future__ import annotations
2
-
3
- from typing import Any, List, Tuple, Union, Mapping, TypeVar
4
- from urllib.parse import parse_qs, urlencode
5
- from typing_extensions import Literal, get_args
6
-
7
- from ._types import NOT_GIVEN, NotGiven, NotGivenOr
8
- from ._utils import flatten
9
-
10
- _T = TypeVar("_T")
11
-
12
-
13
- ArrayFormat = Literal["comma", "repeat", "indices", "brackets"]
14
- NestedFormat = Literal["dots", "brackets"]
15
-
16
- PrimitiveData = Union[str, int, float, bool, None]
17
- # this should be Data = Union[PrimitiveData, "List[Data]", "Tuple[Data]", "Mapping[str, Data]"]
18
- # https://github.com/microsoft/pyright/issues/3555
19
- Data = Union[PrimitiveData, List[Any], Tuple[Any], "Mapping[str, Any]"]
20
- Params = Mapping[str, Data]
21
-
22
-
23
- class Querystring:
24
- array_format: ArrayFormat
25
- nested_format: NestedFormat
26
-
27
- def __init__(
28
- self,
29
- *,
30
- array_format: ArrayFormat = "repeat",
31
- nested_format: NestedFormat = "brackets",
32
- ) -> None:
33
- self.array_format = array_format
34
- self.nested_format = nested_format
35
-
36
- def parse(self, query: str) -> Mapping[str, object]:
37
- # Note: custom format syntax is not supported yet
38
- return parse_qs(query)
39
-
40
- def stringify(
41
- self,
42
- params: Params,
43
- *,
44
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
45
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
46
- ) -> str:
47
- return urlencode(
48
- self.stringify_items(
49
- params,
50
- array_format=array_format,
51
- nested_format=nested_format,
52
- )
53
- )
54
-
55
- def stringify_items(
56
- self,
57
- params: Params,
58
- *,
59
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
60
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
61
- ) -> list[tuple[str, str]]:
62
- opts = Options(
63
- qs=self,
64
- array_format=array_format,
65
- nested_format=nested_format,
66
- )
67
- return flatten([self._stringify_item(key, value, opts) for key, value in params.items()])
68
-
69
- def _stringify_item(
70
- self,
71
- key: str,
72
- value: Data,
73
- opts: Options,
74
- ) -> list[tuple[str, str]]:
75
- if isinstance(value, Mapping):
76
- items: list[tuple[str, str]] = []
77
- nested_format = opts.nested_format
78
- for subkey, subvalue in value.items():
79
- items.extend(
80
- self._stringify_item(
81
- # TODO: error if unknown format
82
- f"{key}.{subkey}" if nested_format == "dots" else f"{key}[{subkey}]",
83
- subvalue,
84
- opts,
85
- )
86
- )
87
- return items
88
-
89
- if isinstance(value, (list, tuple)):
90
- array_format = opts.array_format
91
- if array_format == "comma":
92
- return [
93
- (
94
- key,
95
- ",".join(self._primitive_value_to_str(item) for item in value if item is not None),
96
- ),
97
- ]
98
- elif array_format == "repeat":
99
- items = []
100
- for item in value:
101
- items.extend(self._stringify_item(key, item, opts))
102
- return items
103
- elif array_format == "indices":
104
- raise NotImplementedError("The array indices format is not supported yet")
105
- elif array_format == "brackets":
106
- items = []
107
- key = key + "[]"
108
- for item in value:
109
- items.extend(self._stringify_item(key, item, opts))
110
- return items
111
- else:
112
- raise NotImplementedError(
113
- f"Unknown array_format value: {array_format}, choose from {', '.join(get_args(ArrayFormat))}"
114
- )
115
-
116
- serialised = self._primitive_value_to_str(value)
117
- if not serialised:
118
- return []
119
- return [(key, serialised)]
120
-
121
- def _primitive_value_to_str(self, value: PrimitiveData) -> str:
122
- # copied from httpx
123
- if value is True:
124
- return "true"
125
- elif value is False:
126
- return "false"
127
- elif value is None:
128
- return ""
129
- return str(value)
130
-
131
-
132
- _qs = Querystring()
133
- parse = _qs.parse
134
- stringify = _qs.stringify
135
- stringify_items = _qs.stringify_items
136
-
137
-
138
- class Options:
139
- array_format: ArrayFormat
140
- nested_format: NestedFormat
141
-
142
- def __init__(
143
- self,
144
- qs: Querystring = _qs,
145
- *,
146
- array_format: NotGivenOr[ArrayFormat] = NOT_GIVEN,
147
- nested_format: NotGivenOr[NestedFormat] = NOT_GIVEN,
148
- ) -> None:
149
- self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
150
- self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
mixpeek_sdk/_resource.py DELETED
@@ -1,43 +0,0 @@
1
- # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- from __future__ import annotations
4
-
5
- import time
6
- from typing import TYPE_CHECKING
7
-
8
- import anyio
9
-
10
- if TYPE_CHECKING:
11
- from ._client import MixpeekSDK, AsyncMixpeekSDK
12
-
13
-
14
- class SyncAPIResource:
15
- _client: MixpeekSDK
16
-
17
- def __init__(self, client: MixpeekSDK) -> None:
18
- self._client = client
19
- self._get = client.get
20
- self._post = client.post
21
- self._patch = client.patch
22
- self._put = client.put
23
- self._delete = client.delete
24
- self._get_api_list = client.get_api_list
25
-
26
- def _sleep(self, seconds: float) -> None:
27
- time.sleep(seconds)
28
-
29
-
30
- class AsyncAPIResource:
31
- _client: AsyncMixpeekSDK
32
-
33
- def __init__(self, client: AsyncMixpeekSDK) -> None:
34
- self._client = client
35
- self._get = client.get
36
- self._post = client.post
37
- self._patch = client.patch
38
- self._put = client.put
39
- self._delete = client.delete
40
- self._get_api_list = client.get_api_list
41
-
42
- async def _sleep(self, seconds: float) -> None:
43
- await anyio.sleep(seconds)