mixpeek 0.11.2__py3-none-any.whl → 0.13__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 +9 -1
- mixpeek/_hooks/__init__.py +5 -0
- mixpeek/_hooks/registration.py +13 -0
- mixpeek/_hooks/sdkhooks.py +76 -0
- mixpeek/_hooks/types.py +94 -0
- mixpeek/_version.py +12 -0
- mixpeek/assets.py +1561 -0
- mixpeek/basesdk.py +350 -0
- mixpeek/collections.py +1029 -0
- mixpeek/featureextractors.py +205 -0
- mixpeek/features.py +1181 -0
- mixpeek/health.py +167 -0
- mixpeek/httpclient.py +84 -0
- mixpeek/ingest.py +831 -0
- mixpeek/interactions.py +221 -0
- mixpeek/models/__init__.py +751 -0
- mixpeek/models/actionusage.py +16 -0
- mixpeek/models/apierror.py +22 -0
- mixpeek/models/apikey.py +25 -0
- mixpeek/models/apikeyupdate.py +49 -0
- mixpeek/models/assetfeatures.py +55 -0
- mixpeek/models/assetresponse.py +166 -0
- mixpeek/models/assets_model_searchquery.py +21 -0
- mixpeek/models/assetupdate.py +28 -0
- mixpeek/models/availableindexesresponse.py +23 -0
- mixpeek/models/availablemodels.py +12 -0
- mixpeek/models/boolindexparams.py +18 -0
- mixpeek/models/collectionmodel.py +70 -0
- mixpeek/models/collectionresult.py +73 -0
- mixpeek/models/create_api_key_organizations_users_user_email_api_keys_postop.py +23 -0
- mixpeek/models/create_collection_collections_postop.py +62 -0
- mixpeek/models/create_interaction_features_search_interactions_postop.py +59 -0
- mixpeek/models/createcollectionrequest.py +59 -0
- mixpeek/models/createnamespacerequest.py +62 -0
- mixpeek/models/datetimeindexparams.py +18 -0
- mixpeek/models/dateusage.py +22 -0
- mixpeek/models/db_model_paginationresponse.py +59 -0
- mixpeek/models/db_model_taskresponse.py +20 -0
- mixpeek/models/delete_api_key_organizations_users_user_email_api_keys_key_name_deleteop.py +23 -0
- mixpeek/models/delete_asset_assets_asset_id_deleteop.py +57 -0
- mixpeek/models/delete_collection_collections_collection_deleteop.py +59 -0
- mixpeek/models/delete_feature_features_feature_id_deleteop.py +57 -0
- mixpeek/models/delete_interaction_features_search_interactions_interaction_id_deleteop.py +59 -0
- mixpeek/models/delete_namespace_namespaces_namespace_deleteop.py +18 -0
- mixpeek/models/delete_user_organizations_users_user_email_deleteop.py +16 -0
- mixpeek/models/denseembedding.py +16 -0
- mixpeek/models/embeddingrequest.py +59 -0
- mixpeek/models/embeddingresponse.py +64 -0
- mixpeek/models/errormessage.py +13 -0
- mixpeek/models/errorresponse.py +21 -0
- mixpeek/models/facedetectsettings.py +52 -0
- mixpeek/models/featureextractionembeddingrequest.py +54 -0
- mixpeek/models/featureresponse.py +74 -0
- mixpeek/models/features_model_paginationresponse.py +59 -0
- mixpeek/models/featureupdaterequest.py +21 -0
- mixpeek/models/filtercondition.py +74 -0
- mixpeek/models/floatindexparams.py +18 -0
- mixpeek/models/full_asset_update_assets_asset_id_putop.py +69 -0
- mixpeek/models/full_feature_update_features_feature_id_putop.py +69 -0
- mixpeek/models/geoindexparams.py +18 -0
- mixpeek/models/get_asset_assets_asset_id_getop.py +73 -0
- mixpeek/models/get_asset_with_features_assets_asset_id_features_getop.py +73 -0
- mixpeek/models/get_collection_collections_collection_getop.py +59 -0
- mixpeek/models/get_feature_features_feature_id_getop.py +70 -0
- mixpeek/models/get_interaction_features_search_interactions_interaction_id_getop.py +59 -0
- mixpeek/models/get_namespace_namespaces_namespace_getop.py +18 -0
- mixpeek/models/get_task_tasks_task_id_getop.py +57 -0
- mixpeek/models/get_user_organizations_users_user_email_getop.py +16 -0
- mixpeek/models/groupbyoptions.py +71 -0
- mixpeek/models/groupbyoptionsasset.py +71 -0
- mixpeek/models/groupedassetdata.py +18 -0
- mixpeek/models/healthcheckresponse.py +13 -0
- mixpeek/models/httpvalidationerror.py +21 -0
- mixpeek/models/imagedescribesettings.py +82 -0
- mixpeek/models/imagedetectsettings.py +53 -0
- mixpeek/models/imagereadsettings.py +71 -0
- mixpeek/models/imagesettings.py +79 -0
- mixpeek/models/ingest_image_url_ingest_images_url_postop.py +59 -0
- mixpeek/models/ingest_text_ingest_text_postop.py +59 -0
- mixpeek/models/ingest_video_url_ingest_videos_url_postop.py +59 -0
- mixpeek/models/inputtype.py +11 -0
- mixpeek/models/integerindexparams.py +24 -0
- mixpeek/models/interactionresponse.py +87 -0
- mixpeek/models/interactiontype.py +11 -0
- mixpeek/models/jsonimageoutputsettings.py +55 -0
- mixpeek/models/jsontextoutputsettings.py +55 -0
- mixpeek/models/jsonvideooutputsettings.py +55 -0
- mixpeek/models/keywordindexparams.py +21 -0
- mixpeek/models/kill_task_tasks_task_id_deleteop.py +57 -0
- mixpeek/models/list_assets_assets_postop.py +77 -0
- mixpeek/models/list_collections_collections_getop.py +65 -0
- mixpeek/models/list_features_features_postop.py +79 -0
- mixpeek/models/list_interactions_features_search_interactions_getop.py +96 -0
- mixpeek/models/listassetsrequest.py +75 -0
- mixpeek/models/listassetsresponse.py +22 -0
- mixpeek/models/listcollectionsresponse.py +22 -0
- mixpeek/models/listfeaturesrequest.py +77 -0
- mixpeek/models/listfeaturesresponse.py +22 -0
- mixpeek/models/logicaloperator_input.py +88 -0
- mixpeek/models/logicaloperator_output.py +103 -0
- mixpeek/models/logodetectsettings.py +52 -0
- mixpeek/models/modality.py +13 -0
- mixpeek/models/modeldetails.py +57 -0
- mixpeek/models/namespaceresponse.py +54 -0
- mixpeek/models/organizationmodel.py +45 -0
- mixpeek/models/partial_asset_update_assets_asset_id_patchop.py +69 -0
- mixpeek/models/payloadindexconfig.py +94 -0
- mixpeek/models/payloadindextype.py +17 -0
- mixpeek/models/payloadschematype.py +15 -0
- mixpeek/models/percolaterequest.py +57 -0
- mixpeek/models/permission.py +10 -0
- mixpeek/models/processimageurlinput.py +99 -0
- mixpeek/models/processtextinput.py +94 -0
- mixpeek/models/processvideourlinput.py +99 -0
- mixpeek/models/querysettings.py +56 -0
- mixpeek/models/rerankingoptions.py +47 -0
- mixpeek/models/search_assets_assets_search_postop.py +59 -0
- mixpeek/models/search_features_features_search_postop.py +96 -0
- mixpeek/models/search_model_searchquery_input.py +76 -0
- mixpeek/models/searchassetsrequest.py +78 -0
- mixpeek/models/searchinteraction.py +82 -0
- mixpeek/models/searchquery_output.py +79 -0
- mixpeek/models/searchrequestfeatures_input.py +151 -0
- mixpeek/models/searchrequestfeatures_output.py +151 -0
- mixpeek/models/sortoption.py +28 -0
- mixpeek/models/sparseembedding.py +21 -0
- mixpeek/models/tasks_model_taskresponse.py +24 -0
- mixpeek/models/taskstatus.py +16 -0
- mixpeek/models/textindexparams.py +31 -0
- mixpeek/models/textsettings.py +61 -0
- mixpeek/models/tokenizertype.py +11 -0
- mixpeek/models/update_api_key_organizations_users_user_email_api_keys_key_name_patchop.py +30 -0
- mixpeek/models/update_collection_collections_collection_putop.py +74 -0
- mixpeek/models/update_namespace_namespaces_namespace_putop.py +28 -0
- mixpeek/models/updateassetrequest.py +60 -0
- mixpeek/models/updatenamespacerequest.py +26 -0
- mixpeek/models/usage.py +18 -0
- mixpeek/models/usermodel_input.py +36 -0
- mixpeek/models/usermodel_output.py +36 -0
- mixpeek/models/uuidindexparams.py +21 -0
- mixpeek/models/validationerror.py +26 -0
- mixpeek/models/vectormodel.py +11 -0
- mixpeek/models/vectortype.py +9 -0
- mixpeek/models/videodescribesettings.py +82 -0
- mixpeek/models/videodetectsettings.py +53 -0
- mixpeek/models/videoreadsettings.py +71 -0
- mixpeek/models/videosettings.py +101 -0
- mixpeek/models/videotranscriptionsettings.py +69 -0
- mixpeek/namespaces.py +1143 -0
- mixpeek/organizations.py +1508 -0
- mixpeek/py.typed +1 -0
- mixpeek/sdk.py +135 -0
- mixpeek/sdkconfiguration.py +45 -0
- mixpeek/searchinteractions.py +647 -0
- mixpeek/tasks.py +387 -0
- mixpeek/types/__init__.py +21 -0
- mixpeek/types/basemodel.py +39 -0
- mixpeek/utils/__init__.py +97 -0
- mixpeek/utils/annotations.py +55 -0
- mixpeek/utils/enums.py +34 -0
- mixpeek/utils/eventstreaming.py +238 -0
- mixpeek/utils/forms.py +202 -0
- mixpeek/utils/headers.py +136 -0
- mixpeek/utils/logger.py +27 -0
- mixpeek/utils/metadata.py +118 -0
- mixpeek/utils/queryparams.py +205 -0
- mixpeek/utils/requestbodies.py +66 -0
- mixpeek/utils/retries.py +217 -0
- mixpeek/utils/security.py +174 -0
- mixpeek/utils/serializers.py +215 -0
- mixpeek/utils/url.py +155 -0
- mixpeek/utils/values.py +134 -0
- mixpeek-0.13.dist-info/METADATA +439 -0
- mixpeek-0.13.dist-info/RECORD +176 -0
- {mixpeek-0.11.2.dist-info → mixpeek-0.13.dist-info}/WHEEL +1 -2
- py.typed +1 -0
- mixpeek/client.py +0 -27
- mixpeek/endpoints/__init__.py +0 -0
- mixpeek/endpoints/collections.py +0 -86
- mixpeek/endpoints/embed.py +0 -66
- mixpeek/endpoints/index.py +0 -51
- mixpeek/endpoints/register.py +0 -34
- mixpeek/endpoints/search.py +0 -44
- mixpeek/endpoints/tasks.py +0 -26
- mixpeek/endpoints/tools.py +0 -138
- mixpeek/exceptions.py +0 -13
- mixpeek-0.11.2.dist-info/METADATA +0 -375
- mixpeek-0.11.2.dist-info/RECORD +0 -15
- mixpeek-0.11.2.dist-info/top_level.txt +0 -1
@@ -0,0 +1,76 @@
|
|
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_input import LogicalOperatorInput, LogicalOperatorInputTypedDict
|
6
|
+
from .querysettings import QuerySettings, QuerySettingsTypedDict
|
7
|
+
from enum import Enum
|
8
|
+
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
9
|
+
from pydantic import model_serializer
|
10
|
+
from typing_extensions import NotRequired, TypedDict
|
11
|
+
|
12
|
+
|
13
|
+
class Type(str, Enum):
|
14
|
+
r"""Type of input (text, url, or base64)"""
|
15
|
+
|
16
|
+
TEXT = "text"
|
17
|
+
URL = "url"
|
18
|
+
BASE64 = "base64"
|
19
|
+
|
20
|
+
|
21
|
+
class SearchModelSearchQueryInputTypedDict(TypedDict):
|
22
|
+
vector_index: AvailableModels
|
23
|
+
value: str
|
24
|
+
r"""Query value - can be text, URL, or base64 encoded image"""
|
25
|
+
type: Type
|
26
|
+
r"""Type of input (text, url, or base64)"""
|
27
|
+
filters: NotRequired[Nullable[LogicalOperatorInputTypedDict]]
|
28
|
+
r"""Optional filters for the query, this is used for filtering individual vector indexes"""
|
29
|
+
settings: NotRequired[Nullable[QuerySettingsTypedDict]]
|
30
|
+
r"""Optional settings for this specific query"""
|
31
|
+
|
32
|
+
|
33
|
+
class SearchModelSearchQueryInput(BaseModel):
|
34
|
+
vector_index: AvailableModels
|
35
|
+
|
36
|
+
value: str
|
37
|
+
r"""Query value - can be text, URL, or base64 encoded image"""
|
38
|
+
|
39
|
+
type: Type
|
40
|
+
r"""Type of input (text, url, or base64)"""
|
41
|
+
|
42
|
+
filters: OptionalNullable[LogicalOperatorInput] = UNSET
|
43
|
+
r"""Optional filters for the query, this is used for filtering individual vector indexes"""
|
44
|
+
|
45
|
+
settings: OptionalNullable[QuerySettings] = UNSET
|
46
|
+
r"""Optional settings for this specific query"""
|
47
|
+
|
48
|
+
@model_serializer(mode="wrap")
|
49
|
+
def serialize_model(self, handler):
|
50
|
+
optional_fields = ["filters", "settings"]
|
51
|
+
nullable_fields = ["filters", "settings"]
|
52
|
+
null_default_fields = []
|
53
|
+
|
54
|
+
serialized = handler(self)
|
55
|
+
|
56
|
+
m = {}
|
57
|
+
|
58
|
+
for n, f in self.model_fields.items():
|
59
|
+
k = f.alias or n
|
60
|
+
val = serialized.get(k)
|
61
|
+
serialized.pop(k, None)
|
62
|
+
|
63
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
64
|
+
is_set = (
|
65
|
+
self.__pydantic_fields_set__.intersection({n})
|
66
|
+
or k in null_default_fields
|
67
|
+
) # pylint: disable=no-member
|
68
|
+
|
69
|
+
if val is not None and val != UNSET_SENTINEL:
|
70
|
+
m[k] = val
|
71
|
+
elif val != UNSET_SENTINEL and (
|
72
|
+
not k in optional_fields or (optional_nullable and is_set)
|
73
|
+
):
|
74
|
+
m[k] = val
|
75
|
+
|
76
|
+
return m
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from .assets_model_searchquery import (
|
5
|
+
AssetsModelSearchQuery,
|
6
|
+
AssetsModelSearchQueryTypedDict,
|
7
|
+
)
|
8
|
+
from .logicaloperator_input import LogicalOperatorInput, LogicalOperatorInputTypedDict
|
9
|
+
from .sortoption import SortOption, SortOptionTypedDict
|
10
|
+
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
11
|
+
from pydantic import model_serializer
|
12
|
+
from typing import List
|
13
|
+
from typing_extensions import NotRequired, TypedDict
|
14
|
+
|
15
|
+
|
16
|
+
class SearchAssetsRequestTypedDict(TypedDict):
|
17
|
+
collections: List[str]
|
18
|
+
r"""List of Collection IDs or Names to search within, required"""
|
19
|
+
query: NotRequired[Nullable[AssetsModelSearchQueryTypedDict]]
|
20
|
+
r"""Structured query object specifying which fields to search in and what to search for"""
|
21
|
+
filters: NotRequired[Nullable[LogicalOperatorInputTypedDict]]
|
22
|
+
r"""Complex nested query filters"""
|
23
|
+
sort: NotRequired[Nullable[SortOptionTypedDict]]
|
24
|
+
r"""List of fields to sort by"""
|
25
|
+
select: NotRequired[Nullable[List[str]]]
|
26
|
+
r"""List of fields to return in results"""
|
27
|
+
return_url: NotRequired[Nullable[bool]]
|
28
|
+
r"""Return the presigned URL for the asset and preview asset, this will introduce additional latency"""
|
29
|
+
|
30
|
+
|
31
|
+
class SearchAssetsRequest(BaseModel):
|
32
|
+
collections: List[str]
|
33
|
+
r"""List of Collection IDs or Names to search within, required"""
|
34
|
+
|
35
|
+
query: OptionalNullable[AssetsModelSearchQuery] = UNSET
|
36
|
+
r"""Structured query object specifying which fields to search in and what to search for"""
|
37
|
+
|
38
|
+
filters: OptionalNullable[LogicalOperatorInput] = UNSET
|
39
|
+
r"""Complex nested query filters"""
|
40
|
+
|
41
|
+
sort: OptionalNullable[SortOption] = UNSET
|
42
|
+
r"""List of fields to sort by"""
|
43
|
+
|
44
|
+
select: OptionalNullable[List[str]] = UNSET
|
45
|
+
r"""List of fields to return in results"""
|
46
|
+
|
47
|
+
return_url: OptionalNullable[bool] = UNSET
|
48
|
+
r"""Return the presigned URL for the asset and preview asset, this will introduce additional latency"""
|
49
|
+
|
50
|
+
@model_serializer(mode="wrap")
|
51
|
+
def serialize_model(self, handler):
|
52
|
+
optional_fields = ["query", "filters", "sort", "select", "return_url"]
|
53
|
+
nullable_fields = ["query", "filters", "sort", "select", "return_url"]
|
54
|
+
null_default_fields = []
|
55
|
+
|
56
|
+
serialized = handler(self)
|
57
|
+
|
58
|
+
m = {}
|
59
|
+
|
60
|
+
for n, f in self.model_fields.items():
|
61
|
+
k = f.alias or n
|
62
|
+
val = serialized.get(k)
|
63
|
+
serialized.pop(k, None)
|
64
|
+
|
65
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
66
|
+
is_set = (
|
67
|
+
self.__pydantic_fields_set__.intersection({n})
|
68
|
+
or k in null_default_fields
|
69
|
+
) # pylint: disable=no-member
|
70
|
+
|
71
|
+
if val is not None and val != UNSET_SENTINEL:
|
72
|
+
m[k] = val
|
73
|
+
elif val != UNSET_SENTINEL and (
|
74
|
+
not k in optional_fields or (optional_nullable and is_set)
|
75
|
+
):
|
76
|
+
m[k] = val
|
77
|
+
|
78
|
+
return m
|
@@ -0,0 +1,82 @@
|
|
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
|
@@ -0,0 +1,79 @@
|
|
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
|
@@ -0,0 +1,151 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from .groupbyoptions import GroupByOptions, GroupByOptionsTypedDict
|
5
|
+
from .logicaloperator_input import LogicalOperatorInput, LogicalOperatorInputTypedDict
|
6
|
+
from .rerankingoptions import RerankingOptions, RerankingOptionsTypedDict
|
7
|
+
from .search_model_searchquery_input import (
|
8
|
+
SearchModelSearchQueryInput,
|
9
|
+
SearchModelSearchQueryInputTypedDict,
|
10
|
+
)
|
11
|
+
from .sortoption import SortOption, SortOptionTypedDict
|
12
|
+
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
13
|
+
from pydantic import model_serializer
|
14
|
+
from typing import List
|
15
|
+
from typing_extensions import NotRequired, TypedDict
|
16
|
+
|
17
|
+
|
18
|
+
class SearchRequestFeaturesInputTypedDict(TypedDict):
|
19
|
+
queries: List[SearchModelSearchQueryInputTypedDict]
|
20
|
+
r"""List of search queries to perform.
|
21
|
+
|
22
|
+
Behavior:
|
23
|
+
- Single query: Results are returned directly from that query
|
24
|
+
- Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF)
|
25
|
+
|
26
|
+
RRF combines results from multiple queries by:
|
27
|
+
1. Taking each item's rank position in each result list
|
28
|
+
2. Re-ranking all items by their combined RRF scores
|
29
|
+
|
30
|
+
When merging lists from different sources,
|
31
|
+
RRF considers all items that appear in any of the input lists,
|
32
|
+
not just items that appear in all lists.
|
33
|
+
|
34
|
+
This helps surface items that rank well across multiple queries while
|
35
|
+
reducing the impact of outlier high rankings in single queries.
|
36
|
+
|
37
|
+
NOTE: If query array is empty, it will return all features.
|
38
|
+
|
39
|
+
|
40
|
+
"""
|
41
|
+
collections: List[str]
|
42
|
+
r"""List of Collection names to search within, required"""
|
43
|
+
filters: NotRequired[Nullable[LogicalOperatorInputTypedDict]]
|
44
|
+
r"""Used for filtering across all indexes"""
|
45
|
+
group_by: NotRequired[Nullable[GroupByOptionsTypedDict]]
|
46
|
+
r"""Grouping options for search results"""
|
47
|
+
sort: NotRequired[Nullable[SortOptionTypedDict]]
|
48
|
+
r"""List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields."""
|
49
|
+
select: NotRequired[Nullable[List[str]]]
|
50
|
+
r"""List of fields to return in results, supports dot notation. If None, all fields are returned."""
|
51
|
+
reranking_options: NotRequired[Nullable[RerankingOptionsTypedDict]]
|
52
|
+
r"""Options for ranking the search results, including weights and feedback application"""
|
53
|
+
session_id: NotRequired[Nullable[str]]
|
54
|
+
r"""Identifier for tracking search session interactions"""
|
55
|
+
return_url: NotRequired[Nullable[bool]]
|
56
|
+
r"""Return the presigned URL for the asset and preview asset, this will introduce additional latency"""
|
57
|
+
|
58
|
+
|
59
|
+
class SearchRequestFeaturesInput(BaseModel):
|
60
|
+
queries: List[SearchModelSearchQueryInput]
|
61
|
+
r"""List of search queries to perform.
|
62
|
+
|
63
|
+
Behavior:
|
64
|
+
- Single query: Results are returned directly from that query
|
65
|
+
- Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF)
|
66
|
+
|
67
|
+
RRF combines results from multiple queries by:
|
68
|
+
1. Taking each item's rank position in each result list
|
69
|
+
2. Re-ranking all items by their combined RRF scores
|
70
|
+
|
71
|
+
When merging lists from different sources,
|
72
|
+
RRF considers all items that appear in any of the input lists,
|
73
|
+
not just items that appear in all lists.
|
74
|
+
|
75
|
+
This helps surface items that rank well across multiple queries while
|
76
|
+
reducing the impact of outlier high rankings in single queries.
|
77
|
+
|
78
|
+
NOTE: If query array is empty, it will return all features.
|
79
|
+
|
80
|
+
|
81
|
+
"""
|
82
|
+
|
83
|
+
collections: List[str]
|
84
|
+
r"""List of Collection names to search within, required"""
|
85
|
+
|
86
|
+
filters: OptionalNullable[LogicalOperatorInput] = UNSET
|
87
|
+
r"""Used for filtering across all indexes"""
|
88
|
+
|
89
|
+
group_by: OptionalNullable[GroupByOptions] = UNSET
|
90
|
+
r"""Grouping options for search results"""
|
91
|
+
|
92
|
+
sort: OptionalNullable[SortOption] = UNSET
|
93
|
+
r"""List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields."""
|
94
|
+
|
95
|
+
select: OptionalNullable[List[str]] = UNSET
|
96
|
+
r"""List of fields to return in results, supports dot notation. If None, all fields are returned."""
|
97
|
+
|
98
|
+
reranking_options: OptionalNullable[RerankingOptions] = UNSET
|
99
|
+
r"""Options for ranking the search results, including weights and feedback application"""
|
100
|
+
|
101
|
+
session_id: OptionalNullable[str] = UNSET
|
102
|
+
r"""Identifier for tracking search session interactions"""
|
103
|
+
|
104
|
+
return_url: OptionalNullable[bool] = UNSET
|
105
|
+
r"""Return the presigned URL for the asset and preview asset, this will introduce additional latency"""
|
106
|
+
|
107
|
+
@model_serializer(mode="wrap")
|
108
|
+
def serialize_model(self, handler):
|
109
|
+
optional_fields = [
|
110
|
+
"filters",
|
111
|
+
"group_by",
|
112
|
+
"sort",
|
113
|
+
"select",
|
114
|
+
"reranking_options",
|
115
|
+
"session_id",
|
116
|
+
"return_url",
|
117
|
+
]
|
118
|
+
nullable_fields = [
|
119
|
+
"filters",
|
120
|
+
"group_by",
|
121
|
+
"sort",
|
122
|
+
"select",
|
123
|
+
"reranking_options",
|
124
|
+
"session_id",
|
125
|
+
"return_url",
|
126
|
+
]
|
127
|
+
null_default_fields = []
|
128
|
+
|
129
|
+
serialized = handler(self)
|
130
|
+
|
131
|
+
m = {}
|
132
|
+
|
133
|
+
for n, f in self.model_fields.items():
|
134
|
+
k = f.alias or n
|
135
|
+
val = serialized.get(k)
|
136
|
+
serialized.pop(k, None)
|
137
|
+
|
138
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
139
|
+
is_set = (
|
140
|
+
self.__pydantic_fields_set__.intersection({n})
|
141
|
+
or k in null_default_fields
|
142
|
+
) # pylint: disable=no-member
|
143
|
+
|
144
|
+
if val is not None and val != UNSET_SENTINEL:
|
145
|
+
m[k] = val
|
146
|
+
elif val != UNSET_SENTINEL and (
|
147
|
+
not k in optional_fields or (optional_nullable and is_set)
|
148
|
+
):
|
149
|
+
m[k] = val
|
150
|
+
|
151
|
+
return m
|
@@ -0,0 +1,151 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from .groupbyoptions import GroupByOptions, GroupByOptionsTypedDict
|
5
|
+
from .logicaloperator_output import (
|
6
|
+
LogicalOperatorOutput,
|
7
|
+
LogicalOperatorOutputTypedDict,
|
8
|
+
)
|
9
|
+
from .rerankingoptions import RerankingOptions, RerankingOptionsTypedDict
|
10
|
+
from .searchquery_output import SearchQueryOutput, SearchQueryOutputTypedDict
|
11
|
+
from .sortoption import SortOption, SortOptionTypedDict
|
12
|
+
from mixpeek.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
13
|
+
from pydantic import model_serializer
|
14
|
+
from typing import List
|
15
|
+
from typing_extensions import NotRequired, TypedDict
|
16
|
+
|
17
|
+
|
18
|
+
class SearchRequestFeaturesOutputTypedDict(TypedDict):
|
19
|
+
queries: List[SearchQueryOutputTypedDict]
|
20
|
+
r"""List of search queries to perform.
|
21
|
+
|
22
|
+
Behavior:
|
23
|
+
- Single query: Results are returned directly from that query
|
24
|
+
- Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF)
|
25
|
+
|
26
|
+
RRF combines results from multiple queries by:
|
27
|
+
1. Taking each item's rank position in each result list
|
28
|
+
2. Re-ranking all items by their combined RRF scores
|
29
|
+
|
30
|
+
When merging lists from different sources,
|
31
|
+
RRF considers all items that appear in any of the input lists,
|
32
|
+
not just items that appear in all lists.
|
33
|
+
|
34
|
+
This helps surface items that rank well across multiple queries while
|
35
|
+
reducing the impact of outlier high rankings in single queries.
|
36
|
+
|
37
|
+
NOTE: If query array is empty, it will return all features.
|
38
|
+
|
39
|
+
|
40
|
+
"""
|
41
|
+
collections: List[str]
|
42
|
+
r"""List of Collection names to search within, required"""
|
43
|
+
filters: NotRequired[Nullable[LogicalOperatorOutputTypedDict]]
|
44
|
+
r"""Used for filtering across all indexes"""
|
45
|
+
group_by: NotRequired[Nullable[GroupByOptionsTypedDict]]
|
46
|
+
r"""Grouping options for search results"""
|
47
|
+
sort: NotRequired[Nullable[SortOptionTypedDict]]
|
48
|
+
r"""List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields."""
|
49
|
+
select: NotRequired[Nullable[List[str]]]
|
50
|
+
r"""List of fields to return in results, supports dot notation. If None, all fields are returned."""
|
51
|
+
reranking_options: NotRequired[Nullable[RerankingOptionsTypedDict]]
|
52
|
+
r"""Options for ranking the search results, including weights and feedback application"""
|
53
|
+
session_id: NotRequired[Nullable[str]]
|
54
|
+
r"""Identifier for tracking search session interactions"""
|
55
|
+
return_url: NotRequired[Nullable[bool]]
|
56
|
+
r"""Return the presigned URL for the asset and preview asset, this will introduce additional latency"""
|
57
|
+
|
58
|
+
|
59
|
+
class SearchRequestFeaturesOutput(BaseModel):
|
60
|
+
queries: List[SearchQueryOutput]
|
61
|
+
r"""List of search queries to perform.
|
62
|
+
|
63
|
+
Behavior:
|
64
|
+
- Single query: Results are returned directly from that query
|
65
|
+
- Multiple queries: Results are combined using Reciprocal Rank Fusion (RRF)
|
66
|
+
|
67
|
+
RRF combines results from multiple queries by:
|
68
|
+
1. Taking each item's rank position in each result list
|
69
|
+
2. Re-ranking all items by their combined RRF scores
|
70
|
+
|
71
|
+
When merging lists from different sources,
|
72
|
+
RRF considers all items that appear in any of the input lists,
|
73
|
+
not just items that appear in all lists.
|
74
|
+
|
75
|
+
This helps surface items that rank well across multiple queries while
|
76
|
+
reducing the impact of outlier high rankings in single queries.
|
77
|
+
|
78
|
+
NOTE: If query array is empty, it will return all features.
|
79
|
+
|
80
|
+
|
81
|
+
"""
|
82
|
+
|
83
|
+
collections: List[str]
|
84
|
+
r"""List of Collection names to search within, required"""
|
85
|
+
|
86
|
+
filters: OptionalNullable[LogicalOperatorOutput] = UNSET
|
87
|
+
r"""Used for filtering across all indexes"""
|
88
|
+
|
89
|
+
group_by: OptionalNullable[GroupByOptions] = UNSET
|
90
|
+
r"""Grouping options for search results"""
|
91
|
+
|
92
|
+
sort: OptionalNullable[SortOption] = UNSET
|
93
|
+
r"""List of fields to sort by, with direction (asc or desc). Supports dot notation for nested fields."""
|
94
|
+
|
95
|
+
select: OptionalNullable[List[str]] = UNSET
|
96
|
+
r"""List of fields to return in results, supports dot notation. If None, all fields are returned."""
|
97
|
+
|
98
|
+
reranking_options: OptionalNullable[RerankingOptions] = UNSET
|
99
|
+
r"""Options for ranking the search results, including weights and feedback application"""
|
100
|
+
|
101
|
+
session_id: OptionalNullable[str] = UNSET
|
102
|
+
r"""Identifier for tracking search session interactions"""
|
103
|
+
|
104
|
+
return_url: OptionalNullable[bool] = UNSET
|
105
|
+
r"""Return the presigned URL for the asset and preview asset, this will introduce additional latency"""
|
106
|
+
|
107
|
+
@model_serializer(mode="wrap")
|
108
|
+
def serialize_model(self, handler):
|
109
|
+
optional_fields = [
|
110
|
+
"filters",
|
111
|
+
"group_by",
|
112
|
+
"sort",
|
113
|
+
"select",
|
114
|
+
"reranking_options",
|
115
|
+
"session_id",
|
116
|
+
"return_url",
|
117
|
+
]
|
118
|
+
nullable_fields = [
|
119
|
+
"filters",
|
120
|
+
"group_by",
|
121
|
+
"sort",
|
122
|
+
"select",
|
123
|
+
"reranking_options",
|
124
|
+
"session_id",
|
125
|
+
"return_url",
|
126
|
+
]
|
127
|
+
null_default_fields = []
|
128
|
+
|
129
|
+
serialized = handler(self)
|
130
|
+
|
131
|
+
m = {}
|
132
|
+
|
133
|
+
for n, f in self.model_fields.items():
|
134
|
+
k = f.alias or n
|
135
|
+
val = serialized.get(k)
|
136
|
+
serialized.pop(k, None)
|
137
|
+
|
138
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
139
|
+
is_set = (
|
140
|
+
self.__pydantic_fields_set__.intersection({n})
|
141
|
+
or k in null_default_fields
|
142
|
+
) # pylint: disable=no-member
|
143
|
+
|
144
|
+
if val is not None and val != UNSET_SENTINEL:
|
145
|
+
m[k] = val
|
146
|
+
elif val != UNSET_SENTINEL and (
|
147
|
+
not k in optional_fields or (optional_nullable and is_set)
|
148
|
+
):
|
149
|
+
m[k] = val
|
150
|
+
|
151
|
+
return m
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
from enum import Enum
|
5
|
+
from mixpeek.types import BaseModel
|
6
|
+
from typing_extensions import TypedDict
|
7
|
+
|
8
|
+
|
9
|
+
class Direction(str, Enum):
|
10
|
+
r"""Sort direction"""
|
11
|
+
|
12
|
+
ASC = "asc"
|
13
|
+
DESC = "desc"
|
14
|
+
|
15
|
+
|
16
|
+
class SortOptionTypedDict(TypedDict):
|
17
|
+
field: str
|
18
|
+
r"""Field to sort by, supports dot notation for nested fields"""
|
19
|
+
direction: Direction
|
20
|
+
r"""Sort direction"""
|
21
|
+
|
22
|
+
|
23
|
+
class SortOption(BaseModel):
|
24
|
+
field: str
|
25
|
+
r"""Field to sort by, supports dot notation for nested fields"""
|
26
|
+
|
27
|
+
direction: Direction
|
28
|
+
r"""Sort direction"""
|
@@ -0,0 +1,21 @@
|
|
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 import List
|
6
|
+
from typing_extensions import TypedDict
|
7
|
+
|
8
|
+
|
9
|
+
class SparseEmbeddingTypedDict(TypedDict):
|
10
|
+
indices: List[int]
|
11
|
+
r"""Indices for sparse vector"""
|
12
|
+
values: List[float]
|
13
|
+
r"""Values for sparse vector"""
|
14
|
+
|
15
|
+
|
16
|
+
class SparseEmbedding(BaseModel):
|
17
|
+
indices: List[int]
|
18
|
+
r"""Indices for sparse vector"""
|
19
|
+
|
20
|
+
values: List[float]
|
21
|
+
r"""Values for sparse vector"""
|