mixpeek 0.6.7__py3-none-any.whl → 0.6.9__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/__init__.py +1 -106
- mixpeek/client.py +21 -65
- mixpeek/endpoints/connections.py +16 -0
- mixpeek/endpoints/embed.py +50 -0
- mixpeek/endpoints/extract.py +16 -0
- mixpeek/endpoints/generate.py +17 -0
- mixpeek/endpoints/tools.py +23 -0
- mixpeek/exceptions.py +13 -0
- mixpeek-0.6.9.dist-info/METADATA +68 -0
- mixpeek-0.6.9.dist-info/RECORD +13 -0
- {mixpeek-0.6.7.dist-info → mixpeek-0.6.9.dist-info}/WHEEL +2 -1
- mixpeek-0.6.9.dist-info/top_level.txt +1 -0
- mixpeek/base_client.py +0 -989
- mixpeek/core/__init__.py +0 -25
- mixpeek/core/api_error.py +0 -15
- mixpeek/core/client_wrapper.py +0 -83
- mixpeek/core/datetime_utils.py +0 -28
- mixpeek/core/file.py +0 -38
- mixpeek/core/http_client.py +0 -130
- mixpeek/core/jsonable_encoder.py +0 -103
- mixpeek/core/remove_none_from_dict.py +0 -11
- mixpeek/core/request_options.py +0 -32
- mixpeek/environment.py +0 -7
- mixpeek/errors/__init__.py +0 -17
- mixpeek/errors/bad_request_error.py +0 -9
- mixpeek/errors/forbidden_error.py +0 -9
- mixpeek/errors/internal_server_error.py +0 -9
- mixpeek/errors/not_found_error.py +0 -9
- mixpeek/errors/unauthorized_error.py +0 -9
- mixpeek/errors/unprocessable_entity_error.py +0 -9
- mixpeek/pipeline/__init__.py +0 -2
- mixpeek/pipeline/client.py +0 -474
- mixpeek/storage/__init__.py +0 -5
- mixpeek/storage/client.py +0 -145
- mixpeek/storage/sample/__init__.py +0 -2
- mixpeek/storage/sample/client.py +0 -282
- mixpeek/types/__init__.py +0 -81
- mixpeek/types/api_key.py +0 -31
- mixpeek/types/audio_params.py +0 -29
- mixpeek/types/configs_response.py +0 -42
- mixpeek/types/connection.py +0 -36
- mixpeek/types/connection_engine.py +0 -5
- mixpeek/types/csv_params.py +0 -29
- mixpeek/types/destination.py +0 -42
- mixpeek/types/embedding_response.py +0 -34
- mixpeek/types/error_message.py +0 -29
- mixpeek/types/error_response.py +0 -30
- mixpeek/types/extract_response.py +0 -35
- mixpeek/types/field_type.py +0 -5
- mixpeek/types/generation_response.py +0 -36
- mixpeek/types/html_params.py +0 -29
- mixpeek/types/http_validation_error.py +0 -30
- mixpeek/types/image_params.py +0 -32
- mixpeek/types/message.py +0 -37
- mixpeek/types/metadata.py +0 -32
- mixpeek/types/modality.py +0 -5
- mixpeek/types/model.py +0 -38
- mixpeek/types/models.py +0 -5
- mixpeek/types/pdf_params.py +0 -41
- mixpeek/types/pipeline_response.py +0 -49
- mixpeek/types/pipeline_task_response.py +0 -32
- mixpeek/types/ppt_params.py +0 -27
- mixpeek/types/pptx_params.py +0 -27
- mixpeek/types/settings.py +0 -35
- mixpeek/types/source.py +0 -43
- mixpeek/types/source_destination_mapping.py +0 -44
- mixpeek/types/txt_params.py +0 -27
- mixpeek/types/user.py +0 -36
- mixpeek/types/validation_error.py +0 -32
- mixpeek/types/validation_error_loc_item.py +0 -5
- mixpeek/types/video_params.py +0 -27
- mixpeek/types/workflow_code_response.py +0 -29
- mixpeek/types/workflow_response.py +0 -32
- mixpeek/types/workflow_settings.py +0 -30
- mixpeek/types/xlsx_params.py +0 -29
- mixpeek/user/__init__.py +0 -2
- mixpeek/user/client.py +0 -308
- mixpeek/version.py +0 -4
- mixpeek/workflow/__init__.py +0 -2
- mixpeek/workflow/client.py +0 -535
- mixpeek-0.6.7.dist-info/LICENSE +0 -21
- mixpeek-0.6.7.dist-info/METADATA +0 -145
- mixpeek-0.6.7.dist-info/RECORD +0 -75
- /mixpeek/{py.typed → endpoints/__init__.py} +0 -0
@@ -1,32 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
from .validation_error_loc_item import ValidationErrorLocItem
|
8
|
-
|
9
|
-
try:
|
10
|
-
import pydantic.v1 as pydantic # type: ignore
|
11
|
-
except ImportError:
|
12
|
-
import pydantic # type: ignore
|
13
|
-
|
14
|
-
|
15
|
-
class ValidationError(pydantic.BaseModel):
|
16
|
-
loc: typing.List[ValidationErrorLocItem]
|
17
|
-
msg: str
|
18
|
-
type: str
|
19
|
-
|
20
|
-
def json(self, **kwargs: typing.Any) -> str:
|
21
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
-
return super().json(**kwargs_with_defaults)
|
23
|
-
|
24
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
-
return super().dict(**kwargs_with_defaults)
|
27
|
-
|
28
|
-
class Config:
|
29
|
-
frozen = True
|
30
|
-
smart_union = True
|
31
|
-
extra = pydantic.Extra.allow
|
32
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/video_params.py
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
|
-
|
13
|
-
|
14
|
-
class VideoParams(pydantic.BaseModel):
|
15
|
-
def json(self, **kwargs: typing.Any) -> str:
|
16
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
17
|
-
return super().json(**kwargs_with_defaults)
|
18
|
-
|
19
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
20
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
21
|
-
return super().dict(**kwargs_with_defaults)
|
22
|
-
|
23
|
-
class Config:
|
24
|
-
frozen = True
|
25
|
-
smart_union = True
|
26
|
-
extra = pydantic.Extra.allow
|
27
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
|
-
|
13
|
-
|
14
|
-
class WorkflowCodeResponse(pydantic.BaseModel):
|
15
|
-
code_as_string: str
|
16
|
-
|
17
|
-
def json(self, **kwargs: typing.Any) -> str:
|
18
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
19
|
-
return super().json(**kwargs_with_defaults)
|
20
|
-
|
21
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
22
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
23
|
-
return super().dict(**kwargs_with_defaults)
|
24
|
-
|
25
|
-
class Config:
|
26
|
-
frozen = True
|
27
|
-
smart_union = True
|
28
|
-
extra = pydantic.Extra.allow
|
29
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
|
-
|
13
|
-
|
14
|
-
class WorkflowResponse(pydantic.BaseModel):
|
15
|
-
workflow_id: str
|
16
|
-
workflow_name: typing.Optional[str] = None
|
17
|
-
created_at: dt.datetime
|
18
|
-
metadata: typing.Optional[typing.Dict[str, typing.Any]] = None
|
19
|
-
|
20
|
-
def json(self, **kwargs: typing.Any) -> str:
|
21
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
22
|
-
return super().json(**kwargs_with_defaults)
|
23
|
-
|
24
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
25
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
26
|
-
return super().dict(**kwargs_with_defaults)
|
27
|
-
|
28
|
-
class Config:
|
29
|
-
frozen = True
|
30
|
-
smart_union = True
|
31
|
-
extra = pydantic.Extra.allow
|
32
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
|
-
|
13
|
-
|
14
|
-
class WorkflowSettings(pydantic.BaseModel):
|
15
|
-
requirements: typing.Optional[typing.List[str]] = None
|
16
|
-
python_version: typing.Optional[str] = None
|
17
|
-
|
18
|
-
def json(self, **kwargs: typing.Any) -> str:
|
19
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
20
|
-
return super().json(**kwargs_with_defaults)
|
21
|
-
|
22
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
23
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
24
|
-
return super().dict(**kwargs_with_defaults)
|
25
|
-
|
26
|
-
class Config:
|
27
|
-
frozen = True
|
28
|
-
smart_union = True
|
29
|
-
extra = pydantic.Extra.allow
|
30
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/types/xlsx_params.py
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import datetime as dt
|
4
|
-
import typing
|
5
|
-
|
6
|
-
from ..core.datetime_utils import serialize_datetime
|
7
|
-
|
8
|
-
try:
|
9
|
-
import pydantic.v1 as pydantic # type: ignore
|
10
|
-
except ImportError:
|
11
|
-
import pydantic # type: ignore
|
12
|
-
|
13
|
-
|
14
|
-
class XlsxParams(pydantic.BaseModel):
|
15
|
-
include_header: typing.Optional[bool] = None
|
16
|
-
|
17
|
-
def json(self, **kwargs: typing.Any) -> str:
|
18
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
19
|
-
return super().json(**kwargs_with_defaults)
|
20
|
-
|
21
|
-
def dict(self, **kwargs: typing.Any) -> typing.Dict[str, typing.Any]:
|
22
|
-
kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs}
|
23
|
-
return super().dict(**kwargs_with_defaults)
|
24
|
-
|
25
|
-
class Config:
|
26
|
-
frozen = True
|
27
|
-
smart_union = True
|
28
|
-
extra = pydantic.Extra.allow
|
29
|
-
json_encoders = {dt.datetime: serialize_datetime}
|
mixpeek/user/__init__.py
DELETED
mixpeek/user/client.py
DELETED
@@ -1,308 +0,0 @@
|
|
1
|
-
# This file was auto-generated by Fern from our API Definition.
|
2
|
-
|
3
|
-
import typing
|
4
|
-
import urllib.parse
|
5
|
-
from json.decoder import JSONDecodeError
|
6
|
-
|
7
|
-
from ..core.api_error import ApiError
|
8
|
-
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
9
|
-
from ..core.jsonable_encoder import jsonable_encoder
|
10
|
-
from ..core.remove_none_from_dict import remove_none_from_dict
|
11
|
-
from ..core.request_options import RequestOptions
|
12
|
-
from ..errors.bad_request_error import BadRequestError
|
13
|
-
from ..errors.forbidden_error import ForbiddenError
|
14
|
-
from ..errors.internal_server_error import InternalServerError
|
15
|
-
from ..errors.not_found_error import NotFoundError
|
16
|
-
from ..errors.unauthorized_error import UnauthorizedError
|
17
|
-
from ..errors.unprocessable_entity_error import UnprocessableEntityError
|
18
|
-
from ..types.api_key import ApiKey
|
19
|
-
from ..types.connection import Connection
|
20
|
-
from ..types.error_response import ErrorResponse
|
21
|
-
from ..types.http_validation_error import HttpValidationError
|
22
|
-
from ..types.user import User
|
23
|
-
|
24
|
-
try:
|
25
|
-
import pydantic.v1 as pydantic # type: ignore
|
26
|
-
except ImportError:
|
27
|
-
import pydantic # type: ignore
|
28
|
-
|
29
|
-
# this is used as the default value for optional parameters
|
30
|
-
OMIT = typing.cast(typing.Any, ...)
|
31
|
-
|
32
|
-
|
33
|
-
class UserClient:
|
34
|
-
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
35
|
-
self._client_wrapper = client_wrapper
|
36
|
-
|
37
|
-
def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User:
|
38
|
-
"""
|
39
|
-
Parameters:
|
40
|
-
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
41
|
-
---
|
42
|
-
from mixpeek.client import Mixpeek
|
43
|
-
|
44
|
-
client = Mixpeek(
|
45
|
-
authorization="YOUR_AUTHORIZATION",
|
46
|
-
index_id="YOUR_INDEX_ID",
|
47
|
-
api_key="YOUR_API_KEY",
|
48
|
-
)
|
49
|
-
client.user.get()
|
50
|
-
"""
|
51
|
-
_response = self._client_wrapper.httpx_client.request(
|
52
|
-
"GET",
|
53
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
54
|
-
params=jsonable_encoder(
|
55
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
56
|
-
),
|
57
|
-
headers=jsonable_encoder(
|
58
|
-
remove_none_from_dict(
|
59
|
-
{
|
60
|
-
**self._client_wrapper.get_headers(),
|
61
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
62
|
-
}
|
63
|
-
)
|
64
|
-
),
|
65
|
-
timeout=request_options.get("timeout_in_seconds")
|
66
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
67
|
-
else self._client_wrapper.get_timeout(),
|
68
|
-
retries=0,
|
69
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
70
|
-
)
|
71
|
-
if 200 <= _response.status_code < 300:
|
72
|
-
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
73
|
-
if _response.status_code == 400:
|
74
|
-
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
75
|
-
if _response.status_code == 401:
|
76
|
-
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
77
|
-
if _response.status_code == 403:
|
78
|
-
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
79
|
-
if _response.status_code == 404:
|
80
|
-
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
81
|
-
if _response.status_code == 422:
|
82
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
83
|
-
if _response.status_code == 500:
|
84
|
-
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
85
|
-
try:
|
86
|
-
_response_json = _response.json()
|
87
|
-
except JSONDecodeError:
|
88
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
89
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
90
|
-
|
91
|
-
def update(
|
92
|
-
self,
|
93
|
-
*,
|
94
|
-
api_keys: typing.Optional[typing.Sequence[ApiKey]] = OMIT,
|
95
|
-
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
96
|
-
connections: typing.Optional[typing.Sequence[Connection]] = OMIT,
|
97
|
-
request_options: typing.Optional[RequestOptions] = None,
|
98
|
-
) -> User:
|
99
|
-
"""
|
100
|
-
Parameters:
|
101
|
-
- api_keys: typing.Optional[typing.Sequence[ApiKey]].
|
102
|
-
|
103
|
-
- metadata: typing.Optional[typing.Dict[str, typing.Any]].
|
104
|
-
|
105
|
-
- connections: typing.Optional[typing.Sequence[Connection]].
|
106
|
-
|
107
|
-
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
108
|
-
---
|
109
|
-
from mixpeek.client import Mixpeek
|
110
|
-
|
111
|
-
client = Mixpeek(
|
112
|
-
authorization="YOUR_AUTHORIZATION",
|
113
|
-
index_id="YOUR_INDEX_ID",
|
114
|
-
api_key="YOUR_API_KEY",
|
115
|
-
)
|
116
|
-
client.user.update()
|
117
|
-
"""
|
118
|
-
_request: typing.Dict[str, typing.Any] = {}
|
119
|
-
if api_keys is not OMIT:
|
120
|
-
_request["api_keys"] = api_keys
|
121
|
-
if metadata is not OMIT:
|
122
|
-
_request["metadata"] = metadata
|
123
|
-
if connections is not OMIT:
|
124
|
-
_request["connections"] = connections
|
125
|
-
_response = self._client_wrapper.httpx_client.request(
|
126
|
-
"PUT",
|
127
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
128
|
-
params=jsonable_encoder(
|
129
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
130
|
-
),
|
131
|
-
json=jsonable_encoder(_request)
|
132
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
133
|
-
else {
|
134
|
-
**jsonable_encoder(_request),
|
135
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
136
|
-
},
|
137
|
-
headers=jsonable_encoder(
|
138
|
-
remove_none_from_dict(
|
139
|
-
{
|
140
|
-
**self._client_wrapper.get_headers(),
|
141
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
142
|
-
}
|
143
|
-
)
|
144
|
-
),
|
145
|
-
timeout=request_options.get("timeout_in_seconds")
|
146
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
147
|
-
else self._client_wrapper.get_timeout(),
|
148
|
-
retries=0,
|
149
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
150
|
-
)
|
151
|
-
if 200 <= _response.status_code < 300:
|
152
|
-
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
153
|
-
if _response.status_code == 400:
|
154
|
-
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
155
|
-
if _response.status_code == 401:
|
156
|
-
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
157
|
-
if _response.status_code == 403:
|
158
|
-
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
159
|
-
if _response.status_code == 404:
|
160
|
-
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
161
|
-
if _response.status_code == 422:
|
162
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
163
|
-
if _response.status_code == 500:
|
164
|
-
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
165
|
-
try:
|
166
|
-
_response_json = _response.json()
|
167
|
-
except JSONDecodeError:
|
168
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
169
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
170
|
-
|
171
|
-
|
172
|
-
class AsyncUserClient:
|
173
|
-
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
174
|
-
self._client_wrapper = client_wrapper
|
175
|
-
|
176
|
-
async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> User:
|
177
|
-
"""
|
178
|
-
Parameters:
|
179
|
-
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
180
|
-
---
|
181
|
-
from mixpeek.client import AsyncMixpeek
|
182
|
-
|
183
|
-
client = AsyncMixpeek(
|
184
|
-
authorization="YOUR_AUTHORIZATION",
|
185
|
-
index_id="YOUR_INDEX_ID",
|
186
|
-
api_key="YOUR_API_KEY",
|
187
|
-
)
|
188
|
-
await client.user.get()
|
189
|
-
"""
|
190
|
-
_response = await self._client_wrapper.httpx_client.request(
|
191
|
-
"GET",
|
192
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
193
|
-
params=jsonable_encoder(
|
194
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
195
|
-
),
|
196
|
-
headers=jsonable_encoder(
|
197
|
-
remove_none_from_dict(
|
198
|
-
{
|
199
|
-
**self._client_wrapper.get_headers(),
|
200
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
201
|
-
}
|
202
|
-
)
|
203
|
-
),
|
204
|
-
timeout=request_options.get("timeout_in_seconds")
|
205
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
206
|
-
else self._client_wrapper.get_timeout(),
|
207
|
-
retries=0,
|
208
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
209
|
-
)
|
210
|
-
if 200 <= _response.status_code < 300:
|
211
|
-
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
212
|
-
if _response.status_code == 400:
|
213
|
-
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
214
|
-
if _response.status_code == 401:
|
215
|
-
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
216
|
-
if _response.status_code == 403:
|
217
|
-
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
218
|
-
if _response.status_code == 404:
|
219
|
-
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
220
|
-
if _response.status_code == 422:
|
221
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
222
|
-
if _response.status_code == 500:
|
223
|
-
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
224
|
-
try:
|
225
|
-
_response_json = _response.json()
|
226
|
-
except JSONDecodeError:
|
227
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
228
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
229
|
-
|
230
|
-
async def update(
|
231
|
-
self,
|
232
|
-
*,
|
233
|
-
api_keys: typing.Optional[typing.Sequence[ApiKey]] = OMIT,
|
234
|
-
metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
|
235
|
-
connections: typing.Optional[typing.Sequence[Connection]] = OMIT,
|
236
|
-
request_options: typing.Optional[RequestOptions] = None,
|
237
|
-
) -> User:
|
238
|
-
"""
|
239
|
-
Parameters:
|
240
|
-
- api_keys: typing.Optional[typing.Sequence[ApiKey]].
|
241
|
-
|
242
|
-
- metadata: typing.Optional[typing.Dict[str, typing.Any]].
|
243
|
-
|
244
|
-
- connections: typing.Optional[typing.Sequence[Connection]].
|
245
|
-
|
246
|
-
- request_options: typing.Optional[RequestOptions]. Request-specific configuration.
|
247
|
-
---
|
248
|
-
from mixpeek.client import AsyncMixpeek
|
249
|
-
|
250
|
-
client = AsyncMixpeek(
|
251
|
-
authorization="YOUR_AUTHORIZATION",
|
252
|
-
index_id="YOUR_INDEX_ID",
|
253
|
-
api_key="YOUR_API_KEY",
|
254
|
-
)
|
255
|
-
await client.user.update()
|
256
|
-
"""
|
257
|
-
_request: typing.Dict[str, typing.Any] = {}
|
258
|
-
if api_keys is not OMIT:
|
259
|
-
_request["api_keys"] = api_keys
|
260
|
-
if metadata is not OMIT:
|
261
|
-
_request["metadata"] = metadata
|
262
|
-
if connections is not OMIT:
|
263
|
-
_request["connections"] = connections
|
264
|
-
_response = await self._client_wrapper.httpx_client.request(
|
265
|
-
"PUT",
|
266
|
-
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "users"),
|
267
|
-
params=jsonable_encoder(
|
268
|
-
request_options.get("additional_query_parameters") if request_options is not None else None
|
269
|
-
),
|
270
|
-
json=jsonable_encoder(_request)
|
271
|
-
if request_options is None or request_options.get("additional_body_parameters") is None
|
272
|
-
else {
|
273
|
-
**jsonable_encoder(_request),
|
274
|
-
**(jsonable_encoder(remove_none_from_dict(request_options.get("additional_body_parameters", {})))),
|
275
|
-
},
|
276
|
-
headers=jsonable_encoder(
|
277
|
-
remove_none_from_dict(
|
278
|
-
{
|
279
|
-
**self._client_wrapper.get_headers(),
|
280
|
-
**(request_options.get("additional_headers", {}) if request_options is not None else {}),
|
281
|
-
}
|
282
|
-
)
|
283
|
-
),
|
284
|
-
timeout=request_options.get("timeout_in_seconds")
|
285
|
-
if request_options is not None and request_options.get("timeout_in_seconds") is not None
|
286
|
-
else self._client_wrapper.get_timeout(),
|
287
|
-
retries=0,
|
288
|
-
max_retries=request_options.get("max_retries") if request_options is not None else 0, # type: ignore
|
289
|
-
)
|
290
|
-
if 200 <= _response.status_code < 300:
|
291
|
-
return pydantic.parse_obj_as(User, _response.json()) # type: ignore
|
292
|
-
if _response.status_code == 400:
|
293
|
-
raise BadRequestError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
294
|
-
if _response.status_code == 401:
|
295
|
-
raise UnauthorizedError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
296
|
-
if _response.status_code == 403:
|
297
|
-
raise ForbiddenError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
298
|
-
if _response.status_code == 404:
|
299
|
-
raise NotFoundError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
300
|
-
if _response.status_code == 422:
|
301
|
-
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
|
302
|
-
if _response.status_code == 500:
|
303
|
-
raise InternalServerError(pydantic.parse_obj_as(ErrorResponse, _response.json())) # type: ignore
|
304
|
-
try:
|
305
|
-
_response_json = _response.json()
|
306
|
-
except JSONDecodeError:
|
307
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
308
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
mixpeek/version.py
DELETED
mixpeek/workflow/__init__.py
DELETED