client: regenerate from hanzo-inc/cloud@5477729ba9 (8.5.723)

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-10-14 08:53:33 +00:00
co-authored by Hanzo Dev
parent 7374804405
commit d8d5c47e17
20 changed files with 326 additions and 1396 deletions
+2 -5
View File
@@ -13,7 +13,6 @@ pkg/hanzoai/cloud/api/authz_api.py
pkg/hanzoai/cloud/api/auto_api.py
pkg/hanzoai/cloud/api/base_api.py
pkg/hanzoai/cloud/api/benchmark_api.py
pkg/hanzoai/cloud/api/beta_api.py
pkg/hanzoai/cloud/api/billing_api.py
pkg/hanzoai/cloud/api/blueprint_api.py
pkg/hanzoai/cloud/api/books_api.py
@@ -393,9 +392,6 @@ pkg/hanzoai/cloud/models/benchmark_put_claims_in.py
pkg/hanzoai/cloud/models/benchmark_put_claims_out.py
pkg/hanzoai/cloud/models/benchmark_run_point.py
pkg/hanzoai/cloud/models/benchmark_suite.py
pkg/hanzoai/cloud/models/beta_beta_application.py
pkg/hanzoai/cloud/models/beta_beta_apply.py
pkg/hanzoai/cloud/models/beta_beta_status.py
pkg/hanzoai/cloud/models/billing_accounts.py
pkg/hanzoai/cloud/models/billing_accounts_total.py
pkg/hanzoai/cloud/models/billing_alert.py
@@ -948,6 +944,7 @@ pkg/hanzoai/cloud/models/flag_defs_out.py
pkg/hanzoai/cloud/models/flag_deleted_out.py
pkg/hanzoai/cloud/models/flag_evaluate_in.py
pkg/hanzoai/cloud/models/flag_health_out.py
pkg/hanzoai/cloud/models/flag_platform_out.py
pkg/hanzoai/cloud/models/flow_flow_create.py
pkg/hanzoai/cloud/models/flow_flow_run.py
pkg/hanzoai/cloud/models/flow_flow_status.py
@@ -2478,7 +2475,6 @@ pkg/hanzoai/cloud/models/pref_prefs_view.py
pkg/hanzoai/cloud/models/pricing_card.py
pkg/hanzoai/cloud/models/pricing_component.py
pkg/hanzoai/cloud/models/pricing_enablement_board.py
pkg/hanzoai/cloud/models/pricing_enablement_opt_ref.py
pkg/hanzoai/cloud/models/pricing_pricing_health.py
pkg/hanzoai/cloud/models/pricing_pricing_model_list.py
pkg/hanzoai/cloud/models/pricing_pricing_plan_list.py
@@ -3082,6 +3078,7 @@ pkg/hanzoai/cloud/models/trust_written.py
pkg/hanzoai/cloud/models/usage_accounts.py
pkg/hanzoai/cloud/models/usage_category_spend.py
pkg/hanzoai/cloud/models/usage_dash_resp.py
pkg/hanzoai/cloud/models/usage_kai.py
pkg/hanzoai/cloud/models/usage_llm.py
pkg/hanzoai/cloud/models/usage_provider_breakdown.py
pkg/hanzoai/cloud/models/usage_provider_row.py
+2 -2
View File
@@ -1,4 +1,4 @@
ref=ce4f33a2bf09d6797013d62de2a354fe96eb2aaf
sha256=95b084f1f51d6b507a4b9e4ab0dbf2c01e3dd43f4e4f9e275d81c449a66132af
ref=5477729ba95b8388c20b0b4f0c0ea8c7e996d5f7
sha256=b397dd720df1abed9e9c3dca72bddbebe1584e21fdbbcb33f8801186d6bc7269
repo=hanzo-inc/cloud
path=openapi.yaml
+4 -10
View File
@@ -31,7 +31,6 @@ __all__ = [
"AutoApi",
"BaseApi",
"BenchmarkApi",
"BetaApi",
"BillingApi",
"BlueprintApi",
"BooksApi",
@@ -415,9 +414,6 @@ __all__ = [
"BenchmarkPutClaimsOut",
"BenchmarkRunPoint",
"BenchmarkSuite",
"BetaBetaApplication",
"BetaBetaApply",
"BetaBetaStatus",
"BillingAccounts",
"BillingAccountsTotal",
"BillingAlert",
@@ -970,6 +966,7 @@ __all__ = [
"FlagDeletedOut",
"FlagEvaluateIn",
"FlagHealthOut",
"FlagPlatformOut",
"FlowFlowCreate",
"FlowFlowRun",
"FlowFlowStatus",
@@ -2500,7 +2497,6 @@ __all__ = [
"PricingCard",
"PricingComponent",
"PricingEnablementBoard",
"PricingEnablementOptRef",
"PricingPricingHealth",
"PricingPricingModelList",
"PricingPricingPlanList",
@@ -3105,6 +3101,7 @@ __all__ = [
"UsageAccounts",
"UsageCategorySpend",
"UsageDashResp",
"UsageKai",
"UsageLLM",
"UsageProviderBreakdown",
"UsageProviderRow",
@@ -3194,7 +3191,6 @@ from hanzoai.cloud.api.authz_api import AuthzApi as AuthzApi
from hanzoai.cloud.api.auto_api import AutoApi as AutoApi
from hanzoai.cloud.api.base_api import BaseApi as BaseApi
from hanzoai.cloud.api.benchmark_api import BenchmarkApi as BenchmarkApi
from hanzoai.cloud.api.beta_api import BetaApi as BetaApi
from hanzoai.cloud.api.billing_api import BillingApi as BillingApi
from hanzoai.cloud.api.blueprint_api import BlueprintApi as BlueprintApi
from hanzoai.cloud.api.books_api import BooksApi as BooksApi
@@ -3582,9 +3578,6 @@ from hanzoai.cloud.models.benchmark_put_claims_in import BenchmarkPutClaimsIn as
from hanzoai.cloud.models.benchmark_put_claims_out import BenchmarkPutClaimsOut as BenchmarkPutClaimsOut
from hanzoai.cloud.models.benchmark_run_point import BenchmarkRunPoint as BenchmarkRunPoint
from hanzoai.cloud.models.benchmark_suite import BenchmarkSuite as BenchmarkSuite
from hanzoai.cloud.models.beta_beta_application import BetaBetaApplication as BetaBetaApplication
from hanzoai.cloud.models.beta_beta_apply import BetaBetaApply as BetaBetaApply
from hanzoai.cloud.models.beta_beta_status import BetaBetaStatus as BetaBetaStatus
from hanzoai.cloud.models.billing_accounts import BillingAccounts as BillingAccounts
from hanzoai.cloud.models.billing_accounts_total import BillingAccountsTotal as BillingAccountsTotal
from hanzoai.cloud.models.billing_alert import BillingAlert as BillingAlert
@@ -4137,6 +4130,7 @@ from hanzoai.cloud.models.flag_defs_out import FlagDefsOut as FlagDefsOut
from hanzoai.cloud.models.flag_deleted_out import FlagDeletedOut as FlagDeletedOut
from hanzoai.cloud.models.flag_evaluate_in import FlagEvaluateIn as FlagEvaluateIn
from hanzoai.cloud.models.flag_health_out import FlagHealthOut as FlagHealthOut
from hanzoai.cloud.models.flag_platform_out import FlagPlatformOut as FlagPlatformOut
from hanzoai.cloud.models.flow_flow_create import FlowFlowCreate as FlowFlowCreate
from hanzoai.cloud.models.flow_flow_run import FlowFlowRun as FlowFlowRun
from hanzoai.cloud.models.flow_flow_status import FlowFlowStatus as FlowFlowStatus
@@ -5667,7 +5661,6 @@ from hanzoai.cloud.models.pref_prefs_view import PrefPrefsView as PrefPrefsView
from hanzoai.cloud.models.pricing_card import PricingCard as PricingCard
from hanzoai.cloud.models.pricing_component import PricingComponent as PricingComponent
from hanzoai.cloud.models.pricing_enablement_board import PricingEnablementBoard as PricingEnablementBoard
from hanzoai.cloud.models.pricing_enablement_opt_ref import PricingEnablementOptRef as PricingEnablementOptRef
from hanzoai.cloud.models.pricing_pricing_health import PricingPricingHealth as PricingPricingHealth
from hanzoai.cloud.models.pricing_pricing_model_list import PricingPricingModelList as PricingPricingModelList
from hanzoai.cloud.models.pricing_pricing_plan_list import PricingPricingPlanList as PricingPricingPlanList
@@ -6272,6 +6265,7 @@ from hanzoai.cloud.models.utm import UTM as UTM
from hanzoai.cloud.models.usage_accounts import UsageAccounts as UsageAccounts
from hanzoai.cloud.models.usage_category_spend import UsageCategorySpend as UsageCategorySpend
from hanzoai.cloud.models.usage_dash_resp import UsageDashResp as UsageDashResp
from hanzoai.cloud.models.usage_kai import UsageKai as UsageKai
from hanzoai.cloud.models.usage_llm import UsageLLM as UsageLLM
from hanzoai.cloud.models.usage_provider_breakdown import UsageProviderBreakdown as UsageProviderBreakdown
from hanzoai.cloud.models.usage_provider_row import UsageProviderRow as UsageProviderRow
-1
View File
@@ -14,7 +14,6 @@ from hanzoai.cloud.api.authz_api import AuthzApi
from hanzoai.cloud.api.auto_api import AutoApi
from hanzoai.cloud.api.base_api import BaseApi
from hanzoai.cloud.api.benchmark_api import BenchmarkApi
from hanzoai.cloud.api.beta_api import BetaApi
from hanzoai.cloud.api.billing_api import BillingApi
from hanzoai.cloud.api.blueprint_api import BlueprintApi
from hanzoai.cloud.api.books_api import BooksApi
+3 -3
View File
@@ -73913,7 +73913,7 @@ class AiApi:
) -> AiDecisionsResponse:
"""Implements POST /v1/decisions (the Decisions API).
Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"boolean\"|\"choice\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai's versioned id kai-<12 hex of the weights' sha256> — priced as kai and sent as asked — or Jev by OpenRouter's vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev's list price. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. A boolean is a yes/no probability, answered {\"type\": \"boolean\", \"probability\": p}. noul is accepted as Jev's spelling of it and answered in Jev's shape, {\"type\": \"noul\", \"noul\": p}; an older Kai adds confidence and answer_confidence to a noul's. A boolean carries no confidence. Jev is asked a boolean as a noul, and its answer comes back as exactly the boolean. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, '.', '_' and '-'. A handle belongs to the org that observed it: no other org's request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request's text counted once, the state once and each question's instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint's reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer's input tokens at the model's price.
Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"boolean\"|\"choice\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai's versioned id kai-<12 hex of the weights' sha256> — priced as kai and sent as asked — or Jev by OpenRouter's vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev's list price, or Zen by zenlm/zen6 and zenlm/zen6-flash, answered by a chat completion under a strict schema and billed its output beside its input. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. A boolean is a yes/no probability, answered {\"type\": \"boolean\", \"probability\": p}. noul is accepted as Jev's spelling of it and answered in Jev's shape, {\"type\": \"noul\", \"noul\": p}; an older Kai adds confidence and answer_confidence to a noul's. A boolean carries no confidence. Jev is asked a boolean as a noul, and its answer comes back as exactly the boolean. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, '.', '_' and '-'. A handle belongs to the org that observed it: no other org's request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request's text counted once, the state once and each question's instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint's reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer's input and output tokens at the model's price.
:param ai_decisions_request: (required)
:type ai_decisions_request: AiDecisionsRequest
@@ -73989,7 +73989,7 @@ class AiApi:
) -> ApiResponse[AiDecisionsResponse]:
"""Implements POST /v1/decisions (the Decisions API).
Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"boolean\"|\"choice\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai's versioned id kai-<12 hex of the weights' sha256> — priced as kai and sent as asked — or Jev by OpenRouter's vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev's list price. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. A boolean is a yes/no probability, answered {\"type\": \"boolean\", \"probability\": p}. noul is accepted as Jev's spelling of it and answered in Jev's shape, {\"type\": \"noul\", \"noul\": p}; an older Kai adds confidence and answer_confidence to a noul's. A boolean carries no confidence. Jev is asked a boolean as a noul, and its answer comes back as exactly the boolean. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, '.', '_' and '-'. A handle belongs to the org that observed it: no other org's request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request's text counted once, the state once and each question's instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint's reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer's input tokens at the model's price.
Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"boolean\"|\"choice\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai's versioned id kai-<12 hex of the weights' sha256> — priced as kai and sent as asked — or Jev by OpenRouter's vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev's list price, or Zen by zenlm/zen6 and zenlm/zen6-flash, answered by a chat completion under a strict schema and billed its output beside its input. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. A boolean is a yes/no probability, answered {\"type\": \"boolean\", \"probability\": p}. noul is accepted as Jev's spelling of it and answered in Jev's shape, {\"type\": \"noul\", \"noul\": p}; an older Kai adds confidence and answer_confidence to a noul's. A boolean carries no confidence. Jev is asked a boolean as a noul, and its answer comes back as exactly the boolean. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, '.', '_' and '-'. A handle belongs to the org that observed it: no other org's request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request's text counted once, the state once and each question's instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint's reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer's input and output tokens at the model's price.
:param ai_decisions_request: (required)
:type ai_decisions_request: AiDecisionsRequest
@@ -74065,7 +74065,7 @@ class AiApi:
) -> RESTResponseType:
"""Implements POST /v1/decisions (the Decisions API).
Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"boolean\"|\"choice\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai's versioned id kai-<12 hex of the weights' sha256> — priced as kai and sent as asked — or Jev by OpenRouter's vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev's list price. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. A boolean is a yes/no probability, answered {\"type\": \"boolean\", \"probability\": p}. noul is accepted as Jev's spelling of it and answered in Jev's shape, {\"type\": \"noul\", \"noul\": p}; an older Kai adds confidence and answer_confidence to a noul's. A boolean carries no confidence. Jev is asked a boolean as a noul, and its answer comes back as exactly the boolean. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, '.', '_' and '-'. A handle belongs to the org that observed it: no other org's request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request's text counted once, the state once and each question's instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint's reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer's input tokens at the model's price.
Implements POST /v1/decisions (the Decisions API). Body: {\"model\": \"kai\", \"state\": \"...\"|{...}|[...], \"questions\": {\"<name>\": {\"type\": \"boolean\"|\"choice\"|\"score\", \"instructions\": ..., \"criteria\": ...}}}. model is kai, Kai's versioned id kai-<12 hex of the weights' sha256> — priced as kai and sent as asked — or Jev by OpenRouter's vendor ids, typesafe/jev-1.13 and ~typesafe/jev-latest, which reach Jev itself and bill at Jev's list price, or Zen by zenlm/zen6 and zenlm/zen6-flash, answered by a chat completion under a strict schema and billed its output beside its input. No Jev id is ever answered by Kai: a bare one, such as jev-latest, is an unknown model. model is required; state and questions are required unless the request names a handle, which carries neither. instructions is optional and any JSON. A choice names at least 2 labels and a score at least 1 level, bounded by the token budget rather than a count; questions holds 1 to 100. A boolean is a yes/no probability, answered {\"type\": \"boolean\", \"probability\": p}. noul is accepted as Jev's spelling of it and answered in Jev's shape, {\"type\": \"noul\", \"noul\": p}; an older Kai adds confidence and answer_confidence to a noul's. A boolean carries no confidence. Jev is asked a boolean as a noul, and its answer comes back as exactly the boolean. observe holds the state under an id, and a later request naming that id as its handle decides over it again. An id is 1 to 128 characters of A-Z, a-z, 0-9, '.', '_' and '-'. A handle belongs to the org that observed it: no other org's request can name it. Response: {\"id\",\"model\",\"provider\",\"answers\":{\"<name>\":{\"type\",...}}, \"usage\":{\"input_tokens\",\"output_tokens\"},\"routing\",\"state_hash\",\"latency_ms\"}. usage.input_tokens is the billed count — the request's text counted once, the state once and each question's instructions and options once; a decision over a handle bills the state once, when it was observed. The body may be sent gzip, deflate, br or zstd encoded; decoded, it is bounded as sent. Refusals are {\"error\":{\"code\",\"message\"}}: 400 malformed JSON or unknown model, 401 no valid credential, 402 insufficient balance, 403 a key kind that may not call this (pk-), 415 any other Content-Encoding, 422 an invalid question or handle id, a state beyond the checkpoint's reach (code state_too_long) or a body past 16 MiB (code request_too_long), 429 rate limited or queue full, 502 the service failed, 503 the model is known and not served, 529 overloaded. 402, 429 and 529 carry Retry-After and Retry-After-Ms, and every answer carries X-Request-Id. Billed on the answer's input and output tokens at the model's price.
:param ai_decisions_request: (required)
:type ai_decisions_request: AiDecisionsRequest
-563
View File
@@ -1,563 +0,0 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Any, Dict, List, Optional, Tuple, Union
from typing_extensions import Annotated
from hanzoai.cloud.models.beta_beta_application import BetaBetaApplication
from hanzoai.cloud.models.beta_beta_apply import BetaBetaApply
from hanzoai.cloud.models.beta_beta_status import BetaBetaStatus
from hanzoai.cloud.api_client import ApiClient, RequestSerialized
from hanzoai.cloud.api_response import ApiResponse
from hanzoai.cloud.rest import RESTResponseType
class BetaApi:
"""NOTE: This class is auto generated by OpenAPI Generator
Ref: https://openapi-generator.tech
Do not edit the class manually.
"""
def __init__(self, api_client=None) -> None:
if api_client is None:
api_client = ApiClient.get_default()
self.api_client = api_client
@validate_call
def get_beta(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> BetaBetaStatus:
"""Answers where the caller stands with the beta program in the org they act in: their own application, if they filed one, and whether they may apply now and why.
Answers where the caller stands with the beta program in the org they act in: their own application, if they filed one, and whether they may apply now and why. Eligibility is judged here from billing, never from anything the caller sends: the org must be on a plan at $100 a month or more (a Max plan, a catalog plan priced there, or enterprise) or hold $100 of paid and granted credit, and the caller must own or administer it. The shared sign-up organization never applies. `granted` says whether the org already holds the program's grant, which is what turns betas on; a declined application may be followed by a new one.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_beta_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "BetaBetaStatus",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def get_beta_with_http_info(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[BetaBetaStatus]:
"""Answers where the caller stands with the beta program in the org they act in: their own application, if they filed one, and whether they may apply now and why.
Answers where the caller stands with the beta program in the org they act in: their own application, if they filed one, and whether they may apply now and why. Eligibility is judged here from billing, never from anything the caller sends: the org must be on a plan at $100 a month or more (a Max plan, a catalog plan priced there, or enterprise) or hold $100 of paid and granted credit, and the caller must own or administer it. The shared sign-up organization never applies. `granted` says whether the org already holds the program's grant, which is what turns betas on; a declined application may be followed by a new one.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_beta_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "BetaBetaStatus",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def get_beta_without_preload_content(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Answers where the caller stands with the beta program in the org they act in: their own application, if they filed one, and whether they may apply now and why.
Answers where the caller stands with the beta program in the org they act in: their own application, if they filed one, and whether they may apply now and why. Eligibility is judged here from billing, never from anything the caller sends: the org must be on a plan at $100 a month or more (a Max plan, a catalog plan priced there, or enterprise) or hold $100 of paid and granted credit, and the caller must own or administer it. The shared sign-up organization never applies. `granted` says whether the org already holds the program's grant, which is what turns betas on; a declined application may be followed by a new one.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_beta_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "BetaBetaStatus",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_beta_serialize(
self,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json',
'application/problem+json'
]
)
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/v1/beta',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def post_beta_apply(
self,
beta_beta_apply: BetaBetaApply,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> BetaBetaApplication:
"""Files the caller's application to the beta program, for the org they act in.
Files the caller's application to the beta program, for the org they act in. The body is the answers alone; the person, their email and the organization come from the validated principal and X-Org-Id. It is refused unless the caller owns or administers that organization and it stands at the floor — a plan at $100 a month or more, or $100 of paid and granted credit — and never in the shared sign-up organization; when billing cannot say, it is 503 and worth retrying. One application at a time per person and organization: a repeat while one is pending, or approved and still granted, answers 200 with it and changes nothing, so a second tab or a retry cannot file twice; after a decline or a revoked grant, a new filing is a new application (201). A body larger than 128 KiB is 413; an unknown field or answer, or an answer that breaks its question's rule, is 400 naming it.
:param beta_beta_apply: (required)
:type beta_beta_apply: BetaBetaApply
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_beta_apply_serialize(
beta_beta_apply=beta_beta_apply,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "BetaBetaApplication",
'201': "BetaBetaApplication",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def post_beta_apply_with_http_info(
self,
beta_beta_apply: BetaBetaApply,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[BetaBetaApplication]:
"""Files the caller's application to the beta program, for the org they act in.
Files the caller's application to the beta program, for the org they act in. The body is the answers alone; the person, their email and the organization come from the validated principal and X-Org-Id. It is refused unless the caller owns or administers that organization and it stands at the floor — a plan at $100 a month or more, or $100 of paid and granted credit — and never in the shared sign-up organization; when billing cannot say, it is 503 and worth retrying. One application at a time per person and organization: a repeat while one is pending, or approved and still granted, answers 200 with it and changes nothing, so a second tab or a retry cannot file twice; after a decline or a revoked grant, a new filing is a new application (201). A body larger than 128 KiB is 413; an unknown field or answer, or an answer that breaks its question's rule, is 400 naming it.
:param beta_beta_apply: (required)
:type beta_beta_apply: BetaBetaApply
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_beta_apply_serialize(
beta_beta_apply=beta_beta_apply,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "BetaBetaApplication",
'201': "BetaBetaApplication",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def post_beta_apply_without_preload_content(
self,
beta_beta_apply: BetaBetaApply,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Files the caller's application to the beta program, for the org they act in.
Files the caller's application to the beta program, for the org they act in. The body is the answers alone; the person, their email and the organization come from the validated principal and X-Org-Id. It is refused unless the caller owns or administers that organization and it stands at the floor — a plan at $100 a month or more, or $100 of paid and granted credit — and never in the shared sign-up organization; when billing cannot say, it is 503 and worth retrying. One application at a time per person and organization: a repeat while one is pending, or approved and still granted, answers 200 with it and changes nothing, so a second tab or a retry cannot file twice; after a decline or a revoked grant, a new filing is a new application (201). A body larger than 128 KiB is 413; an unknown field or answer, or an answer that breaks its question's rule, is 400 naming it.
:param beta_beta_apply: (required)
:type beta_beta_apply: BetaBetaApply
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_beta_apply_serialize(
beta_beta_apply=beta_beta_apply,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "BetaBetaApplication",
'201': "BetaBetaApplication",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _post_beta_apply_serialize(
self,
beta_beta_apply,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if beta_beta_apply is not None:
_body_params = beta_beta_apply
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json',
'application/problem+json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/v1/beta/apply',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
+248
View File
@@ -25,6 +25,7 @@ from hanzoai.cloud.models.flag_defs_out import FlagDefsOut
from hanzoai.cloud.models.flag_deleted_out import FlagDeletedOut
from hanzoai.cloud.models.flag_evaluate_in import FlagEvaluateIn
from hanzoai.cloud.models.flag_health_out import FlagHealthOut
from hanzoai.cloud.models.flag_platform_out import FlagPlatformOut
from hanzoai.cloud.api_client import ApiClient, RequestSerialized
from hanzoai.cloud.api_response import ApiResponse
@@ -1326,6 +1327,253 @@ class FlagApi:
@validate_call
def get_flag_platform(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> FlagPlatformOut:
"""Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states.
Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states. A SuperAdmin targets them from the admin cockpit; nothing here changes them. A request without a signed-in principal is refused, and a switch that cannot be read is 503, which a caller takes as off.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_flag_platform_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "FlagPlatformOut",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def get_flag_platform_with_http_info(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[FlagPlatformOut]:
"""Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states.
Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states. A SuperAdmin targets them from the admin cockpit; nothing here changes them. A request without a signed-in principal is refused, and a switch that cannot be read is 503, which a caller takes as off.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_flag_platform_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "FlagPlatformOut",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def get_flag_platform_without_preload_content(
self,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states.
Answers the platform switches that are decided per caller — `beta`, whether the caller sees what is not yet generally available — as they apply to the signed-in caller: its validated org and user, never anything the request states. A SuperAdmin targets them from the admin cockpit; nothing here changes them. A request without a signed-in principal is refused, and a switch that cannot be read is 503, which a caller takes as off.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._get_flag_platform_serialize(
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "FlagPlatformOut",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _get_flag_platform_serialize(
self,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json',
'application/problem+json'
]
)
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/v1/flag/platform',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def post_flag(
self,
+12 -564
View File
@@ -21,7 +21,6 @@ from typing import Any, Dict
from typing_extensions import Annotated
from hanzoai.cloud.models.pricing_card import PricingCard
from hanzoai.cloud.models.pricing_enablement_board import PricingEnablementBoard
from hanzoai.cloud.models.pricing_enablement_opt_ref import PricingEnablementOptRef
from hanzoai.cloud.models.pricing_pricing_health import PricingPricingHealth
from hanzoai.cloud.models.pricing_pricing_model_list import PricingPricingModelList
from hanzoai.cloud.models.pricing_pricing_plan_list import PricingPricingPlanList
@@ -30,7 +29,6 @@ from hanzoai.cloud.models.pricing_pricing_provider_list import PricingPricingPro
from hanzoai.cloud.models.pricing_pricing_region_list import PricingPricingRegionList
from hanzoai.cloud.models.pricing_pricing_tier_list import PricingPricingTierList
from hanzoai.cloud.models.pricing_pricing_tool_list import PricingPricingToolList
from hanzoai.cloud.models.pricing_user_enablement_item import PricingUserEnablementItem
from hanzoai.cloud.api_client import ApiClient, RequestSerialized
from hanzoai.cloud.api_response import ApiResponse
@@ -2536,9 +2534,9 @@ class PricingApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> PricingEnablementBoard:
"""Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in.
"""Returns what the caller can actually use: every managed item with its global state and whether it is effective for this caller — a beta item is, while the platform's `beta` switch is on for it.
Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in. Read-only and safe for any caller — one without a validated principal simply sees the generally-available items and no opt-in affordance, never another org's state.
Returns what the caller can actually use: every managed item with its global state and whether it is effective for this caller — a beta item is, while the platform's `beta` switch is on for it. Read-only and safe for any caller: one without a validated principal sees the generally-available items, never another org's view.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -2599,9 +2597,9 @@ class PricingApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[PricingEnablementBoard]:
"""Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in.
"""Returns what the caller can actually use: every managed item with its global state and whether it is effective for this caller — a beta item is, while the platform's `beta` switch is on for it.
Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in. Read-only and safe for any caller — one without a validated principal simply sees the generally-available items and no opt-in affordance, never another org's state.
Returns what the caller can actually use: every managed item with its global state and whether it is effective for this caller — a beta item is, while the platform's `beta` switch is on for it. Read-only and safe for any caller: one without a validated principal sees the generally-available items, never another org's view.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -2662,9 +2660,9 @@ class PricingApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in.
"""Returns what the caller can actually use: every managed item with its global state and whether it is effective for this caller — a beta item is, while the platform's `beta` switch is on for it.
Returns what the caller's org can actually use: every managed item with its global state, whether it is effective here, whether this org is already opted into its beta, and whether it may still opt in. Read-only and safe for any caller — one without a validated principal simply sees the generally-available items and no opt-in affordance, never another org's state.
Returns what the caller can actually use: every managed item with its global state and whether it is effective for this caller — a beta item is, while the platform's `beta` switch is on for it. Read-only and safe for any caller: one without a validated principal sees the generally-available items, never another org's view.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -4280,9 +4278,9 @@ class PricingApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> PricingPricingModelList:
"""Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see.
"""Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller may see.
Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see. A model an admin has disabled is absent; one in beta appears only for an org granted it. A SuperAdmin sees every model, each annotated with its enablement state.
Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller may see. A model an admin has disabled is absent; one in beta appears only for a caller the platform's `beta` switch is on for. A SuperAdmin sees every model, each annotated with its enablement state.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -4343,9 +4341,9 @@ class PricingApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[PricingPricingModelList]:
"""Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see.
"""Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller may see.
Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see. A model an admin has disabled is absent; one in beta appears only for an org granted it. A SuperAdmin sees every model, each annotated with its enablement state.
Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller may see. A model an admin has disabled is absent; one in beta appears only for a caller the platform's `beta` switch is on for. A SuperAdmin sees every model, each annotated with its enablement state.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -4406,9 +4404,9 @@ class PricingApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see.
"""Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller may see.
Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller's org may see. A model an admin has disabled is absent; one in beta appears only for an org granted it. A SuperAdmin sees every model, each annotated with its enablement state.
Returns the whole model catalog — every model the gateway serves, Zen and third-party alike — filtered to what the caller may see. A model an admin has disabled is absent; one in beta appears only for a caller the platform's `beta` switch is on for. A SuperAdmin sees every model, each annotated with its enablement state.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
@@ -6485,553 +6483,3 @@ class PricingApi:
)
@validate_call
def post_pricing_enablement_optin(
self,
pricing_enablement_opt_ref: PricingEnablementOptRef,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> PricingUserEnablementItem:
"""Opts the caller's OWN org into a beta item.
Opts the caller's OWN org into a beta item. The org is the caller's validated one, so this can never target another org, and the registry refuses anything not in beta — so it can neither re-open an item an operator turned off nor touch one that is already generally available. The org must be entitled to betas — it holds the beta program's grant, from an approved application or an operator — or the opt-in is 403; when the program cannot be asked it is 503, and worth retrying. Requires a signed-in owner or admin of the org (403 for a member).
:param pricing_enablement_opt_ref: (required)
:type pricing_enablement_opt_ref: PricingEnablementOptRef
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_pricing_enablement_optin_serialize(
pricing_enablement_opt_ref=pricing_enablement_opt_ref,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "PricingUserEnablementItem",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def post_pricing_enablement_optin_with_http_info(
self,
pricing_enablement_opt_ref: PricingEnablementOptRef,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[PricingUserEnablementItem]:
"""Opts the caller's OWN org into a beta item.
Opts the caller's OWN org into a beta item. The org is the caller's validated one, so this can never target another org, and the registry refuses anything not in beta — so it can neither re-open an item an operator turned off nor touch one that is already generally available. The org must be entitled to betas — it holds the beta program's grant, from an approved application or an operator — or the opt-in is 403; when the program cannot be asked it is 503, and worth retrying. Requires a signed-in owner or admin of the org (403 for a member).
:param pricing_enablement_opt_ref: (required)
:type pricing_enablement_opt_ref: PricingEnablementOptRef
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_pricing_enablement_optin_serialize(
pricing_enablement_opt_ref=pricing_enablement_opt_ref,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "PricingUserEnablementItem",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def post_pricing_enablement_optin_without_preload_content(
self,
pricing_enablement_opt_ref: PricingEnablementOptRef,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Opts the caller's OWN org into a beta item.
Opts the caller's OWN org into a beta item. The org is the caller's validated one, so this can never target another org, and the registry refuses anything not in beta — so it can neither re-open an item an operator turned off nor touch one that is already generally available. The org must be entitled to betas — it holds the beta program's grant, from an approved application or an operator — or the opt-in is 403; when the program cannot be asked it is 503, and worth retrying. Requires a signed-in owner or admin of the org (403 for a member).
:param pricing_enablement_opt_ref: (required)
:type pricing_enablement_opt_ref: PricingEnablementOptRef
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_pricing_enablement_optin_serialize(
pricing_enablement_opt_ref=pricing_enablement_opt_ref,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "PricingUserEnablementItem",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _post_pricing_enablement_optin_serialize(
self,
pricing_enablement_opt_ref,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if pricing_enablement_opt_ref is not None:
_body_params = pricing_enablement_opt_ref
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json',
'application/problem+json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/v1/pricing/enablement/optin',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
@validate_call
def post_pricing_enablement_optout(
self,
pricing_enablement_opt_ref: PricingEnablementOptRef,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> PricingUserEnablementItem:
"""Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent.
Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent. The org is the caller's validated one, so this can never revoke another org's grant. Requires a signed-in owner or admin of the org (403 for a member).
:param pricing_enablement_opt_ref: (required)
:type pricing_enablement_opt_ref: PricingEnablementOptRef
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_pricing_enablement_optout_serialize(
pricing_enablement_opt_ref=pricing_enablement_opt_ref,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "PricingUserEnablementItem",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
).data
@validate_call
def post_pricing_enablement_optout_with_http_info(
self,
pricing_enablement_opt_ref: PricingEnablementOptRef,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[PricingUserEnablementItem]:
"""Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent.
Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent. The org is the caller's validated one, so this can never revoke another org's grant. Requires a signed-in owner or admin of the org (403 for a member).
:param pricing_enablement_opt_ref: (required)
:type pricing_enablement_opt_ref: PricingEnablementOptRef
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_pricing_enablement_optout_serialize(
pricing_enablement_opt_ref=pricing_enablement_opt_ref,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "PricingUserEnablementItem",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
response_data.read()
return self.api_client.response_deserialize(
response_data=response_data,
response_types_map=_response_types_map,
)
@validate_call
def post_pricing_enablement_optout_without_preload_content(
self,
pricing_enablement_opt_ref: PricingEnablementOptRef,
_request_timeout: Union[
None,
Annotated[StrictFloat, Field(gt=0)],
Tuple[
Annotated[StrictFloat, Field(gt=0)],
Annotated[StrictFloat, Field(gt=0)]
]
] = None,
_request_auth: Optional[Dict[StrictStr, Any]] = None,
_content_type: Optional[StrictStr] = None,
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent.
Removes the caller's OWN org from a beta item's grant list, the reverse of OptIntoBeta and idempotent. The org is the caller's validated one, so this can never revoke another org's grant. Requires a signed-in owner or admin of the org (403 for a member).
:param pricing_enablement_opt_ref: (required)
:type pricing_enablement_opt_ref: PricingEnablementOptRef
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:type _request_timeout: int, tuple(int, int), optional
:param _request_auth: set to override the auth_settings for an a single
request; this effectively ignores the
authentication in the spec for a single request.
:type _request_auth: dict, optional
:param _content_type: force content-type for the request.
:type _content_type: str, Optional
:param _headers: set to override the headers for a single
request; this effectively ignores the headers
in the spec for a single request.
:type _headers: dict, optional
:param _host_index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = self._post_pricing_enablement_optout_serialize(
pricing_enablement_opt_ref=pricing_enablement_opt_ref,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "PricingUserEnablementItem",
}
response_data = self.api_client.call_api(
*_param,
_request_timeout=_request_timeout
)
return response_data.response
def _post_pricing_enablement_optout_serialize(
self,
pricing_enablement_opt_ref,
_request_auth,
_content_type,
_headers,
_host_index,
) -> RequestSerialized:
_host = None
_collection_formats: Dict[str, str] = {
}
_path_params: Dict[str, str] = {}
_query_params: List[Tuple[str, str]] = []
_header_params: Dict[str, Optional[str]] = _headers or {}
_form_params: List[Tuple[str, str]] = []
_files: Dict[
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# process the query parameters
# process the header parameters
# process the form parameters
# process the body parameter
if pricing_enablement_opt_ref is not None:
_body_params = pricing_enablement_opt_ref
# set the HTTP header `Accept`
if 'Accept' not in _header_params:
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/json',
'application/problem+json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'bearer'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/v1/pricing/enablement/optout',
path_params=_path_params,
query_params=_query_params,
header_params=_header_params,
body=_body_params,
post_params=_form_params,
files=_files,
auth_settings=_auth_settings,
collection_formats=_collection_formats,
_host=_host,
_request_auth=_request_auth
)
+6 -6
View File
@@ -957,9 +957,9 @@ class UsageApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> UsageUsageSummary:
"""Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.
"""Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse (with what the prompt cache served and saved), the org's Kai decisions, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.
Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in `sources` and in its own `available` flag, so a partial deploy reports \"no data\" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse (with what the prompt cache served and saved), the org's Kai decisions, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in `sources` and in its own `available` flag, so a partial deploy reports \"no data\" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
:param range: Range is the window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all, custom. Empty means 24h. A label this surface does not know, or one reaching past the 730-day horizon, is refused rather than silently replaced.
:type range: str
@@ -1032,9 +1032,9 @@ class UsageApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> ApiResponse[UsageUsageSummary]:
"""Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.
"""Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse (with what the prompt cache served and saved), the org's Kai decisions, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.
Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in `sources` and in its own `available` flag, so a partial deploy reports \"no data\" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse (with what the prompt cache served and saved), the org's Kai decisions, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in `sources` and in its own `available` flag, so a partial deploy reports \"no data\" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
:param range: Range is the window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all, custom. Empty means 24h. A label this surface does not know, or one reaching past the 730-day horizon, is refused rather than silently replaced.
:type range: str
@@ -1107,9 +1107,9 @@ class UsageApi:
_headers: Optional[Dict[StrictStr, Any]] = None,
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
) -> RESTResponseType:
"""Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.
"""Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse (with what the prompt cache served and saved), the org's Kai decisions, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage.
Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in `sources` and in its own `available` flag, so a partial deploy reports \"no data\" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
Answers GET /v1/usage/summary: the caller's own usage footprint over one window — the categorized spend roll-up from the commerce ledger, the org's LLM usage totals from the warehouse (with what the prompt cache served and saved), the org's Kai decisions, and the caller's OWN linked provider accounts beside the org's Hanzo-routed usage. Every source degrades INDEPENDENTLY to honest zeros and says so in `sources` and in its own `available` flag, so a partial deploy reports \"no data\" rather than fabricating spend. The account rows and the Hanzo rows are concatenated and never summed: a plan's percent is not money. The response is org-scoped from the validated principal and marked no-store — a signed-out caller is refused.
:param range: Range is the window: a count and a unit — 24h, 7d, 90d, any <N>h or <N>d — or day, week, month, all, custom. Empty means 24h. A label this surface does not know, or one reaching past the 730-day horizon, is refused rather than silently replaced.
:type range: str
+2 -4
View File
@@ -276,9 +276,6 @@ from hanzoai.cloud.models.benchmark_put_claims_in import BenchmarkPutClaimsIn
from hanzoai.cloud.models.benchmark_put_claims_out import BenchmarkPutClaimsOut
from hanzoai.cloud.models.benchmark_run_point import BenchmarkRunPoint
from hanzoai.cloud.models.benchmark_suite import BenchmarkSuite
from hanzoai.cloud.models.beta_beta_application import BetaBetaApplication
from hanzoai.cloud.models.beta_beta_apply import BetaBetaApply
from hanzoai.cloud.models.beta_beta_status import BetaBetaStatus
from hanzoai.cloud.models.billing_accounts import BillingAccounts
from hanzoai.cloud.models.billing_accounts_total import BillingAccountsTotal
from hanzoai.cloud.models.billing_alert import BillingAlert
@@ -831,6 +828,7 @@ from hanzoai.cloud.models.flag_defs_out import FlagDefsOut
from hanzoai.cloud.models.flag_deleted_out import FlagDeletedOut
from hanzoai.cloud.models.flag_evaluate_in import FlagEvaluateIn
from hanzoai.cloud.models.flag_health_out import FlagHealthOut
from hanzoai.cloud.models.flag_platform_out import FlagPlatformOut
from hanzoai.cloud.models.flow_flow_create import FlowFlowCreate
from hanzoai.cloud.models.flow_flow_run import FlowFlowRun
from hanzoai.cloud.models.flow_flow_status import FlowFlowStatus
@@ -2361,7 +2359,6 @@ from hanzoai.cloud.models.pref_prefs_view import PrefPrefsView
from hanzoai.cloud.models.pricing_card import PricingCard
from hanzoai.cloud.models.pricing_component import PricingComponent
from hanzoai.cloud.models.pricing_enablement_board import PricingEnablementBoard
from hanzoai.cloud.models.pricing_enablement_opt_ref import PricingEnablementOptRef
from hanzoai.cloud.models.pricing_pricing_health import PricingPricingHealth
from hanzoai.cloud.models.pricing_pricing_model_list import PricingPricingModelList
from hanzoai.cloud.models.pricing_pricing_plan_list import PricingPricingPlanList
@@ -2966,6 +2963,7 @@ from hanzoai.cloud.models.utm import UTM
from hanzoai.cloud.models.usage_accounts import UsageAccounts
from hanzoai.cloud.models.usage_category_spend import UsageCategorySpend
from hanzoai.cloud.models.usage_dash_resp import UsageDashResp
from hanzoai.cloud.models.usage_kai import UsageKai
from hanzoai.cloud.models.usage_llm import UsageLLM
from hanzoai.cloud.models.usage_provider_breakdown import UsageProviderBreakdown
from hanzoai.cloud.models.usage_provider_row import UsageProviderRow
@@ -1,93 +0,0 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class BetaBetaApplication(BaseModel):
"""
BetaBetaApplication
""" # noqa: E501
created: Optional[StrictStr] = Field(default=None, description="Created is when it was filed, RFC 3339.")
decided: Optional[StrictStr] = Field(default=None, description="Decided is when an operator decided it, RFC 3339; absent while pending.")
id: Optional[StrictStr] = Field(default=None, description="ID names the application.")
status: Optional[StrictStr] = Field(default=None, description="Status is \"pending\" until an operator decides, then \"approved\" or \"declined\".")
__properties: ClassVar[List[str]] = ["created", "decided", "id", "status"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of BetaBetaApplication from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of BetaBetaApplication from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"created": obj.get("created"),
"decided": obj.get("decided"),
"id": obj.get("id"),
"status": obj.get("status")
})
return _obj
@@ -1,103 +0,0 @@
# coding: utf-8
"""
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
The version of the OpenAPI document: v1
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.beta_beta_application import BetaBetaApplication
from typing import Optional, Set
from typing_extensions import Self
class BetaBetaStatus(BaseModel):
"""
BetaBetaStatus
""" # noqa: E501
application: Optional[BetaBetaApplication] = Field(default=None, description="Application is the caller's newest application in this org, whatever its status, or null when they have filed none.")
credit: Optional[StrictInt] = Field(default=None, description="Credit is the org's cash plus granted credit, in cents, never counting the credit line; null when the ledger could not be read.")
eligible: Optional[StrictBool] = Field(default=None, description="Eligible is whether the caller may apply now: true when they own or administer the org and it stands at the floor by plan or by funds, false when it does not, and null when nothing read qualifies and a billing read failed, so the answer is not known yet.")
granted: Optional[StrictBool] = Field(default=None, description="Granted is whether the org holds the beta program's grant now — from an approved application or an operator — which is what lets it turn betas on.")
org: Optional[StrictStr] = Field(default=None, description="Org is the organization judged: the one the caller acts in (X-Org-Id).")
plan: Optional[StrictBool] = Field(default=None, description="Plan is whether the org's plan or an active subscription stands at $100 a month or more; null when billing could not say.")
reason: Optional[StrictStr] = Field(default=None, description="Reason says, in one sentence, why the caller may or may not apply.")
__properties: ClassVar[List[str]] = ["application", "credit", "eligible", "granted", "org", "plan", "reason"]
model_config = ConfigDict(
populate_by_name=True,
validate_assignment=True,
protected_namespaces=(),
)
def to_str(self) -> str:
"""Returns the string representation of the model using alias"""
return pprint.pformat(self.model_dump(by_alias=True))
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of BetaBetaStatus from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
"""Return the dictionary representation of the model using alias.
This has the following differences from calling pydantic's
`self.model_dump(by_alias=True)`:
* `None` is only added to the output dict for nullable fields that
were set at model initialization. Other fields with value `None`
are ignored.
"""
excluded_fields: Set[str] = set([
])
_dict = self.model_dump(
by_alias=True,
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of application
if self.application:
_dict['application'] = self.application.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of BetaBetaStatus from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"application": BetaBetaApplication.from_dict(obj["application"]) if obj.get("application") is not None else None,
"credit": obj.get("credit"),
"eligible": obj.get("eligible"),
"granted": obj.get("granted"),
"org": obj.get("org"),
"plan": obj.get("plan"),
"reason": obj.get("reason")
})
return _obj
@@ -17,17 +17,17 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field
from pydantic import BaseModel, ConfigDict, Field, StrictBool
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class BetaBetaApply(BaseModel):
class FlagPlatformOut(BaseModel):
"""
BetaBetaApply
FlagPlatformOut
""" # noqa: E501
answers: Optional[Dict[str, Any]] = Field(default=None, description="Answers are the form's answers, by question id: text for a question, true or false for an acknowledgement. Every required question is answered and every required acknowledgement is true; a question the form does not ask is refused.")
__properties: ClassVar[List[str]] = ["answers"]
flags: Optional[Dict[str, StrictBool]] = Field(default=None, description="Flags maps each principal switch's key to whether it is on for the caller: `beta` is whether the caller sees products and catalog items that are not yet generally available.")
__properties: ClassVar[List[str]] = ["flags"]
model_config = ConfigDict(
populate_by_name=True,
@@ -47,7 +47,7 @@ class BetaBetaApply(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of BetaBetaApply from a JSON string"""
"""Create an instance of FlagPlatformOut from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@@ -72,7 +72,7 @@ class BetaBetaApply(BaseModel):
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of BetaBetaApply from a dict"""
"""Create an instance of FlagPlatformOut from a dict"""
if obj is None:
return None
@@ -80,7 +80,7 @@ class BetaBetaApply(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"answers": obj.get("answers")
"flags": obj.get("flags")
})
return _obj
@@ -27,10 +27,9 @@ class PricingEnablementBoard(BaseModel):
"""
PricingEnablementBoard
""" # noqa: E501
betas: Optional[List[PricingUserEnablementItem]] = Field(default=None, description="Betas are the subset of Items the caller's org may still opt into.")
items: Optional[List[PricingUserEnablementItem]] = Field(default=None, description="Items is every managed item, each resolved for the caller's org.")
items: Optional[List[PricingUserEnablementItem]] = Field(default=None, description="Items is every managed item, each resolved for the caller.")
org: Optional[StrictStr] = Field(default=None, description="Org is the org this view was resolved for; empty for a caller with no validated principal, who sees only the generally-available items.")
__properties: ClassVar[List[str]] = ["betas", "items", "org"]
__properties: ClassVar[List[str]] = ["items", "org"]
model_config = ConfigDict(
populate_by_name=True,
@@ -71,13 +70,6 @@ class PricingEnablementBoard(BaseModel):
exclude=excluded_fields,
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in betas (list)
_items = []
if self.betas:
for _item_betas in self.betas:
if _item_betas:
_items.append(_item_betas.to_dict())
_dict['betas'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
_items = []
if self.items:
@@ -97,7 +89,6 @@ class PricingEnablementBoard(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"betas": [PricingUserEnablementItem.from_dict(_item) for _item in obj["betas"]] if obj.get("betas") is not None else None,
"items": [PricingUserEnablementItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
"org": obj.get("org")
})
@@ -26,13 +26,11 @@ class PricingUserEnablementItem(BaseModel):
"""
PricingUserEnablementItem
""" # noqa: E501
can_opt_in: Optional[StrictBool] = Field(default=None, description="CanOptIn is whether POST /v1/pricing/enablement/optin would do anything here: the item is in beta, this org is not on its list yet, and the org is entitled to betas (it holds the beta program's grant). False for a caller with no validated org, who has no org to enrol.", alias="canOptIn")
effective: Optional[StrictBool] = Field(default=None, description="Effective is whether the caller's org may use the item right now, which is the field to branch on: true for any ga item, for a beta this org holds, and never for an off one.")
effective: Optional[StrictBool] = Field(default=None, description="Effective is whether the caller may use the item right now, which is the field to branch on: true for any ga item, for a beta item while the platform's `beta` switch is on for the caller, and never for an off one.")
id: Optional[StrictStr] = Field(default=None, description="ID is the item within that namespace — a model id, a provider name, or a feature key.")
kind: Optional[StrictStr] = Field(default=None, description="Kind is the namespace the id lives in: \"model\", \"provider\" or \"feature\".")
opted_in: Optional[StrictBool] = Field(default=None, description="OptedIn is whether the caller's org is on this item's beta grant list. It can be true on an \"off\" item — the list survives the kill switch and is simply ignored while it is thrown — so it does not imply Effective.", alias="optedIn")
state: Optional[StrictStr] = Field(default=None, description="State is the item's GLOBAL availability — \"off\", \"beta\" or \"ga\" — which is the operator's setting and not this caller's answer. Effective is that.")
__properties: ClassVar[List[str]] = ["canOptIn", "effective", "id", "kind", "optedIn", "state"]
__properties: ClassVar[List[str]] = ["effective", "id", "kind", "state"]
model_config = ConfigDict(
populate_by_name=True,
@@ -85,11 +83,9 @@ class PricingUserEnablementItem(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"canOptIn": obj.get("canOptIn"),
"effective": obj.get("effective"),
"id": obj.get("id"),
"kind": obj.get("kind"),
"optedIn": obj.get("optedIn"),
"state": obj.get("state")
})
return _obj
@@ -17,18 +17,20 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self
class PricingEnablementOptRef(BaseModel):
class UsageKai(BaseModel):
"""
PricingEnablementOptRef
UsageKai
""" # noqa: E501
id: Optional[StrictStr] = Field(default=None, description="ID is the item within that namespace.")
kind: Optional[StrictStr] = Field(default=None, description="Kind is the item's namespace: \"model\", \"provider\" or \"feature\".")
__properties: ClassVar[List[str]] = ["id", "kind"]
available: Optional[StrictBool] = Field(default=None, description="Available is false when the warehouse was not connected or a query blipped. The totals below are then honest zeros, NOT measured ones.")
cost_cents: Optional[StrictInt] = Field(default=None, description="CostCents is what they cost the org, in US cents.", alias="costCents")
decisions: Optional[StrictInt] = Field(default=None, description="Decisions is how many decisions Kai answered in the window.")
input_tokens: Optional[StrictInt] = Field(default=None, description="InputTokens is the input tokens those decisions were billed on.", alias="inputTokens")
__properties: ClassVar[List[str]] = ["available", "costCents", "decisions", "inputTokens"]
model_config = ConfigDict(
populate_by_name=True,
@@ -48,7 +50,7 @@ class PricingEnablementOptRef(BaseModel):
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:
"""Create an instance of PricingEnablementOptRef from a JSON string"""
"""Create an instance of UsageKai from a JSON string"""
return cls.from_dict(json.loads(json_str))
def to_dict(self) -> Dict[str, Any]:
@@ -73,7 +75,7 @@ class PricingEnablementOptRef(BaseModel):
@classmethod
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
"""Create an instance of PricingEnablementOptRef from a dict"""
"""Create an instance of UsageKai from a dict"""
if obj is None:
return None
@@ -81,8 +83,10 @@ class PricingEnablementOptRef(BaseModel):
return cls.model_validate(obj)
_obj = cls.model_validate({
"id": obj.get("id"),
"kind": obj.get("kind")
"available": obj.get("available"),
"costCents": obj.get("costCents"),
"decisions": obj.get("decisions"),
"inputTokens": obj.get("inputTokens")
})
return _obj
+11 -3
View File
@@ -17,8 +17,8 @@ import pprint
import re # noqa: F401
import json
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
from typing import Any, ClassVar, Dict, List, Optional, Union
from typing import Optional, Set
from typing_extensions import Self
@@ -27,6 +27,10 @@ class UsageLLM(BaseModel):
UsageLLM
""" # noqa: E501
available: Optional[StrictBool] = Field(default=None, description="Available is false when the warehouse was not connected or a query blipped. The totals below are then honest zeros, NOT measured ones.")
cache_read_tokens: Optional[StrictInt] = Field(default=None, description="CacheReadTokens is how many of the prompt tokens the provider's prompt cache served, at the cache-read price.", alias="cacheReadTokens")
cache_saved_cents: Optional[StrictInt] = Field(default=None, description="CacheSavedCents is what the prompt cache took off the bill, in US cents: each call's cache-read tokens at the model's input price less the same tokens at its cache-read price, from the price that call was billed at. A call recorded before this was measured counts 0, so it is a floor.", alias="cacheSavedCents")
cache_write_tokens: Optional[StrictInt] = Field(default=None, description="CacheWriteTokens is how many prompt tokens were written to the prompt cache.", alias="cacheWriteTokens")
cached_share: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="CachedShare is CacheReadTokens over PromptTokens, 0 to 1 at four decimals; 0 when nothing was prompted.", alias="cachedShare")
completion_tokens: Optional[StrictInt] = Field(default=None, description="CompletionTokens is the output half.", alias="completionTokens")
cost_cents: Optional[StrictInt] = Field(default=None, description="CostCents is what they cost the org, in US cents. This IS a Hanzo charge.", alias="costCents")
models: Optional[StrictInt] = Field(default=None, description="Models is how many distinct models were used.")
@@ -34,7 +38,7 @@ class UsageLLM(BaseModel):
requests: Optional[StrictInt] = Field(default=None, description="Requests is how many completions the org made in the window.")
source: Optional[StrictStr] = Field(default=None, description="Source names the warehouse table the totals came from.")
tokens: Optional[StrictInt] = Field(default=None, description="Tokens is the total tokens those completions consumed.")
__properties: ClassVar[List[str]] = ["available", "completionTokens", "costCents", "models", "promptTokens", "requests", "source", "tokens"]
__properties: ClassVar[List[str]] = ["available", "cacheReadTokens", "cacheSavedCents", "cacheWriteTokens", "cachedShare", "completionTokens", "costCents", "models", "promptTokens", "requests", "source", "tokens"]
model_config = ConfigDict(
populate_by_name=True,
@@ -88,6 +92,10 @@ class UsageLLM(BaseModel):
_obj = cls.model_validate({
"available": obj.get("available"),
"cacheReadTokens": obj.get("cacheReadTokens"),
"cacheSavedCents": obj.get("cacheSavedCents"),
"cacheWriteTokens": obj.get("cacheWriteTokens"),
"cachedShare": obj.get("cachedShare"),
"completionTokens": obj.get("completionTokens"),
"costCents": obj.get("costCents"),
"models": obj.get("models"),
@@ -20,6 +20,7 @@ import json
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from hanzoai.cloud.models.usage_accounts import UsageAccounts
from hanzoai.cloud.models.usage_kai import UsageKai
from hanzoai.cloud.models.usage_llm import UsageLLM
from hanzoai.cloud.models.usage_sources import UsageSources
from hanzoai.cloud.models.usage_spend import UsageSpend
@@ -34,13 +35,14 @@ class UsageUsageSummary(BaseModel):
accounts: Optional[UsageAccounts] = Field(default=None, description="Accounts is the caller's own linked provider accounts beside the org's Hanzo-routed usage, labelled row by row and never summed together.")
end: Optional[StrictStr] = Field(default=None, description="End is the window's exclusive end, RFC3339 UTC.")
interval: Optional[StrictStr] = Field(default=None, description="Interval is the bucket width the spend series is gap-filled at.")
kai: Optional[UsageKai] = Field(default=None, description="Kai is the org's Kai decisions: count, input tokens and cost. Also counted in LLM.")
llm: Optional[UsageLLM] = Field(default=None, description="LLM is the org's Hanzo-routed inference totals from the warehouse.")
range: Optional[StrictStr] = Field(default=None, description="Range is the window label that was served.")
scope: Optional[UsageUsageScope] = Field(default=None, description="Scope is the tenant and subject the roll-up was answered for.")
sources: Optional[UsageSources] = Field(default=None, description="Sources says which upstreams actually answered, so a zero can be read as \"no data yet\" rather than as a measurement.")
spend: Optional[UsageSpend] = Field(default=None, description="Spend is the categorized cost roll-up from the billing ledger.")
start: Optional[StrictStr] = Field(default=None, description="Start is the window's inclusive start, RFC3339 UTC.")
__properties: ClassVar[List[str]] = ["accounts", "end", "interval", "llm", "range", "scope", "sources", "spend", "start"]
__properties: ClassVar[List[str]] = ["accounts", "end", "interval", "kai", "llm", "range", "scope", "sources", "spend", "start"]
model_config = ConfigDict(
populate_by_name=True,
@@ -84,6 +86,9 @@ class UsageUsageSummary(BaseModel):
# override the default output from pydantic by calling `to_dict()` of accounts
if self.accounts:
_dict['accounts'] = self.accounts.to_dict()
# override the default output from pydantic by calling `to_dict()` of kai
if self.kai:
_dict['kai'] = self.kai.to_dict()
# override the default output from pydantic by calling `to_dict()` of llm
if self.llm:
_dict['llm'] = self.llm.to_dict()
@@ -111,6 +116,7 @@ class UsageUsageSummary(BaseModel):
"accounts": UsageAccounts.from_dict(obj["accounts"]) if obj.get("accounts") is not None else None,
"end": obj.get("end"),
"interval": obj.get("interval"),
"kai": UsageKai.from_dict(obj["kai"]) if obj.get("kai") is not None else None,
"llm": UsageLLM.from_dict(obj["llm"]) if obj.get("llm") is not None else None,
"range": obj.get("range"),
"scope": UsageUsageScope.from_dict(obj["scope"]) if obj.get("scope") is not None else None,
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "hanzoai"
version = "8.5.719"
version = "8.5.723"
description = "The official Python library for the Hanzo API"
dynamic = ["readme"]
license = "Apache-2.0"
Generated
+2 -2
View File
@@ -2111,7 +2111,7 @@ requires-dist = [
[[package]]
name = "hanzo-tools-shell"
version = "0.6.5"
version = "0.6.6"
source = { editable = "pkg/hanzo-tools-shell" }
dependencies = [
{ name = "hanzo-async" },
@@ -2252,7 +2252,7 @@ wheels = [
[[package]]
name = "hanzoai"
version = "8.5.718"
version = "8.5.719"
source = { editable = "." }
dependencies = [
{ name = "pydantic" },