mixpeek 0.15.0__py3-none-any.whl → 0.15.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.
- mixpeek/_version.py +1 -1
- mixpeek/assets.py +8 -8
- mixpeek/collections.py +4 -4
- mixpeek/featureextractors.py +6 -6
- mixpeek/features.py +20 -20
- mixpeek/ingest.py +12 -54
- mixpeek/models/__init__.py +27 -108
- mixpeek/models/assetresponse.py +4 -4
- mixpeek/models/availableindexesresponse.py +2 -2
- mixpeek/models/availablemodels.py +4 -0
- mixpeek/models/createnamespacerequest.py +4 -4
- mixpeek/models/embeddingrequest.py +2 -2
- mixpeek/models/entitysettings.py +50 -0
- mixpeek/models/featureextractionembeddingrequest.py +2 -2
- mixpeek/models/imagedescribesettings.py +6 -6
- mixpeek/models/imagereadsettings.py +6 -6
- mixpeek/models/imagesettings.py +17 -4
- mixpeek/models/listassetsrequest.py +3 -3
- mixpeek/models/listfeaturesrequest.py +3 -3
- mixpeek/models/{logicaloperator_input.py → logicaloperator.py} +8 -8
- mixpeek/models/namespaceresponse.py +2 -2
- mixpeek/models/processimageurlinput.py +1 -13
- mixpeek/models/processtextinput.py +1 -13
- mixpeek/models/processvideourlinput.py +1 -13
- mixpeek/models/search_features_features_search_postop.py +4 -7
- mixpeek/models/{search_model_searchquery_input.py → search_model_searchquery.py} +7 -7
- mixpeek/models/searchassetsrequest.py +3 -3
- mixpeek/models/{searchrequestfeatures_output.py → searchrequestfeatures.py} +11 -11
- mixpeek/models/{percolaterequest.py → taskresponse.py} +15 -17
- mixpeek/models/taskstatus.py +1 -0
- mixpeek/models/taxonomyextractionconfig.py +31 -0
- mixpeek/models/textsettings.py +10 -4
- mixpeek/models/vectormodel.py +4 -0
- mixpeek/models/videodescribesettings.py +6 -6
- mixpeek/models/videoreadsettings.py +6 -6
- mixpeek/models/videosettings.py +17 -3
- mixpeek/models/videotranscriptionsettings.py +6 -6
- mixpeek/namespaces.py +10 -10
- mixpeek/sdk.py +0 -6
- mixpeek/sdkconfiguration.py +2 -2
- mixpeek/tasks.py +4 -4
- {mixpeek-0.15.0.dist-info → mixpeek-0.15.2.dist-info}/METADATA +1 -11
- {mixpeek-0.15.0.dist-info → mixpeek-0.15.2.dist-info}/RECORD +44 -56
- mixpeek/interactions.py +0 -228
- mixpeek/models/create_interaction_features_search_interactions_postop.py +0 -59
- mixpeek/models/db_model_taskresponse.py +0 -20
- mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +0 -59
- mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +0 -59
- mixpeek/models/interactionresponse.py +0 -87
- mixpeek/models/interactiontype.py +0 -11
- mixpeek/models/list_interactions_features_search_interactions_getop.py +0 -96
- mixpeek/models/logicaloperator_output.py +0 -103
- mixpeek/models/searchinteraction.py +0 -82
- mixpeek/models/searchquery_output.py +0 -79
- mixpeek/models/searchrequestfeatures_input.py +0 -151
- mixpeek/models/tasks_model_taskresponse.py +0 -24
- mixpeek/searchinteractions.py +0 -666
- {mixpeek-0.15.0.dist-info → mixpeek-0.15.2.dist-info}/WHEEL +0 -0
mixpeek/interactions.py
DELETED
@@ -1,228 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from .basesdk import BaseSDK
|
4
|
-
from mixpeek import models, utils
|
5
|
-
from mixpeek._hooks import HookContext
|
6
|
-
from mixpeek.types import OptionalNullable, UNSET
|
7
|
-
from mixpeek.utils import get_security_from_env
|
8
|
-
from typing import Any, List, Mapping, Optional
|
9
|
-
|
10
|
-
|
11
|
-
class Interactions(BaseSDK):
|
12
|
-
def list(
|
13
|
-
self,
|
14
|
-
*,
|
15
|
-
feature_id: OptionalNullable[str] = UNSET,
|
16
|
-
interaction_type: OptionalNullable[str] = UNSET,
|
17
|
-
session_id: OptionalNullable[str] = UNSET,
|
18
|
-
page: OptionalNullable[int] = UNSET,
|
19
|
-
page_size: Optional[int] = 10,
|
20
|
-
x_namespace: OptionalNullable[str] = UNSET,
|
21
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
22
|
-
server_url: Optional[str] = None,
|
23
|
-
timeout_ms: Optional[int] = None,
|
24
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
25
|
-
) -> List[models.InteractionResponse]:
|
26
|
-
r"""List Interactions
|
27
|
-
|
28
|
-
List interactions with optional filters and pagination
|
29
|
-
|
30
|
-
:param feature_id:
|
31
|
-
:param interaction_type:
|
32
|
-
:param session_id:
|
33
|
-
:param page:
|
34
|
-
:param page_size:
|
35
|
-
:param x_namespace: 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.
|
36
|
-
:param retries: Override the default retry configuration for this method
|
37
|
-
:param server_url: Override the default server URL for this method
|
38
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
39
|
-
:param http_headers: Additional headers to set or replace on requests.
|
40
|
-
"""
|
41
|
-
base_url = None
|
42
|
-
url_variables = None
|
43
|
-
if timeout_ms is None:
|
44
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
45
|
-
|
46
|
-
if server_url is not None:
|
47
|
-
base_url = server_url
|
48
|
-
|
49
|
-
request = models.ListInteractionsFeaturesSearchInteractionsGetRequest(
|
50
|
-
feature_id=feature_id,
|
51
|
-
interaction_type=interaction_type,
|
52
|
-
session_id=session_id,
|
53
|
-
page=page,
|
54
|
-
page_size=page_size,
|
55
|
-
x_namespace=x_namespace,
|
56
|
-
)
|
57
|
-
|
58
|
-
req = self._build_request(
|
59
|
-
method="GET",
|
60
|
-
path="/features/search/interactions",
|
61
|
-
base_url=base_url,
|
62
|
-
url_variables=url_variables,
|
63
|
-
request=request,
|
64
|
-
request_body_required=False,
|
65
|
-
request_has_path_params=False,
|
66
|
-
request_has_query_params=True,
|
67
|
-
user_agent_header="user-agent",
|
68
|
-
accept_header_value="application/json",
|
69
|
-
http_headers=http_headers,
|
70
|
-
security=self.sdk_configuration.security,
|
71
|
-
timeout_ms=timeout_ms,
|
72
|
-
)
|
73
|
-
|
74
|
-
if retries == UNSET:
|
75
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
76
|
-
retries = self.sdk_configuration.retry_config
|
77
|
-
|
78
|
-
retry_config = None
|
79
|
-
if isinstance(retries, utils.RetryConfig):
|
80
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
81
|
-
|
82
|
-
http_res = self.do_request(
|
83
|
-
hook_ctx=HookContext(
|
84
|
-
operation_id="list_interactions_features_search_interactions_get",
|
85
|
-
oauth2_scopes=[],
|
86
|
-
security_source=get_security_from_env(
|
87
|
-
self.sdk_configuration.security, models.Security
|
88
|
-
),
|
89
|
-
),
|
90
|
-
request=req,
|
91
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
92
|
-
retry_config=retry_config,
|
93
|
-
)
|
94
|
-
|
95
|
-
data: Any = None
|
96
|
-
if utils.match_response(http_res, "200", "application/json"):
|
97
|
-
return utils.unmarshal_json(http_res.text, List[models.InteractionResponse])
|
98
|
-
if utils.match_response(
|
99
|
-
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
100
|
-
):
|
101
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
102
|
-
raise models.ErrorResponse(data=data)
|
103
|
-
if utils.match_response(http_res, "422", "application/json"):
|
104
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
105
|
-
raise models.HTTPValidationError(data=data)
|
106
|
-
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
107
|
-
http_res_text = utils.stream_to_text(http_res)
|
108
|
-
raise models.APIError(
|
109
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
110
|
-
)
|
111
|
-
|
112
|
-
content_type = http_res.headers.get("Content-Type")
|
113
|
-
http_res_text = utils.stream_to_text(http_res)
|
114
|
-
raise models.APIError(
|
115
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
116
|
-
http_res.status_code,
|
117
|
-
http_res_text,
|
118
|
-
http_res,
|
119
|
-
)
|
120
|
-
|
121
|
-
async def list_async(
|
122
|
-
self,
|
123
|
-
*,
|
124
|
-
feature_id: OptionalNullable[str] = UNSET,
|
125
|
-
interaction_type: OptionalNullable[str] = UNSET,
|
126
|
-
session_id: OptionalNullable[str] = UNSET,
|
127
|
-
page: OptionalNullable[int] = UNSET,
|
128
|
-
page_size: Optional[int] = 10,
|
129
|
-
x_namespace: OptionalNullable[str] = UNSET,
|
130
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
131
|
-
server_url: Optional[str] = None,
|
132
|
-
timeout_ms: Optional[int] = None,
|
133
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
134
|
-
) -> List[models.InteractionResponse]:
|
135
|
-
r"""List Interactions
|
136
|
-
|
137
|
-
List interactions with optional filters and pagination
|
138
|
-
|
139
|
-
:param feature_id:
|
140
|
-
:param interaction_type:
|
141
|
-
:param session_id:
|
142
|
-
:param page:
|
143
|
-
:param page_size:
|
144
|
-
:param x_namespace: 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.
|
145
|
-
:param retries: Override the default retry configuration for this method
|
146
|
-
:param server_url: Override the default server URL for this method
|
147
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
148
|
-
:param http_headers: Additional headers to set or replace on requests.
|
149
|
-
"""
|
150
|
-
base_url = None
|
151
|
-
url_variables = None
|
152
|
-
if timeout_ms is None:
|
153
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
154
|
-
|
155
|
-
if server_url is not None:
|
156
|
-
base_url = server_url
|
157
|
-
|
158
|
-
request = models.ListInteractionsFeaturesSearchInteractionsGetRequest(
|
159
|
-
feature_id=feature_id,
|
160
|
-
interaction_type=interaction_type,
|
161
|
-
session_id=session_id,
|
162
|
-
page=page,
|
163
|
-
page_size=page_size,
|
164
|
-
x_namespace=x_namespace,
|
165
|
-
)
|
166
|
-
|
167
|
-
req = self._build_request_async(
|
168
|
-
method="GET",
|
169
|
-
path="/features/search/interactions",
|
170
|
-
base_url=base_url,
|
171
|
-
url_variables=url_variables,
|
172
|
-
request=request,
|
173
|
-
request_body_required=False,
|
174
|
-
request_has_path_params=False,
|
175
|
-
request_has_query_params=True,
|
176
|
-
user_agent_header="user-agent",
|
177
|
-
accept_header_value="application/json",
|
178
|
-
http_headers=http_headers,
|
179
|
-
security=self.sdk_configuration.security,
|
180
|
-
timeout_ms=timeout_ms,
|
181
|
-
)
|
182
|
-
|
183
|
-
if retries == UNSET:
|
184
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
185
|
-
retries = self.sdk_configuration.retry_config
|
186
|
-
|
187
|
-
retry_config = None
|
188
|
-
if isinstance(retries, utils.RetryConfig):
|
189
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
190
|
-
|
191
|
-
http_res = await self.do_request_async(
|
192
|
-
hook_ctx=HookContext(
|
193
|
-
operation_id="list_interactions_features_search_interactions_get",
|
194
|
-
oauth2_scopes=[],
|
195
|
-
security_source=get_security_from_env(
|
196
|
-
self.sdk_configuration.security, models.Security
|
197
|
-
),
|
198
|
-
),
|
199
|
-
request=req,
|
200
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
201
|
-
retry_config=retry_config,
|
202
|
-
)
|
203
|
-
|
204
|
-
data: Any = None
|
205
|
-
if utils.match_response(http_res, "200", "application/json"):
|
206
|
-
return utils.unmarshal_json(http_res.text, List[models.InteractionResponse])
|
207
|
-
if utils.match_response(
|
208
|
-
http_res, ["400", "401", "403", "404", "500"], "application/json"
|
209
|
-
):
|
210
|
-
data = utils.unmarshal_json(http_res.text, models.ErrorResponseData)
|
211
|
-
raise models.ErrorResponse(data=data)
|
212
|
-
if utils.match_response(http_res, "422", "application/json"):
|
213
|
-
data = utils.unmarshal_json(http_res.text, models.HTTPValidationErrorData)
|
214
|
-
raise models.HTTPValidationError(data=data)
|
215
|
-
if utils.match_response(http_res, ["4XX", "5XX"], "*"):
|
216
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
217
|
-
raise models.APIError(
|
218
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
219
|
-
)
|
220
|
-
|
221
|
-
content_type = http_res.headers.get("Content-Type")
|
222
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
223
|
-
raise models.APIError(
|
224
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
225
|
-
http_res.status_code,
|
226
|
-
http_res_text,
|
227
|
-
http_res,
|
228
|
-
)
|
@@ -1,59 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from .searchinteraction import SearchInteraction, SearchInteractionTypedDict
|
5
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
6
|
-
from mixpeek.utils import FieldMetadata, HeaderMetadata, RequestMetadata
|
7
|
-
import pydantic
|
8
|
-
from pydantic import model_serializer
|
9
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
10
|
-
|
11
|
-
|
12
|
-
class CreateInteractionFeaturesSearchInteractionsPostRequestTypedDict(TypedDict):
|
13
|
-
search_interaction: SearchInteractionTypedDict
|
14
|
-
x_namespace: NotRequired[Nullable[str]]
|
15
|
-
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."""
|
16
|
-
|
17
|
-
|
18
|
-
class CreateInteractionFeaturesSearchInteractionsPostRequest(BaseModel):
|
19
|
-
search_interaction: Annotated[
|
20
|
-
SearchInteraction,
|
21
|
-
FieldMetadata(request=RequestMetadata(media_type="application/json")),
|
22
|
-
]
|
23
|
-
|
24
|
-
x_namespace: Annotated[
|
25
|
-
OptionalNullable[str],
|
26
|
-
pydantic.Field(alias="X-Namespace"),
|
27
|
-
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
28
|
-
] = UNSET
|
29
|
-
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."""
|
30
|
-
|
31
|
-
@model_serializer(mode="wrap")
|
32
|
-
def serialize_model(self, handler):
|
33
|
-
optional_fields = ["X-Namespace"]
|
34
|
-
nullable_fields = ["X-Namespace"]
|
35
|
-
null_default_fields = []
|
36
|
-
|
37
|
-
serialized = handler(self)
|
38
|
-
|
39
|
-
m = {}
|
40
|
-
|
41
|
-
for n, f in self.model_fields.items():
|
42
|
-
k = f.alias or n
|
43
|
-
val = serialized.get(k)
|
44
|
-
serialized.pop(k, None)
|
45
|
-
|
46
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
47
|
-
is_set = (
|
48
|
-
self.__pydantic_fields_set__.intersection({n})
|
49
|
-
or k in null_default_fields
|
50
|
-
) # pylint: disable=no-member
|
51
|
-
|
52
|
-
if val is not None and val != UNSET_SENTINEL:
|
53
|
-
m[k] = val
|
54
|
-
elif val != UNSET_SENTINEL and (
|
55
|
-
not k in optional_fields or (optional_nullable and is_set)
|
56
|
-
):
|
57
|
-
m[k] = val
|
58
|
-
|
59
|
-
return m
|
@@ -1,20 +0,0 @@
|
|
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 typing_extensions import TypedDict
|
6
|
-
|
7
|
-
|
8
|
-
class DbModelTaskResponseTypedDict(TypedDict):
|
9
|
-
message: str
|
10
|
-
r"""A message describing the status of the task"""
|
11
|
-
task_id: str
|
12
|
-
r"""The unique identifier for the processing task"""
|
13
|
-
|
14
|
-
|
15
|
-
class DbModelTaskResponse(BaseModel):
|
16
|
-
message: str
|
17
|
-
r"""A message describing the status of the task"""
|
18
|
-
|
19
|
-
task_id: str
|
20
|
-
r"""The unique identifier for the processing task"""
|
@@ -1,59 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
5
|
-
from mixpeek.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
|
6
|
-
import pydantic
|
7
|
-
from pydantic import model_serializer
|
8
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
9
|
-
|
10
|
-
|
11
|
-
class DeleteInteractionFeaturesSearchInteractionsInteractionIDDeleteRequestTypedDict(
|
12
|
-
TypedDict
|
13
|
-
):
|
14
|
-
interaction_id: str
|
15
|
-
x_namespace: NotRequired[Nullable[str]]
|
16
|
-
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."""
|
17
|
-
|
18
|
-
|
19
|
-
class DeleteInteractionFeaturesSearchInteractionsInteractionIDDeleteRequest(BaseModel):
|
20
|
-
interaction_id: Annotated[
|
21
|
-
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
22
|
-
]
|
23
|
-
|
24
|
-
x_namespace: Annotated[
|
25
|
-
OptionalNullable[str],
|
26
|
-
pydantic.Field(alias="X-Namespace"),
|
27
|
-
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
28
|
-
] = UNSET
|
29
|
-
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."""
|
30
|
-
|
31
|
-
@model_serializer(mode="wrap")
|
32
|
-
def serialize_model(self, handler):
|
33
|
-
optional_fields = ["X-Namespace"]
|
34
|
-
nullable_fields = ["X-Namespace"]
|
35
|
-
null_default_fields = []
|
36
|
-
|
37
|
-
serialized = handler(self)
|
38
|
-
|
39
|
-
m = {}
|
40
|
-
|
41
|
-
for n, f in self.model_fields.items():
|
42
|
-
k = f.alias or n
|
43
|
-
val = serialized.get(k)
|
44
|
-
serialized.pop(k, None)
|
45
|
-
|
46
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
47
|
-
is_set = (
|
48
|
-
self.__pydantic_fields_set__.intersection({n})
|
49
|
-
or k in null_default_fields
|
50
|
-
) # pylint: disable=no-member
|
51
|
-
|
52
|
-
if val is not None and val != UNSET_SENTINEL:
|
53
|
-
m[k] = val
|
54
|
-
elif val != UNSET_SENTINEL and (
|
55
|
-
not k in optional_fields or (optional_nullable and is_set)
|
56
|
-
):
|
57
|
-
m[k] = val
|
58
|
-
|
59
|
-
return m
|
@@ -1,59 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
5
|
-
from mixpeek.utils import FieldMetadata, HeaderMetadata, PathParamMetadata
|
6
|
-
import pydantic
|
7
|
-
from pydantic import model_serializer
|
8
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
9
|
-
|
10
|
-
|
11
|
-
class GetInteractionFeaturesSearchInteractionsInteractionIDGetRequestTypedDict(
|
12
|
-
TypedDict
|
13
|
-
):
|
14
|
-
interaction_id: str
|
15
|
-
x_namespace: NotRequired[Nullable[str]]
|
16
|
-
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."""
|
17
|
-
|
18
|
-
|
19
|
-
class GetInteractionFeaturesSearchInteractionsInteractionIDGetRequest(BaseModel):
|
20
|
-
interaction_id: Annotated[
|
21
|
-
str, FieldMetadata(path=PathParamMetadata(style="simple", explode=False))
|
22
|
-
]
|
23
|
-
|
24
|
-
x_namespace: Annotated[
|
25
|
-
OptionalNullable[str],
|
26
|
-
pydantic.Field(alias="X-Namespace"),
|
27
|
-
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
28
|
-
] = UNSET
|
29
|
-
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."""
|
30
|
-
|
31
|
-
@model_serializer(mode="wrap")
|
32
|
-
def serialize_model(self, handler):
|
33
|
-
optional_fields = ["X-Namespace"]
|
34
|
-
nullable_fields = ["X-Namespace"]
|
35
|
-
null_default_fields = []
|
36
|
-
|
37
|
-
serialized = handler(self)
|
38
|
-
|
39
|
-
m = {}
|
40
|
-
|
41
|
-
for n, f in self.model_fields.items():
|
42
|
-
k = f.alias or n
|
43
|
-
val = serialized.get(k)
|
44
|
-
serialized.pop(k, None)
|
45
|
-
|
46
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
47
|
-
is_set = (
|
48
|
-
self.__pydantic_fields_set__.intersection({n})
|
49
|
-
or k in null_default_fields
|
50
|
-
) # pylint: disable=no-member
|
51
|
-
|
52
|
-
if val is not None and val != UNSET_SENTINEL:
|
53
|
-
m[k] = val
|
54
|
-
elif val != UNSET_SENTINEL and (
|
55
|
-
not k in optional_fields or (optional_nullable and is_set)
|
56
|
-
):
|
57
|
-
m[k] = val
|
58
|
-
|
59
|
-
return m
|
@@ -1,87 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from .interactiontype import InteractionType
|
5
|
-
from .searchrequestfeatures_output import (
|
6
|
-
SearchRequestFeaturesOutput,
|
7
|
-
SearchRequestFeaturesOutputTypedDict,
|
8
|
-
)
|
9
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
10
|
-
from pydantic import model_serializer
|
11
|
-
from typing_extensions import NotRequired, TypedDict
|
12
|
-
|
13
|
-
|
14
|
-
class InteractionResponseMetadataTypedDict(TypedDict):
|
15
|
-
pass
|
16
|
-
|
17
|
-
|
18
|
-
class InteractionResponseMetadata(BaseModel):
|
19
|
-
pass
|
20
|
-
|
21
|
-
|
22
|
-
class InteractionResponseTypedDict(TypedDict):
|
23
|
-
feature_id: str
|
24
|
-
r"""ID of the item that was interacted with"""
|
25
|
-
interaction_type: InteractionType
|
26
|
-
interaction_id: str
|
27
|
-
r"""Unique identifier for this interaction"""
|
28
|
-
search_request: NotRequired[Nullable[SearchRequestFeaturesOutputTypedDict]]
|
29
|
-
r"""The search request that led to this interaction"""
|
30
|
-
position: NotRequired[Nullable[int]]
|
31
|
-
r"""Position in search results where interaction occurred"""
|
32
|
-
metadata: NotRequired[Nullable[InteractionResponseMetadataTypedDict]]
|
33
|
-
r"""Additional context about the interaction"""
|
34
|
-
session_id: NotRequired[Nullable[str]]
|
35
|
-
r"""Search session identifier"""
|
36
|
-
|
37
|
-
|
38
|
-
class InteractionResponse(BaseModel):
|
39
|
-
feature_id: str
|
40
|
-
r"""ID of the item that was interacted with"""
|
41
|
-
|
42
|
-
interaction_type: InteractionType
|
43
|
-
|
44
|
-
interaction_id: str
|
45
|
-
r"""Unique identifier for this interaction"""
|
46
|
-
|
47
|
-
search_request: OptionalNullable[SearchRequestFeaturesOutput] = UNSET
|
48
|
-
r"""The search request that led to this interaction"""
|
49
|
-
|
50
|
-
position: OptionalNullable[int] = UNSET
|
51
|
-
r"""Position in search results where interaction occurred"""
|
52
|
-
|
53
|
-
metadata: OptionalNullable[InteractionResponseMetadata] = UNSET
|
54
|
-
r"""Additional context about the interaction"""
|
55
|
-
|
56
|
-
session_id: OptionalNullable[str] = UNSET
|
57
|
-
r"""Search session identifier"""
|
58
|
-
|
59
|
-
@model_serializer(mode="wrap")
|
60
|
-
def serialize_model(self, handler):
|
61
|
-
optional_fields = ["search_request", "position", "metadata", "session_id"]
|
62
|
-
nullable_fields = ["search_request", "position", "metadata", "session_id"]
|
63
|
-
null_default_fields = []
|
64
|
-
|
65
|
-
serialized = handler(self)
|
66
|
-
|
67
|
-
m = {}
|
68
|
-
|
69
|
-
for n, f in self.model_fields.items():
|
70
|
-
k = f.alias or n
|
71
|
-
val = serialized.get(k)
|
72
|
-
serialized.pop(k, None)
|
73
|
-
|
74
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
75
|
-
is_set = (
|
76
|
-
self.__pydantic_fields_set__.intersection({n})
|
77
|
-
or k in null_default_fields
|
78
|
-
) # pylint: disable=no-member
|
79
|
-
|
80
|
-
if val is not None and val != UNSET_SENTINEL:
|
81
|
-
m[k] = val
|
82
|
-
elif val != UNSET_SENTINEL and (
|
83
|
-
not k in optional_fields or (optional_nullable and is_set)
|
84
|
-
):
|
85
|
-
m[k] = val
|
86
|
-
|
87
|
-
return m
|
@@ -1,11 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from enum import Enum
|
5
|
-
|
6
|
-
|
7
|
-
class InteractionType(str, Enum):
|
8
|
-
VIEW = "view"
|
9
|
-
CLICK = "click"
|
10
|
-
POSITIVE_FEEDBACK = "positive_feedback"
|
11
|
-
NEGATIVE_FEEDBACK = "negative_feedback"
|
@@ -1,96 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
5
|
-
from mixpeek.utils import FieldMetadata, HeaderMetadata, QueryParamMetadata
|
6
|
-
import pydantic
|
7
|
-
from pydantic import model_serializer
|
8
|
-
from typing import Optional
|
9
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
10
|
-
|
11
|
-
|
12
|
-
class ListInteractionsFeaturesSearchInteractionsGetRequestTypedDict(TypedDict):
|
13
|
-
feature_id: NotRequired[Nullable[str]]
|
14
|
-
interaction_type: NotRequired[Nullable[str]]
|
15
|
-
session_id: NotRequired[Nullable[str]]
|
16
|
-
page: NotRequired[Nullable[int]]
|
17
|
-
page_size: NotRequired[int]
|
18
|
-
x_namespace: NotRequired[Nullable[str]]
|
19
|
-
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."""
|
20
|
-
|
21
|
-
|
22
|
-
class ListInteractionsFeaturesSearchInteractionsGetRequest(BaseModel):
|
23
|
-
feature_id: Annotated[
|
24
|
-
OptionalNullable[str],
|
25
|
-
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
26
|
-
] = UNSET
|
27
|
-
|
28
|
-
interaction_type: Annotated[
|
29
|
-
OptionalNullable[str],
|
30
|
-
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
31
|
-
] = UNSET
|
32
|
-
|
33
|
-
session_id: Annotated[
|
34
|
-
OptionalNullable[str],
|
35
|
-
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
36
|
-
] = UNSET
|
37
|
-
|
38
|
-
page: Annotated[
|
39
|
-
OptionalNullable[int],
|
40
|
-
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
41
|
-
] = UNSET
|
42
|
-
|
43
|
-
page_size: Annotated[
|
44
|
-
Optional[int],
|
45
|
-
FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
|
46
|
-
] = 10
|
47
|
-
|
48
|
-
x_namespace: Annotated[
|
49
|
-
OptionalNullable[str],
|
50
|
-
pydantic.Field(alias="X-Namespace"),
|
51
|
-
FieldMetadata(header=HeaderMetadata(style="simple", explode=False)),
|
52
|
-
] = UNSET
|
53
|
-
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."""
|
54
|
-
|
55
|
-
@model_serializer(mode="wrap")
|
56
|
-
def serialize_model(self, handler):
|
57
|
-
optional_fields = [
|
58
|
-
"feature_id",
|
59
|
-
"interaction_type",
|
60
|
-
"session_id",
|
61
|
-
"page",
|
62
|
-
"page_size",
|
63
|
-
"X-Namespace",
|
64
|
-
]
|
65
|
-
nullable_fields = [
|
66
|
-
"feature_id",
|
67
|
-
"interaction_type",
|
68
|
-
"session_id",
|
69
|
-
"page",
|
70
|
-
"X-Namespace",
|
71
|
-
]
|
72
|
-
null_default_fields = []
|
73
|
-
|
74
|
-
serialized = handler(self)
|
75
|
-
|
76
|
-
m = {}
|
77
|
-
|
78
|
-
for n, f in self.model_fields.items():
|
79
|
-
k = f.alias or n
|
80
|
-
val = serialized.get(k)
|
81
|
-
serialized.pop(k, None)
|
82
|
-
|
83
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
84
|
-
is_set = (
|
85
|
-
self.__pydantic_fields_set__.intersection({n})
|
86
|
-
or k in null_default_fields
|
87
|
-
) # pylint: disable=no-member
|
88
|
-
|
89
|
-
if val is not None and val != UNSET_SENTINEL:
|
90
|
-
m[k] = val
|
91
|
-
elif val != UNSET_SENTINEL and (
|
92
|
-
not k in optional_fields or (optional_nullable and is_set)
|
93
|
-
):
|
94
|
-
m[k] = val
|
95
|
-
|
96
|
-
return m
|