mixpeek 0.15.0__py3-none-any.whl → 0.15.1__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 +6 -6
- mixpeek/sdk.py +0 -6
- mixpeek/sdkconfiguration.py +2 -2
- mixpeek/tasks.py +4 -4
- {mixpeek-0.15.0.dist-info → mixpeek-0.15.1.dist-info}/METADATA +1 -11
- {mixpeek-0.15.0.dist-info → mixpeek-0.15.1.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.1.dist-info}/WHEEL +0 -0
@@ -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
|
@@ -1,103 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from .filtercondition import FilterCondition, FilterConditionTypedDict
|
5
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
6
|
-
import pydantic
|
7
|
-
from pydantic import model_serializer
|
8
|
-
from typing import List, Union
|
9
|
-
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
10
|
-
|
11
|
-
|
12
|
-
class LogicalOperatorOutputTypedDict(TypedDict):
|
13
|
-
case_sensitive: NotRequired[Nullable[bool]]
|
14
|
-
r"""Whether to perform case-sensitive matching"""
|
15
|
-
and_: NotRequired[Nullable[List[LogicalOperatorOutputANDTypedDict]]]
|
16
|
-
r"""Logical AND operation"""
|
17
|
-
or_: NotRequired[Nullable[List[LogicalOperatorOutputORTypedDict]]]
|
18
|
-
r"""Logical OR operation"""
|
19
|
-
nor: NotRequired[Nullable[List[LogicalOperatorOutputNORTypedDict]]]
|
20
|
-
r"""Logical NOR operation"""
|
21
|
-
|
22
|
-
|
23
|
-
class LogicalOperatorOutput(BaseModel):
|
24
|
-
case_sensitive: OptionalNullable[bool] = UNSET
|
25
|
-
r"""Whether to perform case-sensitive matching"""
|
26
|
-
|
27
|
-
and_: Annotated[
|
28
|
-
OptionalNullable[List[LogicalOperatorOutputAND]], pydantic.Field(alias="AND")
|
29
|
-
] = UNSET
|
30
|
-
r"""Logical AND operation"""
|
31
|
-
|
32
|
-
or_: Annotated[
|
33
|
-
OptionalNullable[List[LogicalOperatorOutputOR]], pydantic.Field(alias="OR")
|
34
|
-
] = UNSET
|
35
|
-
r"""Logical OR operation"""
|
36
|
-
|
37
|
-
nor: Annotated[
|
38
|
-
OptionalNullable[List[LogicalOperatorOutputNOR]], pydantic.Field(alias="NOR")
|
39
|
-
] = UNSET
|
40
|
-
r"""Logical NOR operation"""
|
41
|
-
|
42
|
-
@model_serializer(mode="wrap")
|
43
|
-
def serialize_model(self, handler):
|
44
|
-
optional_fields = ["case_sensitive", "AND", "OR", "NOR"]
|
45
|
-
nullable_fields = ["case_sensitive", "AND", "OR", "NOR"]
|
46
|
-
null_default_fields = []
|
47
|
-
|
48
|
-
serialized = handler(self)
|
49
|
-
|
50
|
-
m = {}
|
51
|
-
|
52
|
-
for n, f in self.model_fields.items():
|
53
|
-
k = f.alias or n
|
54
|
-
val = serialized.get(k)
|
55
|
-
serialized.pop(k, None)
|
56
|
-
|
57
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
58
|
-
is_set = (
|
59
|
-
self.__pydantic_fields_set__.intersection({n})
|
60
|
-
or k in null_default_fields
|
61
|
-
) # pylint: disable=no-member
|
62
|
-
|
63
|
-
if val is not None and val != UNSET_SENTINEL:
|
64
|
-
m[k] = val
|
65
|
-
elif val != UNSET_SENTINEL and (
|
66
|
-
not k in optional_fields or (optional_nullable and is_set)
|
67
|
-
):
|
68
|
-
m[k] = val
|
69
|
-
|
70
|
-
return m
|
71
|
-
|
72
|
-
|
73
|
-
LogicalOperatorOutputANDTypedDict = TypeAliasType(
|
74
|
-
"LogicalOperatorOutputANDTypedDict",
|
75
|
-
Union[FilterConditionTypedDict, LogicalOperatorOutputTypedDict],
|
76
|
-
)
|
77
|
-
|
78
|
-
|
79
|
-
LogicalOperatorOutputAND = TypeAliasType(
|
80
|
-
"LogicalOperatorOutputAND", Union[FilterCondition, LogicalOperatorOutput]
|
81
|
-
)
|
82
|
-
|
83
|
-
|
84
|
-
LogicalOperatorOutputORTypedDict = TypeAliasType(
|
85
|
-
"LogicalOperatorOutputORTypedDict",
|
86
|
-
Union[FilterConditionTypedDict, LogicalOperatorOutputTypedDict],
|
87
|
-
)
|
88
|
-
|
89
|
-
|
90
|
-
LogicalOperatorOutputOR = TypeAliasType(
|
91
|
-
"LogicalOperatorOutputOR", Union[FilterCondition, LogicalOperatorOutput]
|
92
|
-
)
|
93
|
-
|
94
|
-
|
95
|
-
LogicalOperatorOutputNORTypedDict = TypeAliasType(
|
96
|
-
"LogicalOperatorOutputNORTypedDict",
|
97
|
-
Union[FilterConditionTypedDict, LogicalOperatorOutputTypedDict],
|
98
|
-
)
|
99
|
-
|
100
|
-
|
101
|
-
LogicalOperatorOutputNOR = TypeAliasType(
|
102
|
-
"LogicalOperatorOutputNOR", Union[FilterCondition, LogicalOperatorOutput]
|
103
|
-
)
|
@@ -1,82 +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_input import (
|
6
|
-
SearchRequestFeaturesInput,
|
7
|
-
SearchRequestFeaturesInputTypedDict,
|
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 MetadataTypedDict(TypedDict):
|
15
|
-
pass
|
16
|
-
|
17
|
-
|
18
|
-
class Metadata(BaseModel):
|
19
|
-
pass
|
20
|
-
|
21
|
-
|
22
|
-
class SearchInteractionTypedDict(TypedDict):
|
23
|
-
feature_id: str
|
24
|
-
r"""ID of the item that was interacted with"""
|
25
|
-
interaction_type: InteractionType
|
26
|
-
search_request: NotRequired[Nullable[SearchRequestFeaturesInputTypedDict]]
|
27
|
-
r"""The search request that led to this interaction"""
|
28
|
-
position: NotRequired[Nullable[int]]
|
29
|
-
r"""Position in search results where interaction occurred"""
|
30
|
-
metadata: NotRequired[Nullable[MetadataTypedDict]]
|
31
|
-
r"""Additional context about the interaction"""
|
32
|
-
session_id: NotRequired[Nullable[str]]
|
33
|
-
r"""Search session identifier"""
|
34
|
-
|
35
|
-
|
36
|
-
class SearchInteraction(BaseModel):
|
37
|
-
feature_id: str
|
38
|
-
r"""ID of the item that was interacted with"""
|
39
|
-
|
40
|
-
interaction_type: InteractionType
|
41
|
-
|
42
|
-
search_request: OptionalNullable[SearchRequestFeaturesInput] = UNSET
|
43
|
-
r"""The search request that led to this interaction"""
|
44
|
-
|
45
|
-
position: OptionalNullable[int] = UNSET
|
46
|
-
r"""Position in search results where interaction occurred"""
|
47
|
-
|
48
|
-
metadata: OptionalNullable[Metadata] = UNSET
|
49
|
-
r"""Additional context about the interaction"""
|
50
|
-
|
51
|
-
session_id: OptionalNullable[str] = UNSET
|
52
|
-
r"""Search session identifier"""
|
53
|
-
|
54
|
-
@model_serializer(mode="wrap")
|
55
|
-
def serialize_model(self, handler):
|
56
|
-
optional_fields = ["search_request", "position", "metadata", "session_id"]
|
57
|
-
nullable_fields = ["search_request", "position", "metadata", "session_id"]
|
58
|
-
null_default_fields = []
|
59
|
-
|
60
|
-
serialized = handler(self)
|
61
|
-
|
62
|
-
m = {}
|
63
|
-
|
64
|
-
for n, f in self.model_fields.items():
|
65
|
-
k = f.alias or n
|
66
|
-
val = serialized.get(k)
|
67
|
-
serialized.pop(k, None)
|
68
|
-
|
69
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
70
|
-
is_set = (
|
71
|
-
self.__pydantic_fields_set__.intersection({n})
|
72
|
-
or k in null_default_fields
|
73
|
-
) # pylint: disable=no-member
|
74
|
-
|
75
|
-
if val is not None and val != UNSET_SENTINEL:
|
76
|
-
m[k] = val
|
77
|
-
elif val != UNSET_SENTINEL and (
|
78
|
-
not k in optional_fields or (optional_nullable and is_set)
|
79
|
-
):
|
80
|
-
m[k] = val
|
81
|
-
|
82
|
-
return m
|
@@ -1,79 +0,0 @@
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
-
|
3
|
-
from __future__ import annotations
|
4
|
-
from .availablemodels import AvailableModels
|
5
|
-
from .logicaloperator_output import (
|
6
|
-
LogicalOperatorOutput,
|
7
|
-
LogicalOperatorOutputTypedDict,
|
8
|
-
)
|
9
|
-
from .querysettings import QuerySettings, QuerySettingsTypedDict
|
10
|
-
from enum import Enum
|
11
|
-
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
12
|
-
from pydantic import model_serializer
|
13
|
-
from typing_extensions import NotRequired, TypedDict
|
14
|
-
|
15
|
-
|
16
|
-
class SearchQueryOutputType(str, Enum):
|
17
|
-
r"""Type of input (text, url, or base64)"""
|
18
|
-
|
19
|
-
TEXT = "text"
|
20
|
-
URL = "url"
|
21
|
-
BASE64 = "base64"
|
22
|
-
|
23
|
-
|
24
|
-
class SearchQueryOutputTypedDict(TypedDict):
|
25
|
-
vector_index: AvailableModels
|
26
|
-
value: str
|
27
|
-
r"""Query value - can be text, URL, or base64 encoded image"""
|
28
|
-
type: SearchQueryOutputType
|
29
|
-
r"""Type of input (text, url, or base64)"""
|
30
|
-
filters: NotRequired[Nullable[LogicalOperatorOutputTypedDict]]
|
31
|
-
r"""Optional filters for the query, this is used for filtering individual vector indexes"""
|
32
|
-
settings: NotRequired[Nullable[QuerySettingsTypedDict]]
|
33
|
-
r"""Optional settings for this specific query"""
|
34
|
-
|
35
|
-
|
36
|
-
class SearchQueryOutput(BaseModel):
|
37
|
-
vector_index: AvailableModels
|
38
|
-
|
39
|
-
value: str
|
40
|
-
r"""Query value - can be text, URL, or base64 encoded image"""
|
41
|
-
|
42
|
-
type: SearchQueryOutputType
|
43
|
-
r"""Type of input (text, url, or base64)"""
|
44
|
-
|
45
|
-
filters: OptionalNullable[LogicalOperatorOutput] = UNSET
|
46
|
-
r"""Optional filters for the query, this is used for filtering individual vector indexes"""
|
47
|
-
|
48
|
-
settings: OptionalNullable[QuerySettings] = UNSET
|
49
|
-
r"""Optional settings for this specific query"""
|
50
|
-
|
51
|
-
@model_serializer(mode="wrap")
|
52
|
-
def serialize_model(self, handler):
|
53
|
-
optional_fields = ["filters", "settings"]
|
54
|
-
nullable_fields = ["filters", "settings"]
|
55
|
-
null_default_fields = []
|
56
|
-
|
57
|
-
serialized = handler(self)
|
58
|
-
|
59
|
-
m = {}
|
60
|
-
|
61
|
-
for n, f in self.model_fields.items():
|
62
|
-
k = f.alias or n
|
63
|
-
val = serialized.get(k)
|
64
|
-
serialized.pop(k, None)
|
65
|
-
|
66
|
-
optional_nullable = k in optional_fields and k in nullable_fields
|
67
|
-
is_set = (
|
68
|
-
self.__pydantic_fields_set__.intersection({n})
|
69
|
-
or k in null_default_fields
|
70
|
-
) # pylint: disable=no-member
|
71
|
-
|
72
|
-
if val is not None and val != UNSET_SENTINEL:
|
73
|
-
m[k] = val
|
74
|
-
elif val != UNSET_SENTINEL and (
|
75
|
-
not k in optional_fields or (optional_nullable and is_set)
|
76
|
-
):
|
77
|
-
m[k] = val
|
78
|
-
|
79
|
-
return m
|