mixpeek 0.14.0__py3-none-any.whl → 0.15.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.
- mixpeek/_version.py +1 -1
- mixpeek/models/internal/__init__.py +5 -0
- mixpeek/models/internal/globals.py +22 -0
- mixpeek/models/security.py +2 -2
- mixpeek/sdk.py +15 -5
- mixpeek/sdkconfiguration.py +4 -2
- mixpeek/utils/security.py +2 -2
- {mixpeek-0.14.0.dist-info → mixpeek-0.15.0.dist-info}/METADATA +12 -12
- {mixpeek-0.14.0.dist-info → mixpeek-0.15.0.dist-info}/RECORD +10 -8
- {mixpeek-0.14.0.dist-info → mixpeek-0.15.0.dist-info}/WHEEL +0 -0
mixpeek/_version.py
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from mixpeek.types import BaseModel
|
5
|
+
from mixpeek.utils import FieldMetadata, HeaderMetadata
|
6
|
+
import pydantic
|
7
|
+
from typing import Optional
|
8
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
9
|
+
|
10
|
+
|
11
|
+
class GlobalsTypedDict(TypedDict):
|
12
|
+
x_namespace: NotRequired[str]
|
13
|
+
r"""Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint."""
|
14
|
+
|
15
|
+
|
16
|
+
class Globals(BaseModel):
|
17
|
+
x_namespace: Annotated[
|
18
|
+
Optional[str],
|
19
|
+
pydantic.Field(alias="x-namespace"),
|
20
|
+
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
21
|
+
] = None
|
22
|
+
r"""Optional namespace for data isolation. This can be a namespace name or namespace ID. Example: 'netflix_prod' or 'ns_1234567890'. To create a namespace, use the /namespaces endpoint."""
|
mixpeek/models/security.py
CHANGED
@@ -8,11 +8,11 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
8
|
|
9
9
|
|
10
10
|
class SecurityTypedDict(TypedDict):
|
11
|
-
|
11
|
+
token: NotRequired[str]
|
12
12
|
|
13
13
|
|
14
14
|
class Security(BaseModel):
|
15
|
-
|
15
|
+
token: Annotated[
|
16
16
|
Optional[str],
|
17
17
|
FieldMetadata(
|
18
18
|
security=SecurityMetadata(
|
mixpeek/sdk.py
CHANGED
@@ -15,6 +15,7 @@ from mixpeek.features import Features
|
|
15
15
|
from mixpeek.health import Health
|
16
16
|
from mixpeek.ingest import Ingest
|
17
17
|
from mixpeek.interactions import Interactions
|
18
|
+
from mixpeek.models import internal
|
18
19
|
from mixpeek.namespaces import Namespaces
|
19
20
|
from mixpeek.organizations import Organizations
|
20
21
|
from mixpeek.searchinteractions import SearchInteractions
|
@@ -40,7 +41,8 @@ class Mixpeek(BaseSDK):
|
|
40
41
|
|
41
42
|
def __init__(
|
42
43
|
self,
|
43
|
-
|
44
|
+
token: Optional[Union[Optional[str], Callable[[], Optional[str]]]] = None,
|
45
|
+
x_namespace: Optional[str] = None,
|
44
46
|
server_idx: Optional[int] = None,
|
45
47
|
server_url: Optional[str] = None,
|
46
48
|
url_params: Optional[Dict[str, str]] = None,
|
@@ -52,7 +54,8 @@ class Mixpeek(BaseSDK):
|
|
52
54
|
) -> None:
|
53
55
|
r"""Instantiates the SDK configuring it with the provided parameters.
|
54
56
|
|
55
|
-
:param
|
57
|
+
:param token: The token required for authentication
|
58
|
+
:param x_namespace: Configures the x_namespace parameter for all supported operations
|
56
59
|
:param server_idx: The index of the server to use for all methods
|
57
60
|
:param server_url: The server URL to use for all methods
|
58
61
|
:param url_params: Parameters to optionally template the server URL with
|
@@ -79,20 +82,27 @@ class Mixpeek(BaseSDK):
|
|
79
82
|
), "The provided async_client must implement the AsyncHttpClient protocol."
|
80
83
|
|
81
84
|
security: Any = None
|
82
|
-
if callable(
|
83
|
-
security = lambda: models.Security(
|
85
|
+
if callable(token):
|
86
|
+
security = lambda: models.Security(token=token()) # pylint: disable=unnecessary-lambda-assignment
|
84
87
|
else:
|
85
|
-
security = models.Security(
|
88
|
+
security = models.Security(token=token)
|
86
89
|
|
87
90
|
if server_url is not None:
|
88
91
|
if url_params is not None:
|
89
92
|
server_url = utils.template_url(server_url, url_params)
|
90
93
|
|
94
|
+
_globals = internal.Globals(
|
95
|
+
x_namespace=utils.get_global_from_env(
|
96
|
+
x_namespace, "MIXPEEK_X_NAMESPACE", str
|
97
|
+
),
|
98
|
+
)
|
99
|
+
|
91
100
|
BaseSDK.__init__(
|
92
101
|
self,
|
93
102
|
SDKConfiguration(
|
94
103
|
client=client,
|
95
104
|
async_client=async_client,
|
105
|
+
globals=_globals,
|
96
106
|
security=security,
|
97
107
|
server_url=server_url,
|
98
108
|
server_idx=server_idx,
|
mixpeek/sdkconfiguration.py
CHANGED
@@ -5,6 +5,7 @@ from .httpclient import AsyncHttpClient, HttpClient
|
|
5
5
|
from .utils import Logger, RetryConfig, remove_suffix
|
6
6
|
from dataclasses import dataclass
|
7
7
|
from mixpeek import models
|
8
|
+
from mixpeek.models import internal
|
8
9
|
from mixpeek.types import OptionalNullable, UNSET
|
9
10
|
from pydantic import Field
|
10
11
|
from typing import Callable, Dict, Optional, Tuple, Union
|
@@ -21,14 +22,15 @@ class SDKConfiguration:
|
|
21
22
|
client: HttpClient
|
22
23
|
async_client: AsyncHttpClient
|
23
24
|
debug_logger: Logger
|
25
|
+
globals: internal.Globals
|
24
26
|
security: Optional[Union[models.Security, Callable[[], models.Security]]] = None
|
25
27
|
server_url: Optional[str] = ""
|
26
28
|
server_idx: Optional[int] = 0
|
27
29
|
language: str = "python"
|
28
30
|
openapi_doc_version: str = "0.81"
|
29
|
-
sdk_version: str = "0.
|
31
|
+
sdk_version: str = "0.15.0"
|
30
32
|
gen_version: str = "2.484.0"
|
31
|
-
user_agent: str = "speakeasy-sdk/python 0.
|
33
|
+
user_agent: str = "speakeasy-sdk/python 0.15.0 2.484.0 0.81 mixpeek"
|
32
34
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
33
35
|
timeout_ms: Optional[int] = None
|
34
36
|
|
mixpeek/utils/security.py
CHANGED
@@ -64,8 +64,8 @@ def get_security_from_env(security: Any, security_class: Any) -> Optional[BaseMo
|
|
64
64
|
|
65
65
|
security_dict: Any = {}
|
66
66
|
|
67
|
-
if os.getenv("
|
68
|
-
security_dict["
|
67
|
+
if os.getenv("MIXPEEK_TOKEN"):
|
68
|
+
security_dict["token"] = os.getenv("MIXPEEK_TOKEN")
|
69
69
|
|
70
70
|
return security_class(**security_dict) if security_dict else None
|
71
71
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: mixpeek
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.15.0
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy.
|
5
5
|
Home-page: https://github.com/mixpeek/python-sdk.git
|
6
6
|
Author: Speakeasy
|
@@ -94,7 +94,7 @@ from mixpeek import Mixpeek
|
|
94
94
|
import os
|
95
95
|
|
96
96
|
with Mixpeek(
|
97
|
-
|
97
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
98
98
|
) as mixpeek:
|
99
99
|
|
100
100
|
res = mixpeek.organizations.get()
|
@@ -114,7 +114,7 @@ import os
|
|
114
114
|
|
115
115
|
async def main():
|
116
116
|
async with Mixpeek(
|
117
|
-
|
117
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
118
118
|
) as mixpeek:
|
119
119
|
|
120
120
|
res = await mixpeek.organizations.get_async()
|
@@ -133,17 +133,17 @@ asyncio.run(main())
|
|
133
133
|
|
134
134
|
This SDK supports the following security scheme globally:
|
135
135
|
|
136
|
-
| Name
|
137
|
-
|
|
138
|
-
| `
|
136
|
+
| Name | Type | Scheme | Environment Variable |
|
137
|
+
| ------- | ---- | ----------- | -------------------- |
|
138
|
+
| `token` | http | HTTP Bearer | `MIXPEEK_TOKEN` |
|
139
139
|
|
140
|
-
To authenticate with the API the `
|
140
|
+
To authenticate with the API the `token` parameter must be set when initializing the SDK client instance. For example:
|
141
141
|
```python
|
142
142
|
from mixpeek import Mixpeek
|
143
143
|
import os
|
144
144
|
|
145
145
|
with Mixpeek(
|
146
|
-
|
146
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
147
147
|
) as mixpeek:
|
148
148
|
|
149
149
|
res = mixpeek.organizations.get()
|
@@ -251,7 +251,7 @@ from mixpeek.utils import BackoffStrategy, RetryConfig
|
|
251
251
|
import os
|
252
252
|
|
253
253
|
with Mixpeek(
|
254
|
-
|
254
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
255
255
|
) as mixpeek:
|
256
256
|
|
257
257
|
res = mixpeek.organizations.get(,
|
@@ -270,7 +270,7 @@ import os
|
|
270
270
|
|
271
271
|
with Mixpeek(
|
272
272
|
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
|
273
|
-
|
273
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
274
274
|
) as mixpeek:
|
275
275
|
|
276
276
|
res = mixpeek.organizations.get()
|
@@ -310,7 +310,7 @@ from mixpeek import Mixpeek, models
|
|
310
310
|
import os
|
311
311
|
|
312
312
|
with Mixpeek(
|
313
|
-
|
313
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
314
314
|
) as mixpeek:
|
315
315
|
res = None
|
316
316
|
try:
|
@@ -344,7 +344,7 @@ import os
|
|
344
344
|
|
345
345
|
with Mixpeek(
|
346
346
|
server_url="https://api.mixpeek.com/",
|
347
|
-
|
347
|
+
token=os.getenv("MIXPEEK_TOKEN", ""),
|
348
348
|
) as mixpeek:
|
349
349
|
|
350
350
|
res = mixpeek.organizations.get()
|
@@ -4,7 +4,7 @@ mixpeek/_hooks/__init__.py,sha256=9_7W5jAYw8rcO8Kfc-Ty-lB82BHfksAJJpVFb_UeU1c,14
|
|
4
4
|
mixpeek/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
|
5
5
|
mixpeek/_hooks/sdkhooks.py,sha256=NMqSNr_PmeJuQgXFEntPJElH9a6yfdyvwEQFH0TrunI,2557
|
6
6
|
mixpeek/_hooks/types.py,sha256=Qh9pO5ndynMrWpMLPkJUsOmAJ1AJHntJAXb5Yxe_a4o,2568
|
7
|
-
mixpeek/_version.py,sha256=
|
7
|
+
mixpeek/_version.py,sha256=hOcah6ygJNW_pdBxY1WFOUuIpPQxiIXGzCXvW7MmAUc,312
|
8
8
|
mixpeek/assets.py,sha256=FxsU6meCiGYKWPwFWT_67UJO4XwSg1vgY2QMSyspNfA,68830
|
9
9
|
mixpeek/basesdk.py,sha256=j_PZqE6WgIfx1cPCK5gAVn-rgPy9iLhUN5ELtefoEU0,11976
|
10
10
|
mixpeek/collections.py,sha256=HXgrieJfXHmdG88t_no0A35Jt66X19hT0zUdGL49XiU,44367
|
@@ -83,6 +83,8 @@ mixpeek/models/inputtype.py,sha256=e71-3dFq8sWgy3Ue0P-gADus3j1MLWvdHETlwBU7HjM,2
|
|
83
83
|
mixpeek/models/integerindexparams.py,sha256=r6nNOjihSSptcYwOdfrZTFRX_4bKWHbasGjEjdCLqM8,591
|
84
84
|
mixpeek/models/interactionresponse.py,sha256=BC9Rj2phrop5JzVfYWZ3UgVtwzCvNifd0j2SlhdWBhc,2926
|
85
85
|
mixpeek/models/interactiontype.py,sha256=7-cshgqKl-RQacmaubjuUJ6Lhqy2SL5QIKgmQUtpKWs,292
|
86
|
+
mixpeek/models/internal/__init__.py,sha256=UeANM6ipWP5CqyMd3Yhr6UbpvAabXdSYf_GtHdZ0-BI,163
|
87
|
+
mixpeek/models/internal/globals.py,sha256=7PIqZPXMkyWKGGhRqEtmZiESK7Cbo-9dQjCjTi8yL1s,979
|
86
88
|
mixpeek/models/jsonimageoutputsettings.py,sha256=edd5mFi9AmKSpHTCNiP0huzu3_9_IVIN_3LqdXoQS94,1716
|
87
89
|
mixpeek/models/jsontextoutputsettings.py,sha256=EGbFfuSFSXQO6A3_Gkj58qPVsEU5NE55dxMUcvK_CHk,1622
|
88
90
|
mixpeek/models/jsonvideooutputsettings.py,sha256=7kf0tJM2Go-rWBIbp9yWJYv2RFesQvOjPsE3p-DeA9I,1716
|
@@ -123,7 +125,7 @@ mixpeek/models/searchinteraction.py,sha256=2X7aVM6Uoknv6mU1rZlUV9oUmDD1rTkDTXCY7
|
|
123
125
|
mixpeek/models/searchquery_output.py,sha256=c7Ar09TanSqoLfLl-PeLcSCXpwUW9G-dm_TS8xPrhPw,2617
|
124
126
|
mixpeek/models/searchrequestfeatures_input.py,sha256=kQE7EPFU3yYXJ6kX2VB7Rz9_Y7eFzgkfooKeFxZvxmA,5769
|
125
127
|
mixpeek/models/searchrequestfeatures_output.py,sha256=s044mekxr7OF68sco7OvRALMt-w6scwbGHIm12wtVXs,5724
|
126
|
-
mixpeek/models/security.py,sha256=
|
128
|
+
mixpeek/models/security.py,sha256=BmBA5yNcaMUKWsJGJtBdZvO1drfqEjAnN4nDs-IOKm4,678
|
127
129
|
mixpeek/models/sortoption.py,sha256=3_cJW0A9vt8INQowzJ_kZtmYT1mlBNy-__f-tvLiC3Q,639
|
128
130
|
mixpeek/models/sparseembedding.py,sha256=-nXJSRELVSQqTyXAPYA4swPKBscLdljq9vH4N91Yz7A,530
|
129
131
|
mixpeek/models/tasks_model_taskresponse.py,sha256=oyO5jpGPk9UEDS-gyZ6VGqjZrLUcYto_ODMzwvT_Z8o,516
|
@@ -151,8 +153,8 @@ mixpeek/models/videotranscriptionsettings.py,sha256=eIrlsSw5AUA9uE98bXvfIoitK5nu
|
|
151
153
|
mixpeek/namespaces.py,sha256=V4GZu9ueay3bw_Rlofo0figPDUPfML4XAZudRmYtEjQ,48214
|
152
154
|
mixpeek/organizations.py,sha256=JcnABmWBzvQn8uto9XlNg_NsbzKkFUr3RJoloTY_aXQ,62467
|
153
155
|
mixpeek/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
154
|
-
mixpeek/sdk.py,sha256=
|
155
|
-
mixpeek/sdkconfiguration.py,sha256=
|
156
|
+
mixpeek/sdk.py,sha256=WAtzes8UmlahOy1GPlu-5kXZ6hXkI2zBtchePIN17mc,5946
|
157
|
+
mixpeek/sdkconfiguration.py,sha256=VmG7uZWkVDBKPKkZfGdKvA1xmfh9mJflJFGb_xttRVk,1601
|
156
158
|
mixpeek/searchinteractions.py,sha256=g-0QxU0Wi_IaMvT6n7OM2Cryr_vtQZzZ3HZpBl6AG0I,28152
|
157
159
|
mixpeek/tasks.py,sha256=lvDpvaP_vIpYltWWuXxeAZtOJXC68Sroh9OgYIT6u5A,16532
|
158
160
|
mixpeek/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
@@ -168,10 +170,10 @@ mixpeek/utils/metadata.py,sha256=Per2KFXXOqOtoUWXrlIfjrSrBg199KrRW0nKQDgHIBU,313
|
|
168
170
|
mixpeek/utils/queryparams.py,sha256=MTK6inMS1_WwjmMJEJmAn67tSHHJyarpdGRlorRHEtI,5899
|
169
171
|
mixpeek/utils/requestbodies.py,sha256=ySjEyjcLi731LNUahWvLOrES2HihuA8VrOJx4eQ7Qzg,2101
|
170
172
|
mixpeek/utils/retries.py,sha256=6yhfZifqIat9i76xF0lTR2jLj1IN9BNGyqqxATlEFPU,6348
|
171
|
-
mixpeek/utils/security.py,sha256=
|
173
|
+
mixpeek/utils/security.py,sha256=XoK-R2YMyZtVWQte7FoezfGJS-dea9jz4qQ7w5dwNWc,6002
|
172
174
|
mixpeek/utils/serializers.py,sha256=BSJT7kBOkNBFyP7KREyMoe14JGbgijD1M6AXFMbdmco,4924
|
173
175
|
mixpeek/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
174
176
|
mixpeek/utils/values.py,sha256=_89YXPTI_BU6SXJBzFR4pIzTCBPQW9tsOTN1jeBBIDs,3428
|
175
|
-
mixpeek-0.
|
176
|
-
mixpeek-0.
|
177
|
-
mixpeek-0.
|
177
|
+
mixpeek-0.15.0.dist-info/METADATA,sha256=PuNPLpijbqjfpY866uEA5KL7NU-Rp4fc2_Y8q8bEoC0,19633
|
178
|
+
mixpeek-0.15.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
179
|
+
mixpeek-0.15.0.dist-info/RECORD,,
|
File without changes
|