mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
client: regenerate from hanzo-inc/cloud@1e6d2a97de (8.5.583)
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -227,6 +227,7 @@ pkg/hanzoai/cloud/models/agent_target_req.py
|
||||
pkg/hanzoai/cloud/models/agent_target_view.py
|
||||
pkg/hanzoai/cloud/models/agent_tree_node.py
|
||||
pkg/hanzoai/cloud/models/agent_update_agent_in.py
|
||||
pkg/hanzoai/cloud/models/ai_action.py
|
||||
pkg/hanzoai/cloud/models/ai_ai_conn_response.py
|
||||
pkg/hanzoai/cloud/models/ai_anthropic_content_block.py
|
||||
pkg/hanzoai/cloud/models/ai_anthropic_message.py
|
||||
@@ -235,6 +236,7 @@ pkg/hanzoai/cloud/models/ai_anthropic_response.py
|
||||
pkg/hanzoai/cloud/models/ai_anthropic_tool.py
|
||||
pkg/hanzoai/cloud/models/ai_anthropic_usage.py
|
||||
pkg/hanzoai/cloud/models/ai_cache_writes.py
|
||||
pkg/hanzoai/cloud/models/ai_class.py
|
||||
pkg/hanzoai/cloud/models/ai_cost_stats.py
|
||||
pkg/hanzoai/cloud/models/ai_decision_sides.py
|
||||
pkg/hanzoai/cloud/models/ai_decision_sides_false.py
|
||||
@@ -258,6 +260,7 @@ pkg/hanzoai/cloud/models/ai_history_totals.py
|
||||
pkg/hanzoai/cloud/models/ai_history_window.py
|
||||
pkg/hanzoai/cloud/models/ai_judge_benchmark.py
|
||||
pkg/hanzoai/cloud/models/ai_judge_panel_state.py
|
||||
pkg/hanzoai/cloud/models/ai_limited.py
|
||||
pkg/hanzoai/cloud/models/ai_limits.py
|
||||
pkg/hanzoai/cloud/models/ai_mcp_app.py
|
||||
pkg/hanzoai/cloud/models/ai_mcp_surface.py
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
ref=aaaccee2e8c60cc177cfc97cfa6fcfde5591afca
|
||||
sha256=a70aa2778e98b5ed9c6923ce8d08ca640c9a4d8f396a9994e0c6529e51b9d75b
|
||||
ref=1e6d2a97dee2274f8d54bb1ae9e81de1d99e69c6
|
||||
sha256=7c5439ced62a04771ba99780dbd249893df8f1e08dd8617fa5670e22227e7804
|
||||
repo=hanzo-inc/cloud
|
||||
path=openapi.yaml
|
||||
|
||||
@@ -249,6 +249,7 @@ __all__ = [
|
||||
"AgentTargetView",
|
||||
"AgentTreeNode",
|
||||
"AgentUpdateAgentIn",
|
||||
"AiAction",
|
||||
"AiAiConnResponse",
|
||||
"AiAnthropicContentBlock",
|
||||
"AiAnthropicMessage",
|
||||
@@ -257,6 +258,7 @@ __all__ = [
|
||||
"AiAnthropicTool",
|
||||
"AiAnthropicUsage",
|
||||
"AiCacheWrites",
|
||||
"AiClass",
|
||||
"AiCostStats",
|
||||
"AiDecisionSides",
|
||||
"AiDecisionSidesFalse",
|
||||
@@ -280,6 +282,7 @@ __all__ = [
|
||||
"AiHistoryWindow",
|
||||
"AiJudgeBenchmark",
|
||||
"AiJudgePanelState",
|
||||
"AiLimited",
|
||||
"AiLimits",
|
||||
"AiMCPApp",
|
||||
"AiMCPSurface",
|
||||
@@ -3310,6 +3313,7 @@ from hanzoai.cloud.models.agent_target_req import AgentTargetReq as AgentTargetR
|
||||
from hanzoai.cloud.models.agent_target_view import AgentTargetView as AgentTargetView
|
||||
from hanzoai.cloud.models.agent_tree_node import AgentTreeNode as AgentTreeNode
|
||||
from hanzoai.cloud.models.agent_update_agent_in import AgentUpdateAgentIn as AgentUpdateAgentIn
|
||||
from hanzoai.cloud.models.ai_action import AiAction as AiAction
|
||||
from hanzoai.cloud.models.ai_ai_conn_response import AiAiConnResponse as AiAiConnResponse
|
||||
from hanzoai.cloud.models.ai_anthropic_content_block import AiAnthropicContentBlock as AiAnthropicContentBlock
|
||||
from hanzoai.cloud.models.ai_anthropic_message import AiAnthropicMessage as AiAnthropicMessage
|
||||
@@ -3318,6 +3322,7 @@ from hanzoai.cloud.models.ai_anthropic_response import AiAnthropicResponse as Ai
|
||||
from hanzoai.cloud.models.ai_anthropic_tool import AiAnthropicTool as AiAnthropicTool
|
||||
from hanzoai.cloud.models.ai_anthropic_usage import AiAnthropicUsage as AiAnthropicUsage
|
||||
from hanzoai.cloud.models.ai_cache_writes import AiCacheWrites as AiCacheWrites
|
||||
from hanzoai.cloud.models.ai_class import AiClass as AiClass
|
||||
from hanzoai.cloud.models.ai_cost_stats import AiCostStats as AiCostStats
|
||||
from hanzoai.cloud.models.ai_decision_sides import AiDecisionSides as AiDecisionSides
|
||||
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse as AiDecisionSidesFalse
|
||||
@@ -3341,6 +3346,7 @@ from hanzoai.cloud.models.ai_history_totals import AiHistoryTotals as AiHistoryT
|
||||
from hanzoai.cloud.models.ai_history_window import AiHistoryWindow as AiHistoryWindow
|
||||
from hanzoai.cloud.models.ai_judge_benchmark import AiJudgeBenchmark as AiJudgeBenchmark
|
||||
from hanzoai.cloud.models.ai_judge_panel_state import AiJudgePanelState as AiJudgePanelState
|
||||
from hanzoai.cloud.models.ai_limited import AiLimited as AiLimited
|
||||
from hanzoai.cloud.models.ai_limits import AiLimits as AiLimits
|
||||
from hanzoai.cloud.models.ai_mcp_app import AiMCPApp as AiMCPApp
|
||||
from hanzoai.cloud.models.ai_mcp_surface import AiMCPSurface as AiMCPSurface
|
||||
|
||||
@@ -149,9 +149,9 @@ class AiApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> AiLimits:
|
||||
"""Reads the caller's plan usage: the share used of the session, the day and the month, and when each starts again.
|
||||
"""Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
||||
|
||||
Reads the caller's plan usage: the share used of the session, the day and the month, and when each starts again. Shares only, never amounts.
|
||||
Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -212,9 +212,9 @@ class AiApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[AiLimits]:
|
||||
"""Reads the caller's plan usage: the share used of the session, the day and the month, and when each starts again.
|
||||
"""Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
||||
|
||||
Reads the caller's plan usage: the share used of the session, the day and the month, and when each starts again. Shares only, never amounts.
|
||||
Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -275,9 +275,9 @@ class AiApi:
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Reads the caller's plan usage: the share used of the session, the day and the month, and when each starts again.
|
||||
"""Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on.
|
||||
|
||||
Reads the caller's plan usage: the share used of the session, the day and the month, and when each starts again. Shares only, never amounts.
|
||||
Reads the caller's plan usage: for each class of model the plan includes, the share used of the billing period and of its short window, who pays for the next request, and whether the caller is in limited mode and why; the share used of the session and the day; and the ways on. Shares only, never amounts.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
|
||||
@@ -112,6 +112,7 @@ from hanzoai.cloud.models.agent_target_req import AgentTargetReq
|
||||
from hanzoai.cloud.models.agent_target_view import AgentTargetView
|
||||
from hanzoai.cloud.models.agent_tree_node import AgentTreeNode
|
||||
from hanzoai.cloud.models.agent_update_agent_in import AgentUpdateAgentIn
|
||||
from hanzoai.cloud.models.ai_action import AiAction
|
||||
from hanzoai.cloud.models.ai_ai_conn_response import AiAiConnResponse
|
||||
from hanzoai.cloud.models.ai_anthropic_content_block import AiAnthropicContentBlock
|
||||
from hanzoai.cloud.models.ai_anthropic_message import AiAnthropicMessage
|
||||
@@ -120,6 +121,7 @@ from hanzoai.cloud.models.ai_anthropic_response import AiAnthropicResponse
|
||||
from hanzoai.cloud.models.ai_anthropic_tool import AiAnthropicTool
|
||||
from hanzoai.cloud.models.ai_anthropic_usage import AiAnthropicUsage
|
||||
from hanzoai.cloud.models.ai_cache_writes import AiCacheWrites
|
||||
from hanzoai.cloud.models.ai_class import AiClass
|
||||
from hanzoai.cloud.models.ai_cost_stats import AiCostStats
|
||||
from hanzoai.cloud.models.ai_decision_sides import AiDecisionSides
|
||||
from hanzoai.cloud.models.ai_decision_sides_false import AiDecisionSidesFalse
|
||||
@@ -143,6 +145,7 @@ from hanzoai.cloud.models.ai_history_totals import AiHistoryTotals
|
||||
from hanzoai.cloud.models.ai_history_window import AiHistoryWindow
|
||||
from hanzoai.cloud.models.ai_judge_benchmark import AiJudgeBenchmark
|
||||
from hanzoai.cloud.models.ai_judge_panel_state import AiJudgePanelState
|
||||
from hanzoai.cloud.models.ai_limited import AiLimited
|
||||
from hanzoai.cloud.models.ai_limits import AiLimits
|
||||
from hanzoai.cloud.models.ai_mcp_app import AiMCPApp
|
||||
from hanzoai.cloud.models.ai_mcp_surface import AiMCPSurface
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
# 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, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class AiAction(BaseModel):
|
||||
"""
|
||||
AiAction
|
||||
""" # noqa: E501
|
||||
kind: Optional[StrictStr] = None
|
||||
label: Optional[StrictStr] = None
|
||||
plan: Optional[StrictStr] = None
|
||||
url: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["kind", "label", "plan", "url"]
|
||||
|
||||
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 AiAction 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 AiAction from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"kind": obj.get("kind"),
|
||||
"label": obj.get("label"),
|
||||
"plan": obj.get("plan"),
|
||||
"url": obj.get("url")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
# 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, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.ai_window import AiWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class AiClass(BaseModel):
|
||||
"""
|
||||
AiClass
|
||||
""" # noqa: E501
|
||||
paying: Optional[StrictStr] = Field(default=None, description="Paying is plan, prepaid, credits, or none.")
|
||||
percent: Optional[StrictInt] = None
|
||||
resets_at: Optional[StrictStr] = None
|
||||
state: Optional[StrictStr] = Field(default=None, description="State is ok, near, or limited when the class is used up and nothing else pays.")
|
||||
window: Optional[AiWindow] = None
|
||||
__properties: ClassVar[List[str]] = ["paying", "percent", "resets_at", "state", "window"]
|
||||
|
||||
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 AiClass 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 window
|
||||
if self.window:
|
||||
_dict['window'] = self.window.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of AiClass from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"paying": obj.get("paying"),
|
||||
"percent": obj.get("percent"),
|
||||
"resets_at": obj.get("resets_at"),
|
||||
"state": obj.get("state"),
|
||||
"window": AiWindow.from_dict(obj["window"]) if obj.get("window") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
# 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 AiLimited(BaseModel):
|
||||
"""
|
||||
AiLimited
|
||||
""" # noqa: E501
|
||||
classes: Optional[List[StrictStr]] = None
|
||||
message: Optional[StrictStr] = None
|
||||
reason: Optional[StrictStr] = Field(default=None, description="Reason is plan_allowance_used.")
|
||||
__properties: ClassVar[List[str]] = ["classes", "message", "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 AiLimited 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 AiLimited from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"classes": obj.get("classes"),
|
||||
"message": obj.get("message"),
|
||||
"reason": obj.get("reason")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@ import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.ai_action import AiAction
|
||||
from hanzoai.cloud.models.ai_class import AiClass
|
||||
from hanzoai.cloud.models.ai_limited import AiLimited
|
||||
from hanzoai.cloud.models.ai_window import AiWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
@@ -27,14 +30,17 @@ class AiLimits(BaseModel):
|
||||
"""
|
||||
AiLimits
|
||||
""" # noqa: E501
|
||||
actions: Optional[List[AiAction]] = Field(default=None, description="Actions are the ways on: upgrade, add prepaid credit.")
|
||||
classes: Optional[Dict[str, AiClass]] = Field(default=None, description="Classes are premium (third-party frontier models) and ours (Hanzo's), each present when the plan includes it.")
|
||||
day: Optional[AiWindow] = None
|
||||
month: Optional[AiWindow] = None
|
||||
limited: Optional[AiLimited] = Field(default=None, description="Limited is present in limited mode.")
|
||||
period_end: Optional[StrictStr] = None
|
||||
period_start: Optional[StrictStr] = Field(default=None, description="PeriodStart and PeriodEnd bound the billing period (RFC3339).")
|
||||
plan: Optional[StrictStr] = Field(default=None, description="Plan is the plan that covers Enso and Zen in the consumer apps (\"dev\", \"max-5x\", \"max-20x\", \"team\", \"team-annual\", \"agency\", \"advisory\", \"dedicated\"), empty when none does: the caller is on the free allowance.")
|
||||
session: Optional[AiWindow] = Field(default=None, description="Session is the request window that starts at the first request after the last one ended; Day turns at midnight UTC; Month is the plan's included usage for the billing period. When Month is used up, Enso and Zen keep answering from free models.")
|
||||
upgrade: Optional[StrictStr] = Field(default=None, description="Upgrade is the plan that raises these limits, absent when none does.")
|
||||
__properties: ClassVar[List[str]] = ["day", "month", "period_end", "period_start", "plan", "session", "upgrade"]
|
||||
plan: Optional[StrictStr] = Field(default=None, description="Plan is the plan the caller is served as (\"dev\", \"max-5x\", \"max-20x\", \"team\", \"team-annual\", \"agency\", \"advisory\", \"dedicated\", ...), \"free\" when none counts.")
|
||||
session: Optional[AiWindow] = Field(default=None, description="Session and Day are the request windows over every request the plan covers.")
|
||||
state: Optional[StrictStr] = Field(default=None, description="State is the worst class's: ok, near or limited.")
|
||||
upgrade: Optional[StrictStr] = Field(default=None, description="Upgrade is the plan that raises these limits, absent at the top.")
|
||||
__properties: ClassVar[List[str]] = ["actions", "classes", "day", "limited", "period_end", "period_start", "plan", "session", "state", "upgrade"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -75,12 +81,26 @@ class AiLimits(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in actions (list)
|
||||
_items = []
|
||||
if self.actions:
|
||||
for _item_actions in self.actions:
|
||||
if _item_actions:
|
||||
_items.append(_item_actions.to_dict())
|
||||
_dict['actions'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each value in classes (dict)
|
||||
_field_dict = {}
|
||||
if self.classes:
|
||||
for _key_classes in self.classes:
|
||||
if self.classes[_key_classes]:
|
||||
_field_dict[_key_classes] = self.classes[_key_classes].to_dict()
|
||||
_dict['classes'] = _field_dict
|
||||
# override the default output from pydantic by calling `to_dict()` of day
|
||||
if self.day:
|
||||
_dict['day'] = self.day.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of month
|
||||
if self.month:
|
||||
_dict['month'] = self.month.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of limited
|
||||
if self.limited:
|
||||
_dict['limited'] = self.limited.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of session
|
||||
if self.session:
|
||||
_dict['session'] = self.session.to_dict()
|
||||
@@ -96,12 +116,20 @@ class AiLimits(BaseModel):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"actions": [AiAction.from_dict(_item) for _item in obj["actions"]] if obj.get("actions") is not None else None,
|
||||
"classes": dict(
|
||||
(_k, AiClass.from_dict(_v))
|
||||
for _k, _v in obj["classes"].items()
|
||||
)
|
||||
if obj.get("classes") is not None
|
||||
else None,
|
||||
"day": AiWindow.from_dict(obj["day"]) if obj.get("day") is not None else None,
|
||||
"month": AiWindow.from_dict(obj["month"]) if obj.get("month") is not None else None,
|
||||
"limited": AiLimited.from_dict(obj["limited"]) if obj.get("limited") is not None else None,
|
||||
"period_end": obj.get("period_end"),
|
||||
"period_start": obj.get("period_start"),
|
||||
"plan": obj.get("plan"),
|
||||
"session": AiWindow.from_dict(obj["session"]) if obj.get("session") is not None else None,
|
||||
"state": obj.get("state"),
|
||||
"upgrade": obj.get("upgrade")
|
||||
})
|
||||
return _obj
|
||||
|
||||
@@ -26,9 +26,10 @@ class AiWindow(BaseModel):
|
||||
"""
|
||||
AiWindow
|
||||
""" # noqa: E501
|
||||
percent: Optional[StrictInt] = Field(default=None, description="Percent is the share of the window used, 0 to 100, rounded up so any use shows.")
|
||||
percent: Optional[StrictInt] = Field(default=None, description="Percent is the share used, 0 to 100, rounded up to the next five so any use shows.")
|
||||
resets_at: Optional[StrictStr] = Field(default=None, description="ResetsAt is when the window starts again (RFC3339), null for a session that is not running: it starts at the next request.")
|
||||
__properties: ClassVar[List[str]] = ["percent", "resets_at"]
|
||||
state: Optional[StrictStr] = Field(default=None, description="State is ok, near (four fifths used) or limited (used up).")
|
||||
__properties: ClassVar[List[str]] = ["percent", "resets_at", "state"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -82,7 +83,8 @@ class AiWindow(BaseModel):
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"percent": obj.get("percent"),
|
||||
"resets_at": obj.get("resets_at")
|
||||
"resets_at": obj.get("resets_at"),
|
||||
"state": obj.get("state")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "hanzoai"
|
||||
version = "8.5.585"
|
||||
version = "8.5.583"
|
||||
description = "The official Python library for the Hanzo API"
|
||||
dynamic = ["readme"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
Reference in New Issue
Block a user