mixpeek 0.20.20__py3-none-any.whl → 0.21.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 +3 -3
- mixpeek/{assets.py → bucket_objects.py} +309 -793
- mixpeek/buckets.py +1292 -0
- mixpeek/clusters.py +306 -0
- mixpeek/collection_cache.py +820 -0
- mixpeek/{taxonomyentities.py → collection_documents.py} +305 -559
- mixpeek/collections.py +122 -996
- mixpeek/features.py +45 -991
- mixpeek/models/__init__.py +625 -570
- mixpeek/models/aggregationtype.py +13 -0
- mixpeek/models/apikeyupdate.py +1 -1
- mixpeek/models/attributebasedconfig.py +21 -0
- mixpeek/models/automaticnaming.py +29 -0
- mixpeek/models/basicfeatureextractor.py +35 -0
- mixpeek/models/{classify_features_v1_entities_taxonomies_taxonomy_classify_postop.py → batch_delete_documents_v1_collections_collection_identifier_documents_batch_deleteop.py} +17 -15
- mixpeek/models/{update_collection_v1_collections_collection_putop.py → batch_update_documents_v1_collections_collection_identifier_documents_batch_putop.py} +29 -19
- mixpeek/models/blobdetails.py +72 -0
- mixpeek/models/blobmodel.py +107 -0
- mixpeek/models/bucketcreaterequest.py +75 -0
- mixpeek/models/bucketresponse.py +90 -0
- mixpeek/models/bucketschema_input.py +37 -0
- mixpeek/models/bucketschema_output.py +37 -0
- mixpeek/models/{featureresponse.py → bucketschemafield_input.py} +45 -18
- mixpeek/models/bucketschemafield_output.py +101 -0
- mixpeek/models/bucketschemafieldtype.py +29 -0
- mixpeek/models/bucketupdaterequest.py +68 -0
- mixpeek/models/cachestats.py +40 -0
- mixpeek/models/{list_collections_v1_collections_getop.py → cleanup_cache_v1_collections_cache_cleanup_postop.py} +23 -12
- mixpeek/models/{inputtype.py → clusteringmethod.py} +3 -5
- mixpeek/models/clustertype.py +9 -0
- mixpeek/models/collectioncacheconfig_input.py +92 -0
- mixpeek/models/collectioncacheconfig_output.py +92 -0
- mixpeek/models/collectionconfig.py +32 -0
- mixpeek/models/collectionmodel.py +79 -8
- mixpeek/models/{create_taxonomy_v1_entities_taxonomies_postop.py → create_bucket_v1_buckets_create_postop.py} +7 -7
- mixpeek/models/{search_assets_v1_assets_search_postop.py → create_cluster_v1_clusters_postop.py} +7 -7
- mixpeek/models/{create_collection_v1_collections_postop.py → create_collection_v1_collections_create_postop.py} +3 -3
- mixpeek/models/{ingest_video_url_v1_ingest_videos_url_postop.py → create_interaction_v1_retrievers_interactions_postop.py} +7 -7
- mixpeek/models/{partial_asset_update_v1_assets_asset_id_patchop.py → create_object_v1_buckets_bucket_identifier_objects_create_postop.py} +11 -9
- mixpeek/models/{ingest_text_v1_ingest_text_postop.py → create_retriever_v1_retrievers_retrievers_postop.py} +10 -7
- mixpeek/models/{ingest_image_url_v1_ingest_images_url_postop.py → create_taxonomy_v1_taxonomies_postop.py} +7 -7
- mixpeek/models/createblobrequest.py +80 -0
- mixpeek/models/createclusterrequest.py +74 -0
- mixpeek/models/createcollectionrequest.py +72 -3
- mixpeek/models/createnamespacerequest.py +14 -8
- mixpeek/models/createobjectrequest.py +75 -0
- mixpeek/models/createretrieverrequest.py +90 -0
- mixpeek/models/{taxonomyupdate.py → createtaxonomyrequest.py} +15 -13
- mixpeek/models/{delete_asset_v1_assets_asset_id_deleteop.py → delete_bucket_v1_buckets_bucket_identifier_deleteop.py} +5 -5
- mixpeek/models/{delete_classifications_v1_entities_taxonomies_taxonomy_classifications_classification_id_deleteop.py → delete_document_v1_collections_collection_identifier_documents_document_id_deleteop.py} +11 -11
- mixpeek/models/{get_taxonomy_v1_entities_taxonomies_taxonomy_getop.py → delete_interaction_v1_retrievers_interactions_interaction_id_deleteop.py} +7 -7
- mixpeek/models/delete_object_v1_buckets_bucket_identifier_objects_object_identifier_deleteop.py +70 -0
- mixpeek/models/{featureextractionembeddingrequest.py → documenthandlingconfig.py} +12 -15
- mixpeek/models/documentinputhandling.py +11 -0
- mixpeek/models/{jsontextoutputsettings.py → documentlistresponse.py} +15 -14
- mixpeek/models/documentoutputhandling.py +10 -0
- mixpeek/models/documentoutputtype.py +11 -0
- mixpeek/models/documentresponse.py +87 -0
- mixpeek/models/{nodeupdate.py → documentupdate.py} +22 -13
- mixpeek/models/enrichmentfield.py +25 -0
- mixpeek/models/errordetail.py +1 -1
- mixpeek/models/{update_node_v1_entities_taxonomies_nodes_node_patchop.py → execute_retriever_v1_retrievers_retrievers_retriever_id_execute_postop.py} +11 -11
- mixpeek/models/featureextractorconfig.py +116 -0
- mixpeek/models/featureextractordefinition.py +192 -0
- mixpeek/models/filtercondition.py +25 -25
- mixpeek/models/filteroperator.py +24 -0
- mixpeek/models/generativemodels.py +10 -0
- mixpeek/models/{delete_feature_v1_features_feature_id_deleteop.py → get_bucket_v1_buckets_bucket_identifier_getop.py} +5 -5
- mixpeek/models/{list_taxonomies_v1_entities_taxonomies_getop.py → get_cache_stats_v1_collections_cache_stats_getop.py} +16 -14
- mixpeek/models/get_collection_v1_collections_collection_id_getop.py +59 -0
- mixpeek/models/get_document_v1_collections_collection_identifier_documents_document_id_getop.py +70 -0
- mixpeek/models/get_feature_extractor_v1_features_extractors_feature_id_getop.py +16 -0
- mixpeek/models/get_interaction_v1_retrievers_interactions_interaction_id_getop.py +57 -0
- mixpeek/models/{delete_collection_v1_collections_collection_deleteop.py → get_object_v1_buckets_bucket_identifier_objects_object_identifier_getop.py} +16 -7
- mixpeek/models/get_research_v1_research_getop.py +52 -0
- mixpeek/models/get_retriever_stages_v1_retrievers_stages_getop.py +52 -0
- mixpeek/models/{delete_taxonomy_v1_entities_taxonomies_taxonomy_deleteop.py → get_retriever_v1_retrievers_retrievers_retriever_id_getop.py} +5 -7
- mixpeek/models/get_task_v1_tasks_task_id_getop.py +1 -1
- mixpeek/models/getusagerequestmodel.py +91 -0
- mixpeek/models/hdbscanparameters.py +26 -0
- mixpeek/models/interactionresponse.py +86 -0
- mixpeek/models/interactiontype.py +22 -0
- mixpeek/models/{search_features_v1_features_search_postop.py → invalidate_cache_v1_collections_cache_invalidate_postop.py} +60 -34
- mixpeek/models/invalidationevent.py +67 -0
- mixpeek/models/invalidationstrategy.py +12 -0
- mixpeek/models/kill_task_v1_tasks_task_id_deleteop.py +1 -1
- mixpeek/models/list_active_tasks_v1_tasks_getop.py +1 -1
- mixpeek/models/{list_assets_v1_assets_postop.py → list_buckets_v1_buckets_postop.py} +18 -18
- mixpeek/models/{list_features_v1_features_postop.py → list_documents_v1_collections_collection_identifier_documents_getop.py} +54 -19
- mixpeek/models/list_interactions_v1_retrievers_interactions_getop.py +96 -0
- mixpeek/models/{list_classifications_v1_entities_taxonomies_taxonomy_classifications_postop.py → list_objects_v1_buckets_bucket_identifier_objects_postop.py} +22 -29
- mixpeek/models/{groupbyoptionsasset.py → listbucketsrequest.py} +19 -28
- mixpeek/models/listbucketsresponse.py +23 -0
- mixpeek/models/{groupbyoptions.py → listobjectsrequest.py} +19 -28
- mixpeek/models/listobjectsresponse.py +25 -0
- mixpeek/models/listtasksresponse.py +3 -6
- mixpeek/models/{logicaloperator.py → logicaloperator_input.py} +42 -24
- mixpeek/models/logicaloperator_output.py +121 -0
- mixpeek/models/multivectorindex.py +25 -0
- mixpeek/models/namespaceresponse.py +1 -1
- mixpeek/models/namespaceusage.py +45 -0
- mixpeek/models/namingmethod.py +8 -0
- mixpeek/models/objectresponse.py +124 -0
- mixpeek/models/{db_model_paginationresponse.py → paginationresponse.py} +3 -3
- mixpeek/models/payloadindexconfig.py +1 -1
- mixpeek/models/plan.py +82 -0
- mixpeek/models/recomputestrategy.py +12 -0
- mixpeek/models/resourcetotals.py +39 -0
- mixpeek/models/{jsonvideooutputsettings.py → retrieverbinding.py} +19 -11
- mixpeek/models/{logodetectsettings.py → retrievercacheconfig.py} +20 -11
- mixpeek/models/retrievermodel.py +95 -0
- mixpeek/models/retrieverqueryrequest.py +114 -0
- mixpeek/models/retrieverresponse.py +24 -0
- mixpeek/models/searchinteraction.py +81 -0
- mixpeek/models/singlelineageentry.py +99 -0
- mixpeek/models/sortdirection.py +11 -0
- mixpeek/models/sortoption.py +20 -12
- mixpeek/models/sourceconfig_input.py +72 -0
- mixpeek/models/sourceconfig_output.py +75 -0
- mixpeek/models/sourcetype.py +11 -0
- mixpeek/models/stageconfig_input.py +111 -0
- mixpeek/models/stageconfig_output.py +114 -0
- mixpeek/models/stagedefinition.py +110 -0
- mixpeek/models/{jsonimageoutputsettings.py → stageresponse.py} +21 -11
- mixpeek/models/taskresponse.py +1 -1
- mixpeek/models/taskstatus.py +1 -0
- mixpeek/models/{assetfeatures.py → taxonomyapplicationconfig.py} +23 -15
- mixpeek/models/taxonomyconfig.py +19 -0
- mixpeek/models/timeseriesdatapoint.py +25 -0
- mixpeek/models/timeseriesusage.py +36 -0
- mixpeek/models/{full_asset_update_v1_assets_asset_id_putop.py → update_bucket_v1_buckets_bucket_identifier_putop.py} +9 -9
- mixpeek/models/{update_taxonomy_v1_entities_taxonomies_taxonomy_patchop.py → update_document_v1_collections_collection_identifier_documents_document_id_putop.py} +25 -13
- mixpeek/models/{full_feature_update_v1_features_feature_id_putop.py → update_object_v1_buckets_bucket_identifier_objects_object_identifier_putop.py} +20 -9
- mixpeek/models/updatenamespacerequest.py +1 -1
- mixpeek/models/updateobjectrequest.py +75 -0
- mixpeek/models/usageresponse.py +86 -0
- mixpeek/models/usagesummary.py +39 -0
- mixpeek/models/usagetimerange.py +16 -0
- mixpeek/models/usermodel_input.py +3 -0
- mixpeek/models/usermodel_output.py +3 -0
- mixpeek/models/vectorbasedconfig.py +60 -0
- mixpeek/models/{collectionresult.py → vectorindex.py} +20 -15
- mixpeek/models/vectorindexdefinition.py +43 -0
- mixpeek/models/vectortype.py +4 -1
- mixpeek/namespaces.py +26 -480
- mixpeek/organization_notifications.py +214 -0
- mixpeek/organizations.py +6 -210
- mixpeek/{featureextractors.py → organizations_usage.py} +31 -39
- mixpeek/research.py +228 -0
- mixpeek/retriever_interactions.py +1036 -0
- mixpeek/retriever_stages.py +232 -0
- mixpeek/{ingestassets.py → retrievers.py} +209 -271
- mixpeek/sdk.py +40 -23
- mixpeek/taxonomies.py +43 -513
- mixpeek/types/basemodel.py +3 -3
- mixpeek/utils/enums.py +67 -27
- {mixpeek-0.20.20.dist-info → mixpeek-0.21.1.dist-info}/METADATA +68 -50
- mixpeek-0.21.1.dist-info/RECORD +216 -0
- {mixpeek-0.20.20.dist-info → mixpeek-0.21.1.dist-info}/WHEEL +1 -1
- mixpeek/models/actionusage.py +0 -16
- mixpeek/models/assetresponse.py +0 -166
- mixpeek/models/assets_model_searchquery.py +0 -21
- mixpeek/models/assetupdate.py +0 -28
- mixpeek/models/assignmentconfig.py +0 -67
- mixpeek/models/assignmentmode.py +0 -11
- mixpeek/models/availablemodels.py +0 -16
- mixpeek/models/availablemodelsresponse.py +0 -27
- mixpeek/models/classificationmatch.py +0 -77
- mixpeek/models/classificationwithfeature.py +0 -73
- mixpeek/models/collectiondetailsresponse.py +0 -83
- mixpeek/models/dateusage.py +0 -22
- mixpeek/models/denseembedding.py +0 -16
- mixpeek/models/discoverrequest.py +0 -64
- mixpeek/models/embeddingconfig.py +0 -33
- mixpeek/models/embeddingrequest.py +0 -92
- mixpeek/models/embeddingresponse.py +0 -64
- mixpeek/models/entitysettings.py +0 -50
- mixpeek/models/featureoptions.py +0 -25
- mixpeek/models/features_model_paginationresponse.py +0 -59
- mixpeek/models/featureupdaterequest.py +0 -21
- mixpeek/models/get_asset_v1_assets_asset_id_getop.py +0 -73
- mixpeek/models/get_asset_with_features_v1_assets_asset_id_features_getop.py +0 -73
- mixpeek/models/get_collection_details_v1_collections_collection_details_getop.py +0 -59
- mixpeek/models/get_collection_details_v1_collections_collection_getop.py +0 -59
- mixpeek/models/get_feature_v1_features_feature_id_getop.py +0 -70
- mixpeek/models/get_taxonomy_node_v1_entities_taxonomies_nodes_node_getop.py +0 -59
- mixpeek/models/groupedassetdata.py +0 -18
- mixpeek/models/imagedescribesettings.py +0 -82
- mixpeek/models/imagedetectsettings.py +0 -47
- mixpeek/models/imagereadsettings.py +0 -71
- mixpeek/models/imagesettings.py +0 -92
- mixpeek/models/listassetsrequest.py +0 -75
- mixpeek/models/listassetsresponse.py +0 -22
- mixpeek/models/listclassificationsrequest.py +0 -69
- mixpeek/models/listclassificationsresponse.py +0 -31
- mixpeek/models/listcollectionsresponse.py +0 -22
- mixpeek/models/listfeaturesrequest.py +0 -77
- mixpeek/models/listfeaturesresponse.py +0 -22
- mixpeek/models/listtaxonomiesresponse.py +0 -24
- mixpeek/models/modality.py +0 -13
- mixpeek/models/modeldetails.py +0 -61
- mixpeek/models/nodeoptions.py +0 -16
- mixpeek/models/patch_namespace_v1_namespaces_namespace_patchop.py +0 -28
- mixpeek/models/payloadindextype.py +0 -17
- mixpeek/models/processimageurlinput.py +0 -87
- mixpeek/models/processtextinput.py +0 -82
- mixpeek/models/processvideourlinput.py +0 -87
- mixpeek/models/querysettings.py +0 -56
- mixpeek/models/rerankingoptions.py +0 -47
- mixpeek/models/search_model_searchquery.py +0 -76
- mixpeek/models/searchassetsrequest.py +0 -78
- mixpeek/models/searchrequestfeatures.py +0 -153
- mixpeek/models/sparseembedding.py +0 -21
- mixpeek/models/taxonomycreate.py +0 -20
- mixpeek/models/taxonomyextractionconfig.py +0 -26
- mixpeek/models/taxonomymodel.py +0 -27
- mixpeek/models/taxonomynode.py +0 -101
- mixpeek/models/taxonomynodecreate.py +0 -63
- mixpeek/models/textsettings.py +0 -67
- mixpeek/models/updateassetrequest.py +0 -60
- mixpeek/models/usage.py +0 -18
- mixpeek/models/vectormodel.py +0 -15
- mixpeek/models/videodescribesettings.py +0 -82
- mixpeek/models/videodetectsettings.py +0 -47
- mixpeek/models/videoreadsettings.py +0 -71
- mixpeek/models/videosettings.py +0 -115
- mixpeek/models/videotranscriptionsettings.py +0 -69
- mixpeek-0.20.20.dist-info/RECORD +0 -201
@@ -0,0 +1,214 @@
|
|
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, Mapping, Optional
|
9
|
+
|
10
|
+
|
11
|
+
class OrganizationNotifications(BaseSDK):
|
12
|
+
def send_notification_v1_organizations_notifications_send_post(
|
13
|
+
self,
|
14
|
+
*,
|
15
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
16
|
+
server_url: Optional[str] = None,
|
17
|
+
timeout_ms: Optional[int] = None,
|
18
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
19
|
+
) -> Any:
|
20
|
+
r"""Send Notification
|
21
|
+
|
22
|
+
:param retries: Override the default retry configuration for this method
|
23
|
+
:param server_url: Override the default server URL for this method
|
24
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
25
|
+
:param http_headers: Additional headers to set or replace on requests.
|
26
|
+
"""
|
27
|
+
base_url = None
|
28
|
+
url_variables = None
|
29
|
+
if timeout_ms is None:
|
30
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
31
|
+
|
32
|
+
if server_url is not None:
|
33
|
+
base_url = server_url
|
34
|
+
else:
|
35
|
+
base_url = self._get_url(base_url, url_variables)
|
36
|
+
req = self._build_request(
|
37
|
+
method="POST",
|
38
|
+
path="/v1/organizations/notifications/send",
|
39
|
+
base_url=base_url,
|
40
|
+
url_variables=url_variables,
|
41
|
+
request=None,
|
42
|
+
request_body_required=False,
|
43
|
+
request_has_path_params=False,
|
44
|
+
request_has_query_params=True,
|
45
|
+
user_agent_header="user-agent",
|
46
|
+
accept_header_value="application/json",
|
47
|
+
http_headers=http_headers,
|
48
|
+
security=self.sdk_configuration.security,
|
49
|
+
timeout_ms=timeout_ms,
|
50
|
+
)
|
51
|
+
|
52
|
+
if retries == UNSET:
|
53
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
54
|
+
retries = self.sdk_configuration.retry_config
|
55
|
+
|
56
|
+
retry_config = None
|
57
|
+
if isinstance(retries, utils.RetryConfig):
|
58
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
59
|
+
|
60
|
+
http_res = self.do_request(
|
61
|
+
hook_ctx=HookContext(
|
62
|
+
base_url=base_url or "",
|
63
|
+
operation_id="send_notification_v1_organizations_notifications_send_post",
|
64
|
+
oauth2_scopes=[],
|
65
|
+
security_source=get_security_from_env(
|
66
|
+
self.sdk_configuration.security, models.Security
|
67
|
+
),
|
68
|
+
),
|
69
|
+
request=req,
|
70
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
71
|
+
retry_config=retry_config,
|
72
|
+
)
|
73
|
+
|
74
|
+
response_data: Any = None
|
75
|
+
if utils.match_response(http_res, "200", "application/json"):
|
76
|
+
return utils.unmarshal_json(http_res.text, Any)
|
77
|
+
if utils.match_response(
|
78
|
+
http_res, ["400", "401", "403", "404"], "application/json"
|
79
|
+
):
|
80
|
+
response_data = utils.unmarshal_json(
|
81
|
+
http_res.text, models.ErrorResponseData
|
82
|
+
)
|
83
|
+
raise models.ErrorResponse(data=response_data)
|
84
|
+
if utils.match_response(http_res, "422", "application/json"):
|
85
|
+
response_data = utils.unmarshal_json(
|
86
|
+
http_res.text, models.HTTPValidationErrorData
|
87
|
+
)
|
88
|
+
raise models.HTTPValidationError(data=response_data)
|
89
|
+
if utils.match_response(http_res, "500", "application/json"):
|
90
|
+
response_data = utils.unmarshal_json(
|
91
|
+
http_res.text, models.ErrorResponseData
|
92
|
+
)
|
93
|
+
raise models.ErrorResponse(data=response_data)
|
94
|
+
if utils.match_response(http_res, "4XX", "*"):
|
95
|
+
http_res_text = utils.stream_to_text(http_res)
|
96
|
+
raise models.APIError(
|
97
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
98
|
+
)
|
99
|
+
if utils.match_response(http_res, "5XX", "*"):
|
100
|
+
http_res_text = utils.stream_to_text(http_res)
|
101
|
+
raise models.APIError(
|
102
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
103
|
+
)
|
104
|
+
|
105
|
+
content_type = http_res.headers.get("Content-Type")
|
106
|
+
http_res_text = utils.stream_to_text(http_res)
|
107
|
+
raise models.APIError(
|
108
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
109
|
+
http_res.status_code,
|
110
|
+
http_res_text,
|
111
|
+
http_res,
|
112
|
+
)
|
113
|
+
|
114
|
+
async def send_notification_v1_organizations_notifications_send_post_async(
|
115
|
+
self,
|
116
|
+
*,
|
117
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
118
|
+
server_url: Optional[str] = None,
|
119
|
+
timeout_ms: Optional[int] = None,
|
120
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
121
|
+
) -> Any:
|
122
|
+
r"""Send Notification
|
123
|
+
|
124
|
+
:param retries: Override the default retry configuration for this method
|
125
|
+
:param server_url: Override the default server URL for this method
|
126
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
127
|
+
:param http_headers: Additional headers to set or replace on requests.
|
128
|
+
"""
|
129
|
+
base_url = None
|
130
|
+
url_variables = None
|
131
|
+
if timeout_ms is None:
|
132
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
133
|
+
|
134
|
+
if server_url is not None:
|
135
|
+
base_url = server_url
|
136
|
+
else:
|
137
|
+
base_url = self._get_url(base_url, url_variables)
|
138
|
+
req = self._build_request_async(
|
139
|
+
method="POST",
|
140
|
+
path="/v1/organizations/notifications/send",
|
141
|
+
base_url=base_url,
|
142
|
+
url_variables=url_variables,
|
143
|
+
request=None,
|
144
|
+
request_body_required=False,
|
145
|
+
request_has_path_params=False,
|
146
|
+
request_has_query_params=True,
|
147
|
+
user_agent_header="user-agent",
|
148
|
+
accept_header_value="application/json",
|
149
|
+
http_headers=http_headers,
|
150
|
+
security=self.sdk_configuration.security,
|
151
|
+
timeout_ms=timeout_ms,
|
152
|
+
)
|
153
|
+
|
154
|
+
if retries == UNSET:
|
155
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
156
|
+
retries = self.sdk_configuration.retry_config
|
157
|
+
|
158
|
+
retry_config = None
|
159
|
+
if isinstance(retries, utils.RetryConfig):
|
160
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
161
|
+
|
162
|
+
http_res = await self.do_request_async(
|
163
|
+
hook_ctx=HookContext(
|
164
|
+
base_url=base_url or "",
|
165
|
+
operation_id="send_notification_v1_organizations_notifications_send_post",
|
166
|
+
oauth2_scopes=[],
|
167
|
+
security_source=get_security_from_env(
|
168
|
+
self.sdk_configuration.security, models.Security
|
169
|
+
),
|
170
|
+
),
|
171
|
+
request=req,
|
172
|
+
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
173
|
+
retry_config=retry_config,
|
174
|
+
)
|
175
|
+
|
176
|
+
response_data: Any = None
|
177
|
+
if utils.match_response(http_res, "200", "application/json"):
|
178
|
+
return utils.unmarshal_json(http_res.text, Any)
|
179
|
+
if utils.match_response(
|
180
|
+
http_res, ["400", "401", "403", "404"], "application/json"
|
181
|
+
):
|
182
|
+
response_data = utils.unmarshal_json(
|
183
|
+
http_res.text, models.ErrorResponseData
|
184
|
+
)
|
185
|
+
raise models.ErrorResponse(data=response_data)
|
186
|
+
if utils.match_response(http_res, "422", "application/json"):
|
187
|
+
response_data = utils.unmarshal_json(
|
188
|
+
http_res.text, models.HTTPValidationErrorData
|
189
|
+
)
|
190
|
+
raise models.HTTPValidationError(data=response_data)
|
191
|
+
if utils.match_response(http_res, "500", "application/json"):
|
192
|
+
response_data = utils.unmarshal_json(
|
193
|
+
http_res.text, models.ErrorResponseData
|
194
|
+
)
|
195
|
+
raise models.ErrorResponse(data=response_data)
|
196
|
+
if utils.match_response(http_res, "4XX", "*"):
|
197
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
198
|
+
raise models.APIError(
|
199
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
200
|
+
)
|
201
|
+
if utils.match_response(http_res, "5XX", "*"):
|
202
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
203
|
+
raise models.APIError(
|
204
|
+
"API error occurred", http_res.status_code, http_res_text, http_res
|
205
|
+
)
|
206
|
+
|
207
|
+
content_type = http_res.headers.get("Content-Type")
|
208
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
209
|
+
raise models.APIError(
|
210
|
+
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
211
|
+
http_res.status_code,
|
212
|
+
http_res_text,
|
213
|
+
http_res,
|
214
|
+
)
|
mixpeek/organizations.py
CHANGED
@@ -220,221 +220,12 @@ class Organizations(BaseSDK):
|
|
220
220
|
http_res,
|
221
221
|
)
|
222
222
|
|
223
|
-
def get_usage(
|
224
|
-
self,
|
225
|
-
*,
|
226
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
227
|
-
server_url: Optional[str] = None,
|
228
|
-
timeout_ms: Optional[int] = None,
|
229
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
230
|
-
) -> models.Usage:
|
231
|
-
r"""Get Usage
|
232
|
-
|
233
|
-
**Requirements:**
|
234
|
-
- Required permissions: admin
|
235
|
-
|
236
|
-
:param retries: Override the default retry configuration for this method
|
237
|
-
:param server_url: Override the default server URL for this method
|
238
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
239
|
-
:param http_headers: Additional headers to set or replace on requests.
|
240
|
-
"""
|
241
|
-
base_url = None
|
242
|
-
url_variables = None
|
243
|
-
if timeout_ms is None:
|
244
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
245
|
-
|
246
|
-
if server_url is not None:
|
247
|
-
base_url = server_url
|
248
|
-
else:
|
249
|
-
base_url = self._get_url(base_url, url_variables)
|
250
|
-
req = self._build_request(
|
251
|
-
method="GET",
|
252
|
-
path="/v1/organizations/usage",
|
253
|
-
base_url=base_url,
|
254
|
-
url_variables=url_variables,
|
255
|
-
request=None,
|
256
|
-
request_body_required=False,
|
257
|
-
request_has_path_params=False,
|
258
|
-
request_has_query_params=True,
|
259
|
-
user_agent_header="user-agent",
|
260
|
-
accept_header_value="application/json",
|
261
|
-
http_headers=http_headers,
|
262
|
-
security=self.sdk_configuration.security,
|
263
|
-
timeout_ms=timeout_ms,
|
264
|
-
)
|
265
|
-
|
266
|
-
if retries == UNSET:
|
267
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
268
|
-
retries = self.sdk_configuration.retry_config
|
269
|
-
|
270
|
-
retry_config = None
|
271
|
-
if isinstance(retries, utils.RetryConfig):
|
272
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
273
|
-
|
274
|
-
http_res = self.do_request(
|
275
|
-
hook_ctx=HookContext(
|
276
|
-
base_url=base_url or "",
|
277
|
-
operation_id="get_usage_v1_organizations_usage_get",
|
278
|
-
oauth2_scopes=[],
|
279
|
-
security_source=get_security_from_env(
|
280
|
-
self.sdk_configuration.security, models.Security
|
281
|
-
),
|
282
|
-
),
|
283
|
-
request=req,
|
284
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
285
|
-
retry_config=retry_config,
|
286
|
-
)
|
287
|
-
|
288
|
-
response_data: Any = None
|
289
|
-
if utils.match_response(http_res, "200", "application/json"):
|
290
|
-
return utils.unmarshal_json(http_res.text, models.Usage)
|
291
|
-
if utils.match_response(
|
292
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
293
|
-
):
|
294
|
-
response_data = utils.unmarshal_json(
|
295
|
-
http_res.text, models.ErrorResponseData
|
296
|
-
)
|
297
|
-
raise models.ErrorResponse(data=response_data)
|
298
|
-
if utils.match_response(http_res, "422", "application/json"):
|
299
|
-
response_data = utils.unmarshal_json(
|
300
|
-
http_res.text, models.HTTPValidationErrorData
|
301
|
-
)
|
302
|
-
raise models.HTTPValidationError(data=response_data)
|
303
|
-
if utils.match_response(http_res, "500", "application/json"):
|
304
|
-
response_data = utils.unmarshal_json(
|
305
|
-
http_res.text, models.ErrorResponseData
|
306
|
-
)
|
307
|
-
raise models.ErrorResponse(data=response_data)
|
308
|
-
if utils.match_response(http_res, "4XX", "*"):
|
309
|
-
http_res_text = utils.stream_to_text(http_res)
|
310
|
-
raise models.APIError(
|
311
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
312
|
-
)
|
313
|
-
if utils.match_response(http_res, "5XX", "*"):
|
314
|
-
http_res_text = utils.stream_to_text(http_res)
|
315
|
-
raise models.APIError(
|
316
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
317
|
-
)
|
318
|
-
|
319
|
-
content_type = http_res.headers.get("Content-Type")
|
320
|
-
http_res_text = utils.stream_to_text(http_res)
|
321
|
-
raise models.APIError(
|
322
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
323
|
-
http_res.status_code,
|
324
|
-
http_res_text,
|
325
|
-
http_res,
|
326
|
-
)
|
327
|
-
|
328
|
-
async def get_usage_async(
|
329
|
-
self,
|
330
|
-
*,
|
331
|
-
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
332
|
-
server_url: Optional[str] = None,
|
333
|
-
timeout_ms: Optional[int] = None,
|
334
|
-
http_headers: Optional[Mapping[str, str]] = None,
|
335
|
-
) -> models.Usage:
|
336
|
-
r"""Get Usage
|
337
|
-
|
338
|
-
**Requirements:**
|
339
|
-
- Required permissions: admin
|
340
|
-
|
341
|
-
:param retries: Override the default retry configuration for this method
|
342
|
-
:param server_url: Override the default server URL for this method
|
343
|
-
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
344
|
-
:param http_headers: Additional headers to set or replace on requests.
|
345
|
-
"""
|
346
|
-
base_url = None
|
347
|
-
url_variables = None
|
348
|
-
if timeout_ms is None:
|
349
|
-
timeout_ms = self.sdk_configuration.timeout_ms
|
350
|
-
|
351
|
-
if server_url is not None:
|
352
|
-
base_url = server_url
|
353
|
-
else:
|
354
|
-
base_url = self._get_url(base_url, url_variables)
|
355
|
-
req = self._build_request_async(
|
356
|
-
method="GET",
|
357
|
-
path="/v1/organizations/usage",
|
358
|
-
base_url=base_url,
|
359
|
-
url_variables=url_variables,
|
360
|
-
request=None,
|
361
|
-
request_body_required=False,
|
362
|
-
request_has_path_params=False,
|
363
|
-
request_has_query_params=True,
|
364
|
-
user_agent_header="user-agent",
|
365
|
-
accept_header_value="application/json",
|
366
|
-
http_headers=http_headers,
|
367
|
-
security=self.sdk_configuration.security,
|
368
|
-
timeout_ms=timeout_ms,
|
369
|
-
)
|
370
|
-
|
371
|
-
if retries == UNSET:
|
372
|
-
if self.sdk_configuration.retry_config is not UNSET:
|
373
|
-
retries = self.sdk_configuration.retry_config
|
374
|
-
|
375
|
-
retry_config = None
|
376
|
-
if isinstance(retries, utils.RetryConfig):
|
377
|
-
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
378
|
-
|
379
|
-
http_res = await self.do_request_async(
|
380
|
-
hook_ctx=HookContext(
|
381
|
-
base_url=base_url or "",
|
382
|
-
operation_id="get_usage_v1_organizations_usage_get",
|
383
|
-
oauth2_scopes=[],
|
384
|
-
security_source=get_security_from_env(
|
385
|
-
self.sdk_configuration.security, models.Security
|
386
|
-
),
|
387
|
-
),
|
388
|
-
request=req,
|
389
|
-
error_status_codes=["400", "401", "403", "404", "422", "4XX", "500", "5XX"],
|
390
|
-
retry_config=retry_config,
|
391
|
-
)
|
392
|
-
|
393
|
-
response_data: Any = None
|
394
|
-
if utils.match_response(http_res, "200", "application/json"):
|
395
|
-
return utils.unmarshal_json(http_res.text, models.Usage)
|
396
|
-
if utils.match_response(
|
397
|
-
http_res, ["400", "401", "403", "404"], "application/json"
|
398
|
-
):
|
399
|
-
response_data = utils.unmarshal_json(
|
400
|
-
http_res.text, models.ErrorResponseData
|
401
|
-
)
|
402
|
-
raise models.ErrorResponse(data=response_data)
|
403
|
-
if utils.match_response(http_res, "422", "application/json"):
|
404
|
-
response_data = utils.unmarshal_json(
|
405
|
-
http_res.text, models.HTTPValidationErrorData
|
406
|
-
)
|
407
|
-
raise models.HTTPValidationError(data=response_data)
|
408
|
-
if utils.match_response(http_res, "500", "application/json"):
|
409
|
-
response_data = utils.unmarshal_json(
|
410
|
-
http_res.text, models.ErrorResponseData
|
411
|
-
)
|
412
|
-
raise models.ErrorResponse(data=response_data)
|
413
|
-
if utils.match_response(http_res, "4XX", "*"):
|
414
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
415
|
-
raise models.APIError(
|
416
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
417
|
-
)
|
418
|
-
if utils.match_response(http_res, "5XX", "*"):
|
419
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
420
|
-
raise models.APIError(
|
421
|
-
"API error occurred", http_res.status_code, http_res_text, http_res
|
422
|
-
)
|
423
|
-
|
424
|
-
content_type = http_res.headers.get("Content-Type")
|
425
|
-
http_res_text = await utils.stream_to_text_async(http_res)
|
426
|
-
raise models.APIError(
|
427
|
-
f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
|
428
|
-
http_res.status_code,
|
429
|
-
http_res_text,
|
430
|
-
http_res,
|
431
|
-
)
|
432
|
-
|
433
223
|
def add_user(
|
434
224
|
self,
|
435
225
|
*,
|
436
226
|
email: str,
|
437
227
|
user_id: Optional[str] = None,
|
228
|
+
user_name: Optional[str] = None,
|
438
229
|
api_keys: Optional[
|
439
230
|
Union[List[models.APIKey], List[models.APIKeyTypedDict]]
|
440
231
|
] = None,
|
@@ -454,6 +245,7 @@ class Organizations(BaseSDK):
|
|
454
245
|
|
455
246
|
:param email:
|
456
247
|
:param user_id:
|
248
|
+
:param user_name:
|
457
249
|
:param api_keys:
|
458
250
|
:param metadata:
|
459
251
|
:param created_at:
|
@@ -474,6 +266,7 @@ class Organizations(BaseSDK):
|
|
474
266
|
|
475
267
|
request = models.UserModelInput(
|
476
268
|
user_id=user_id,
|
269
|
+
user_name=user_name,
|
477
270
|
email=email,
|
478
271
|
api_keys=utils.get_pydantic_model(api_keys, Optional[List[models.APIKey]]),
|
479
272
|
metadata=utils.get_pydantic_model(
|
@@ -568,6 +361,7 @@ class Organizations(BaseSDK):
|
|
568
361
|
*,
|
569
362
|
email: str,
|
570
363
|
user_id: Optional[str] = None,
|
364
|
+
user_name: Optional[str] = None,
|
571
365
|
api_keys: Optional[
|
572
366
|
Union[List[models.APIKey], List[models.APIKeyTypedDict]]
|
573
367
|
] = None,
|
@@ -587,6 +381,7 @@ class Organizations(BaseSDK):
|
|
587
381
|
|
588
382
|
:param email:
|
589
383
|
:param user_id:
|
384
|
+
:param user_name:
|
590
385
|
:param api_keys:
|
591
386
|
:param metadata:
|
592
387
|
:param created_at:
|
@@ -607,6 +402,7 @@ class Organizations(BaseSDK):
|
|
607
402
|
|
608
403
|
request = models.UserModelInput(
|
609
404
|
user_id=user_id,
|
405
|
+
user_name=user_name,
|
610
406
|
email=email,
|
611
407
|
api_keys=utils.get_pydantic_model(api_keys, Optional[List[models.APIKey]]),
|
612
408
|
metadata=utils.get_pydantic_model(
|
@@ -3,28 +3,26 @@
|
|
3
3
|
from .basesdk import BaseSDK
|
4
4
|
from mixpeek import models, utils
|
5
5
|
from mixpeek._hooks import HookContext
|
6
|
-
from mixpeek.types import OptionalNullable, UNSET
|
6
|
+
from mixpeek.types import BaseModel, OptionalNullable, UNSET
|
7
7
|
from mixpeek.utils import get_security_from_env
|
8
|
-
from typing import Any, Mapping, Optional
|
8
|
+
from typing import Any, Mapping, Optional, Union, cast
|
9
9
|
|
10
10
|
|
11
|
-
class
|
12
|
-
def
|
11
|
+
class OrganizationsUsage(BaseSDK):
|
12
|
+
def get_usage_v1_organizations_usage_post(
|
13
13
|
self,
|
14
14
|
*,
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
request: Union[
|
16
|
+
models.GetUsageRequestModel, models.GetUsageRequestModelTypedDict
|
17
|
+
] = models.GetUsageRequestModel(),
|
18
18
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
19
19
|
server_url: Optional[str] = None,
|
20
20
|
timeout_ms: Optional[int] = None,
|
21
21
|
http_headers: Optional[Mapping[str, str]] = None,
|
22
|
-
) -> models.
|
23
|
-
r"""
|
22
|
+
) -> models.UsageResponse:
|
23
|
+
r"""Get Usage
|
24
24
|
|
25
|
-
:param
|
26
|
-
:param embedding_model:
|
27
|
-
:param value: The input content to embed. Could be a URL, text content, file path, or base64 encoded string
|
25
|
+
:param request: The request object to send.
|
28
26
|
:param retries: Override the default retry configuration for this method
|
29
27
|
:param server_url: Override the default server URL for this method
|
30
28
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
@@ -40,15 +38,13 @@ class FeatureExtractors(BaseSDK):
|
|
40
38
|
else:
|
41
39
|
base_url = self._get_url(base_url, url_variables)
|
42
40
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
embedding_model=embedding_model,
|
47
|
-
)
|
41
|
+
if not isinstance(request, BaseModel):
|
42
|
+
request = utils.unmarshal(request, models.GetUsageRequestModel)
|
43
|
+
request = cast(models.GetUsageRequestModel, request)
|
48
44
|
|
49
45
|
req = self._build_request(
|
50
46
|
method="POST",
|
51
|
-
path="/v1/
|
47
|
+
path="/v1/organizations/usage",
|
52
48
|
base_url=base_url,
|
53
49
|
url_variables=url_variables,
|
54
50
|
request=request,
|
@@ -60,7 +56,7 @@ class FeatureExtractors(BaseSDK):
|
|
60
56
|
http_headers=http_headers,
|
61
57
|
security=self.sdk_configuration.security,
|
62
58
|
get_serialized_body=lambda: utils.serialize_request_body(
|
63
|
-
request, False,
|
59
|
+
request, False, True, "json", Optional[models.GetUsageRequestModel]
|
64
60
|
),
|
65
61
|
timeout_ms=timeout_ms,
|
66
62
|
)
|
@@ -76,7 +72,7 @@ class FeatureExtractors(BaseSDK):
|
|
76
72
|
http_res = self.do_request(
|
77
73
|
hook_ctx=HookContext(
|
78
74
|
base_url=base_url or "",
|
79
|
-
operation_id="
|
75
|
+
operation_id="get_usage_v1_organizations_usage_post",
|
80
76
|
oauth2_scopes=[],
|
81
77
|
security_source=get_security_from_env(
|
82
78
|
self.sdk_configuration.security, models.Security
|
@@ -89,7 +85,7 @@ class FeatureExtractors(BaseSDK):
|
|
89
85
|
|
90
86
|
response_data: Any = None
|
91
87
|
if utils.match_response(http_res, "200", "application/json"):
|
92
|
-
return utils.unmarshal_json(http_res.text, models.
|
88
|
+
return utils.unmarshal_json(http_res.text, models.UsageResponse)
|
93
89
|
if utils.match_response(
|
94
90
|
http_res, ["400", "401", "403", "404"], "application/json"
|
95
91
|
):
|
@@ -127,22 +123,20 @@ class FeatureExtractors(BaseSDK):
|
|
127
123
|
http_res,
|
128
124
|
)
|
129
125
|
|
130
|
-
async def
|
126
|
+
async def get_usage_v1_organizations_usage_post_async(
|
131
127
|
self,
|
132
128
|
*,
|
133
|
-
|
134
|
-
|
135
|
-
|
129
|
+
request: Union[
|
130
|
+
models.GetUsageRequestModel, models.GetUsageRequestModelTypedDict
|
131
|
+
] = models.GetUsageRequestModel(),
|
136
132
|
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
137
133
|
server_url: Optional[str] = None,
|
138
134
|
timeout_ms: Optional[int] = None,
|
139
135
|
http_headers: Optional[Mapping[str, str]] = None,
|
140
|
-
) -> models.
|
141
|
-
r"""
|
136
|
+
) -> models.UsageResponse:
|
137
|
+
r"""Get Usage
|
142
138
|
|
143
|
-
:param
|
144
|
-
:param embedding_model:
|
145
|
-
:param value: The input content to embed. Could be a URL, text content, file path, or base64 encoded string
|
139
|
+
:param request: The request object to send.
|
146
140
|
:param retries: Override the default retry configuration for this method
|
147
141
|
:param server_url: Override the default server URL for this method
|
148
142
|
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
@@ -158,15 +152,13 @@ class FeatureExtractors(BaseSDK):
|
|
158
152
|
else:
|
159
153
|
base_url = self._get_url(base_url, url_variables)
|
160
154
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
embedding_model=embedding_model,
|
165
|
-
)
|
155
|
+
if not isinstance(request, BaseModel):
|
156
|
+
request = utils.unmarshal(request, models.GetUsageRequestModel)
|
157
|
+
request = cast(models.GetUsageRequestModel, request)
|
166
158
|
|
167
159
|
req = self._build_request_async(
|
168
160
|
method="POST",
|
169
|
-
path="/v1/
|
161
|
+
path="/v1/organizations/usage",
|
170
162
|
base_url=base_url,
|
171
163
|
url_variables=url_variables,
|
172
164
|
request=request,
|
@@ -178,7 +170,7 @@ class FeatureExtractors(BaseSDK):
|
|
178
170
|
http_headers=http_headers,
|
179
171
|
security=self.sdk_configuration.security,
|
180
172
|
get_serialized_body=lambda: utils.serialize_request_body(
|
181
|
-
request, False,
|
173
|
+
request, False, True, "json", Optional[models.GetUsageRequestModel]
|
182
174
|
),
|
183
175
|
timeout_ms=timeout_ms,
|
184
176
|
)
|
@@ -194,7 +186,7 @@ class FeatureExtractors(BaseSDK):
|
|
194
186
|
http_res = await self.do_request_async(
|
195
187
|
hook_ctx=HookContext(
|
196
188
|
base_url=base_url or "",
|
197
|
-
operation_id="
|
189
|
+
operation_id="get_usage_v1_organizations_usage_post",
|
198
190
|
oauth2_scopes=[],
|
199
191
|
security_source=get_security_from_env(
|
200
192
|
self.sdk_configuration.security, models.Security
|
@@ -207,7 +199,7 @@ class FeatureExtractors(BaseSDK):
|
|
207
199
|
|
208
200
|
response_data: Any = None
|
209
201
|
if utils.match_response(http_res, "200", "application/json"):
|
210
|
-
return utils.unmarshal_json(http_res.text, models.
|
202
|
+
return utils.unmarshal_json(http_res.text, models.UsageResponse)
|
211
203
|
if utils.match_response(
|
212
204
|
http_res, ["400", "401", "403", "404"], "application/json"
|
213
205
|
):
|