blaxel 0.64.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- blaxel/__init__.py +8 -0
- blaxel/agents/__init__.py +5 -0
- blaxel/agents/chain.py +153 -0
- blaxel/agents/chat.py +286 -0
- blaxel/agents/decorator.py +208 -0
- blaxel/agents/thread.py +24 -0
- blaxel/agents/voice/openai.py +255 -0
- blaxel/agents/voice/utils.py +25 -0
- blaxel/api/__init__.py +1 -0
- blaxel/api/agents/__init__.py +0 -0
- blaxel/api/agents/create_agent.py +155 -0
- blaxel/api/agents/delete_agent.py +146 -0
- blaxel/api/agents/get_agent.py +146 -0
- blaxel/api/agents/get_agent_logs.py +151 -0
- blaxel/api/agents/get_agent_metrics.py +150 -0
- blaxel/api/agents/get_agent_trace_ids.py +201 -0
- blaxel/api/agents/list_agent_revisions.py +155 -0
- blaxel/api/agents/list_agents.py +127 -0
- blaxel/api/agents/update_agent.py +168 -0
- blaxel/api/configurations/__init__.py +0 -0
- blaxel/api/configurations/get_configuration.py +122 -0
- blaxel/api/default/__init__.py +0 -0
- blaxel/api/default/get_trace.py +150 -0
- blaxel/api/default/get_trace_ids.py +218 -0
- blaxel/api/default/get_trace_logs.py +186 -0
- blaxel/api/default/list_mcp_hub_definitions.py +127 -0
- blaxel/api/functions/__init__.py +0 -0
- blaxel/api/functions/create_function.py +155 -0
- blaxel/api/functions/delete_function.py +146 -0
- blaxel/api/functions/get_function.py +146 -0
- blaxel/api/functions/get_function_logs.py +151 -0
- blaxel/api/functions/get_function_metrics.py +150 -0
- blaxel/api/functions/get_function_trace_ids.py +201 -0
- blaxel/api/functions/list_function_revisions.py +158 -0
- blaxel/api/functions/list_functions.py +131 -0
- blaxel/api/functions/update_function.py +168 -0
- blaxel/api/integrations/__init__.py +0 -0
- blaxel/api/integrations/create_integration_connection.py +167 -0
- blaxel/api/integrations/delete_integration_connection.py +158 -0
- blaxel/api/integrations/get_integration.py +97 -0
- blaxel/api/integrations/get_integration_connection.py +158 -0
- blaxel/api/integrations/get_integration_connection_model.py +104 -0
- blaxel/api/integrations/get_integration_connection_model_endpoint_configurations.py +97 -0
- blaxel/api/integrations/list_integration_connection_models.py +97 -0
- blaxel/api/integrations/list_integration_connections.py +139 -0
- blaxel/api/integrations/update_integration_connection.py +180 -0
- blaxel/api/invitations/__init__.py +0 -0
- blaxel/api/invitations/list_all_pending_invitations.py +142 -0
- blaxel/api/knowledgebases/__init__.py +0 -0
- blaxel/api/knowledgebases/create_knowledgebase.py +163 -0
- blaxel/api/knowledgebases/delete_knowledgebase.py +154 -0
- blaxel/api/knowledgebases/get_knowledgebase.py +154 -0
- blaxel/api/knowledgebases/list_knowledgebase_revisions.py +158 -0
- blaxel/api/knowledgebases/list_knowledgebases.py +139 -0
- blaxel/api/knowledgebases/update_knowledgebase.py +176 -0
- blaxel/api/locations/__init__.py +0 -0
- blaxel/api/locations/list_locations.py +139 -0
- blaxel/api/metrics/__init__.py +0 -0
- blaxel/api/metrics/get_metrics.py +130 -0
- blaxel/api/models/__init__.py +0 -0
- blaxel/api/models/create_model.py +163 -0
- blaxel/api/models/delete_model.py +154 -0
- blaxel/api/models/get_model.py +154 -0
- blaxel/api/models/get_model_logs.py +155 -0
- blaxel/api/models/get_model_metrics.py +158 -0
- blaxel/api/models/get_model_trace_ids.py +201 -0
- blaxel/api/models/list_model_revisions.py +158 -0
- blaxel/api/models/list_models.py +135 -0
- blaxel/api/models/update_model.py +176 -0
- blaxel/api/policies/__init__.py +0 -0
- blaxel/api/policies/create_policy.py +167 -0
- blaxel/api/policies/delete_policy.py +154 -0
- blaxel/api/policies/get_policy.py +154 -0
- blaxel/api/policies/list_policies.py +139 -0
- blaxel/api/policies/update_policy.py +180 -0
- blaxel/api/privateclusters/__init__.py +0 -0
- blaxel/api/privateclusters/create_private_cluster.py +132 -0
- blaxel/api/privateclusters/delete_private_cluster.py +156 -0
- blaxel/api/privateclusters/get_private_cluster.py +159 -0
- blaxel/api/privateclusters/get_private_cluster_health.py +97 -0
- blaxel/api/privateclusters/list_private_clusters.py +140 -0
- blaxel/api/privateclusters/update_private_cluster.py +156 -0
- blaxel/api/privateclusters/update_private_cluster_health.py +97 -0
- blaxel/api/service_accounts/__init__.py +0 -0
- blaxel/api/service_accounts/create_api_key_for_service_account.py +177 -0
- blaxel/api/service_accounts/create_workspace_service_account.py +170 -0
- blaxel/api/service_accounts/delete_api_key_for_service_account.py +104 -0
- blaxel/api/service_accounts/delete_workspace_service_account.py +160 -0
- blaxel/api/service_accounts/get_workspace_service_accounts.py +141 -0
- blaxel/api/service_accounts/list_api_keys_for_service_account.py +163 -0
- blaxel/api/service_accounts/update_workspace_service_account.py +183 -0
- blaxel/api/store/__init__.py +0 -0
- blaxel/api/store/get_store_agent.py +146 -0
- blaxel/api/store/get_store_function.py +146 -0
- blaxel/api/store/list_store_agents.py +131 -0
- blaxel/api/store/list_store_functions.py +131 -0
- blaxel/api/workspaces/__init__.py +0 -0
- blaxel/api/workspaces/accept_workspace_invitation.py +161 -0
- blaxel/api/workspaces/create_worspace.py +163 -0
- blaxel/api/workspaces/decline_workspace_invitation.py +158 -0
- blaxel/api/workspaces/delete_workspace.py +154 -0
- blaxel/api/workspaces/get_workspace.py +154 -0
- blaxel/api/workspaces/invite_workspace_user.py +174 -0
- blaxel/api/workspaces/leave_workspace.py +161 -0
- blaxel/api/workspaces/list_workspace_users.py +139 -0
- blaxel/api/workspaces/list_workspaces.py +139 -0
- blaxel/api/workspaces/remove_workspace_user.py +101 -0
- blaxel/api/workspaces/update_workspace.py +176 -0
- blaxel/api/workspaces/update_workspace_user_role.py +187 -0
- blaxel/authentication/__init__.py +45 -0
- blaxel/authentication/apikey.py +50 -0
- blaxel/authentication/authentication.py +176 -0
- blaxel/authentication/clientcredentials.py +103 -0
- blaxel/authentication/credentials.py +295 -0
- blaxel/authentication/device_mode.py +197 -0
- blaxel/client.py +281 -0
- blaxel/common/__init__.py +17 -0
- blaxel/common/error.py +27 -0
- blaxel/common/instrumentation.py +317 -0
- blaxel/common/logger.py +60 -0
- blaxel/common/secrets.py +39 -0
- blaxel/common/settings.py +150 -0
- blaxel/common/slugify.py +18 -0
- blaxel/common/utils.py +34 -0
- blaxel/deploy/__init__.py +8 -0
- blaxel/deploy/deploy.py +316 -0
- blaxel/deploy/format.py +46 -0
- blaxel/deploy/parser.py +192 -0
- blaxel/errors.py +16 -0
- blaxel/functions/__init__.py +7 -0
- blaxel/functions/common.py +228 -0
- blaxel/functions/decorator.py +64 -0
- blaxel/functions/local/local.py +48 -0
- blaxel/functions/mcp/client.py +96 -0
- blaxel/functions/mcp/mcp.py +168 -0
- blaxel/functions/mcp/utils.py +56 -0
- blaxel/functions/remote/remote.py +183 -0
- blaxel/models/__init__.py +233 -0
- blaxel/models/acl.py +133 -0
- blaxel/models/agent.py +126 -0
- blaxel/models/agent_chain.py +88 -0
- blaxel/models/agent_spec.py +346 -0
- blaxel/models/api_key.py +142 -0
- blaxel/models/configuration.py +85 -0
- blaxel/models/continent.py +70 -0
- blaxel/models/core_event.py +97 -0
- blaxel/models/core_spec.py +249 -0
- blaxel/models/core_spec_configurations.py +77 -0
- blaxel/models/country.py +70 -0
- blaxel/models/create_api_key_for_service_account_body.py +69 -0
- blaxel/models/create_workspace_service_account_body.py +71 -0
- blaxel/models/create_workspace_service_account_response_200.py +105 -0
- blaxel/models/delete_workspace_service_account_response_200.py +96 -0
- blaxel/models/entrypoint.py +96 -0
- blaxel/models/entrypoint_env.py +45 -0
- blaxel/models/flavor.py +70 -0
- blaxel/models/form.py +120 -0
- blaxel/models/form_config.py +45 -0
- blaxel/models/form_oauthomitempty.py +45 -0
- blaxel/models/form_secrets.py +45 -0
- blaxel/models/function.py +126 -0
- blaxel/models/function_kit.py +97 -0
- blaxel/models/function_spec.py +310 -0
- blaxel/models/get_trace_ids_response_200.py +45 -0
- blaxel/models/get_trace_logs_response_200.py +45 -0
- blaxel/models/get_trace_response_200.py +45 -0
- blaxel/models/get_workspace_service_accounts_response_200_item.py +96 -0
- blaxel/models/histogram_bucket.py +79 -0
- blaxel/models/histogram_stats.py +88 -0
- blaxel/models/integration_connection.py +96 -0
- blaxel/models/integration_connection_spec.py +114 -0
- blaxel/models/integration_connection_spec_config.py +45 -0
- blaxel/models/integration_connection_spec_secret.py +45 -0
- blaxel/models/integration_model.py +162 -0
- blaxel/models/integration_repository.py +88 -0
- blaxel/models/invite_workspace_user_body.py +60 -0
- blaxel/models/knowledgebase.py +126 -0
- blaxel/models/knowledgebase_spec.py +163 -0
- blaxel/models/knowledgebase_spec_options.py +45 -0
- blaxel/models/last_n_requests_metric.py +79 -0
- blaxel/models/latency_metric.py +144 -0
- blaxel/models/location_response.py +113 -0
- blaxel/models/mcp_definition.py +188 -0
- blaxel/models/mcp_definition_entrypoint.py +45 -0
- blaxel/models/mcp_definition_form.py +45 -0
- blaxel/models/metadata.py +139 -0
- blaxel/models/metadata_labels.py +45 -0
- blaxel/models/metric.py +79 -0
- blaxel/models/metrics.py +169 -0
- blaxel/models/metrics_models.py +45 -0
- blaxel/models/metrics_request_total_per_code.py +45 -0
- blaxel/models/metrics_rps_per_code.py +45 -0
- blaxel/models/model.py +126 -0
- blaxel/models/model_private_cluster.py +79 -0
- blaxel/models/model_spec.py +249 -0
- blaxel/models/o_auth.py +72 -0
- blaxel/models/owner_fields.py +70 -0
- blaxel/models/pending_invitation.py +124 -0
- blaxel/models/pending_invitation_accept.py +85 -0
- blaxel/models/pending_invitation_render.py +147 -0
- blaxel/models/pending_invitation_render_invited_by.py +88 -0
- blaxel/models/pending_invitation_render_workspace.py +70 -0
- blaxel/models/pending_invitation_workspace_details.py +72 -0
- blaxel/models/pod_template_spec.py +45 -0
- blaxel/models/policy.py +96 -0
- blaxel/models/policy_location.py +70 -0
- blaxel/models/policy_max_tokens.py +106 -0
- blaxel/models/policy_spec.py +151 -0
- blaxel/models/private_cluster.py +183 -0
- blaxel/models/private_location.py +61 -0
- blaxel/models/repository.py +70 -0
- blaxel/models/request_duration_over_time_metric.py +97 -0
- blaxel/models/request_duration_over_time_metrics.py +80 -0
- blaxel/models/request_total_by_origin_metric.py +115 -0
- blaxel/models/request_total_by_origin_metric_request_total_by_origin.py +45 -0
- blaxel/models/request_total_by_origin_metric_request_total_by_origin_and_code.py +45 -0
- blaxel/models/request_total_metric.py +123 -0
- blaxel/models/request_total_metric_request_total_per_code.py +45 -0
- blaxel/models/request_total_metric_rps_per_code.py +45 -0
- blaxel/models/resource_log.py +79 -0
- blaxel/models/resource_metrics.py +270 -0
- blaxel/models/resource_metrics_request_total_per_code.py +45 -0
- blaxel/models/resource_metrics_rps_per_code.py +45 -0
- blaxel/models/revision_configuration.py +97 -0
- blaxel/models/revision_metadata.py +124 -0
- blaxel/models/runtime.py +196 -0
- blaxel/models/runtime_startup_probe.py +45 -0
- blaxel/models/serverless_config.py +80 -0
- blaxel/models/spec_configuration.py +70 -0
- blaxel/models/store_agent.py +178 -0
- blaxel/models/store_agent_labels.py +45 -0
- blaxel/models/store_configuration.py +151 -0
- blaxel/models/store_configuration_option.py +79 -0
- blaxel/models/store_function.py +211 -0
- blaxel/models/store_function_kit.py +97 -0
- blaxel/models/store_function_labels.py +45 -0
- blaxel/models/store_function_parameter.py +88 -0
- blaxel/models/time_fields.py +70 -0
- blaxel/models/token_rate_metric.py +88 -0
- blaxel/models/token_rate_metrics.py +120 -0
- blaxel/models/token_total_metric.py +106 -0
- blaxel/models/trace_ids_response.py +45 -0
- blaxel/models/update_workspace_service_account_body.py +69 -0
- blaxel/models/update_workspace_service_account_response_200.py +96 -0
- blaxel/models/update_workspace_user_role_body.py +60 -0
- blaxel/models/websocket_channel.py +88 -0
- blaxel/models/workspace.py +148 -0
- blaxel/models/workspace_labels.py +45 -0
- blaxel/models/workspace_user.py +115 -0
- blaxel/py.typed +1 -0
- blaxel/run.py +108 -0
- blaxel/serve/app.py +131 -0
- blaxel/serve/middlewares/__init__.py +10 -0
- blaxel/serve/middlewares/accesslog.py +32 -0
- blaxel/serve/middlewares/processtime.py +28 -0
- blaxel/types.py +46 -0
- blaxel-0.64.0.dist-info/METADATA +96 -0
- blaxel-0.64.0.dist-info/RECORD +261 -0
- blaxel-0.64.0.dist-info/WHEEL +4 -0
- blaxel-0.64.0.dist-info/entry_points.txt +2 -0
- blaxel-0.64.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,70 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="TimeFields")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class TimeFields:
|
13
|
+
"""Time fields for Persistance
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
created_at (Union[Unset, str]): The date and time when the resource was created
|
17
|
+
updated_at (Union[Unset, str]): The date and time when the resource was updated
|
18
|
+
"""
|
19
|
+
|
20
|
+
created_at: Union[Unset, str] = UNSET
|
21
|
+
updated_at: Union[Unset, str] = UNSET
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
23
|
+
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
25
|
+
created_at = self.created_at
|
26
|
+
|
27
|
+
updated_at = self.updated_at
|
28
|
+
|
29
|
+
field_dict: dict[str, Any] = {}
|
30
|
+
field_dict.update(self.additional_properties)
|
31
|
+
field_dict.update({})
|
32
|
+
if created_at is not UNSET:
|
33
|
+
field_dict["createdAt"] = created_at
|
34
|
+
if updated_at is not UNSET:
|
35
|
+
field_dict["updatedAt"] = updated_at
|
36
|
+
|
37
|
+
return field_dict
|
38
|
+
|
39
|
+
@classmethod
|
40
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
41
|
+
if not src_dict:
|
42
|
+
return None
|
43
|
+
d = src_dict.copy()
|
44
|
+
created_at = d.pop("createdAt", UNSET)
|
45
|
+
|
46
|
+
updated_at = d.pop("updatedAt", UNSET)
|
47
|
+
|
48
|
+
time_fields = cls(
|
49
|
+
created_at=created_at,
|
50
|
+
updated_at=updated_at,
|
51
|
+
)
|
52
|
+
|
53
|
+
time_fields.additional_properties = d
|
54
|
+
return time_fields
|
55
|
+
|
56
|
+
@property
|
57
|
+
def additional_keys(self) -> list[str]:
|
58
|
+
return list(self.additional_properties.keys())
|
59
|
+
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
61
|
+
return self.additional_properties[key]
|
62
|
+
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
64
|
+
self.additional_properties[key] = value
|
65
|
+
|
66
|
+
def __delitem__(self, key: str) -> None:
|
67
|
+
del self.additional_properties[key]
|
68
|
+
|
69
|
+
def __contains__(self, key: str) -> bool:
|
70
|
+
return key in self.additional_properties
|
@@ -0,0 +1,88 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="TokenRateMetric")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class TokenRateMetric:
|
13
|
+
"""Token rate metric
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
model (Union[Unset, str]): Model ID
|
17
|
+
timestamp (Union[Unset, str]): Timestamp
|
18
|
+
token_total (Union[Unset, float]): Total tokens
|
19
|
+
trend (Union[Unset, float]): Trend
|
20
|
+
"""
|
21
|
+
|
22
|
+
model: Union[Unset, str] = UNSET
|
23
|
+
timestamp: Union[Unset, str] = UNSET
|
24
|
+
token_total: Union[Unset, float] = UNSET
|
25
|
+
trend: Union[Unset, float] = UNSET
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
27
|
+
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
29
|
+
model = self.model
|
30
|
+
|
31
|
+
timestamp = self.timestamp
|
32
|
+
|
33
|
+
token_total = self.token_total
|
34
|
+
|
35
|
+
trend = self.trend
|
36
|
+
|
37
|
+
field_dict: dict[str, Any] = {}
|
38
|
+
field_dict.update(self.additional_properties)
|
39
|
+
field_dict.update({})
|
40
|
+
if model is not UNSET:
|
41
|
+
field_dict["model"] = model
|
42
|
+
if timestamp is not UNSET:
|
43
|
+
field_dict["timestamp"] = timestamp
|
44
|
+
if token_total is not UNSET:
|
45
|
+
field_dict["tokenTotal"] = token_total
|
46
|
+
if trend is not UNSET:
|
47
|
+
field_dict["trend"] = trend
|
48
|
+
|
49
|
+
return field_dict
|
50
|
+
|
51
|
+
@classmethod
|
52
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
53
|
+
if not src_dict:
|
54
|
+
return None
|
55
|
+
d = src_dict.copy()
|
56
|
+
model = d.pop("model", UNSET)
|
57
|
+
|
58
|
+
timestamp = d.pop("timestamp", UNSET)
|
59
|
+
|
60
|
+
token_total = d.pop("tokenTotal", UNSET)
|
61
|
+
|
62
|
+
trend = d.pop("trend", UNSET)
|
63
|
+
|
64
|
+
token_rate_metric = cls(
|
65
|
+
model=model,
|
66
|
+
timestamp=timestamp,
|
67
|
+
token_total=token_total,
|
68
|
+
trend=trend,
|
69
|
+
)
|
70
|
+
|
71
|
+
token_rate_metric.additional_properties = d
|
72
|
+
return token_rate_metric
|
73
|
+
|
74
|
+
@property
|
75
|
+
def additional_keys(self) -> list[str]:
|
76
|
+
return list(self.additional_properties.keys())
|
77
|
+
|
78
|
+
def __getitem__(self, key: str) -> Any:
|
79
|
+
return self.additional_properties[key]
|
80
|
+
|
81
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
82
|
+
self.additional_properties[key] = value
|
83
|
+
|
84
|
+
def __delitem__(self, key: str) -> None:
|
85
|
+
del self.additional_properties[key]
|
86
|
+
|
87
|
+
def __contains__(self, key: str) -> bool:
|
88
|
+
return key in self.additional_properties
|
@@ -0,0 +1,120 @@
|
|
1
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
if TYPE_CHECKING:
|
9
|
+
from ..models.token_rate_metric import TokenRateMetric
|
10
|
+
|
11
|
+
|
12
|
+
T = TypeVar("T", bound="TokenRateMetrics")
|
13
|
+
|
14
|
+
|
15
|
+
@_attrs_define
|
16
|
+
class TokenRateMetrics:
|
17
|
+
"""Token rate metrics
|
18
|
+
|
19
|
+
Attributes:
|
20
|
+
token_rate (Union[Unset, TokenRateMetric]): Token rate metric
|
21
|
+
token_rate_input (Union[Unset, TokenRateMetric]): Token rate metric
|
22
|
+
token_rate_output (Union[Unset, TokenRateMetric]): Token rate metric
|
23
|
+
"""
|
24
|
+
|
25
|
+
token_rate: Union[Unset, "TokenRateMetric"] = UNSET
|
26
|
+
token_rate_input: Union[Unset, "TokenRateMetric"] = UNSET
|
27
|
+
token_rate_output: Union[Unset, "TokenRateMetric"] = UNSET
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
29
|
+
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
31
|
+
token_rate: Union[Unset, dict[str, Any]] = UNSET
|
32
|
+
if self.token_rate and not isinstance(self.token_rate, Unset) and not isinstance(self.token_rate, dict):
|
33
|
+
token_rate = self.token_rate.to_dict()
|
34
|
+
elif self.token_rate and isinstance(self.token_rate, dict):
|
35
|
+
token_rate = self.token_rate
|
36
|
+
|
37
|
+
token_rate_input: Union[Unset, dict[str, Any]] = UNSET
|
38
|
+
if (
|
39
|
+
self.token_rate_input
|
40
|
+
and not isinstance(self.token_rate_input, Unset)
|
41
|
+
and not isinstance(self.token_rate_input, dict)
|
42
|
+
):
|
43
|
+
token_rate_input = self.token_rate_input.to_dict()
|
44
|
+
elif self.token_rate_input and isinstance(self.token_rate_input, dict):
|
45
|
+
token_rate_input = self.token_rate_input
|
46
|
+
|
47
|
+
token_rate_output: Union[Unset, dict[str, Any]] = UNSET
|
48
|
+
if (
|
49
|
+
self.token_rate_output
|
50
|
+
and not isinstance(self.token_rate_output, Unset)
|
51
|
+
and not isinstance(self.token_rate_output, dict)
|
52
|
+
):
|
53
|
+
token_rate_output = self.token_rate_output.to_dict()
|
54
|
+
elif self.token_rate_output and isinstance(self.token_rate_output, dict):
|
55
|
+
token_rate_output = self.token_rate_output
|
56
|
+
|
57
|
+
field_dict: dict[str, Any] = {}
|
58
|
+
field_dict.update(self.additional_properties)
|
59
|
+
field_dict.update({})
|
60
|
+
if token_rate is not UNSET:
|
61
|
+
field_dict["tokenRate"] = token_rate
|
62
|
+
if token_rate_input is not UNSET:
|
63
|
+
field_dict["tokenRateInput"] = token_rate_input
|
64
|
+
if token_rate_output is not UNSET:
|
65
|
+
field_dict["tokenRateOutput"] = token_rate_output
|
66
|
+
|
67
|
+
return field_dict
|
68
|
+
|
69
|
+
@classmethod
|
70
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
71
|
+
from ..models.token_rate_metric import TokenRateMetric
|
72
|
+
|
73
|
+
if not src_dict:
|
74
|
+
return None
|
75
|
+
d = src_dict.copy()
|
76
|
+
_token_rate = d.pop("tokenRate", UNSET)
|
77
|
+
token_rate: Union[Unset, TokenRateMetric]
|
78
|
+
if isinstance(_token_rate, Unset):
|
79
|
+
token_rate = UNSET
|
80
|
+
else:
|
81
|
+
token_rate = TokenRateMetric.from_dict(_token_rate)
|
82
|
+
|
83
|
+
_token_rate_input = d.pop("tokenRateInput", UNSET)
|
84
|
+
token_rate_input: Union[Unset, TokenRateMetric]
|
85
|
+
if isinstance(_token_rate_input, Unset):
|
86
|
+
token_rate_input = UNSET
|
87
|
+
else:
|
88
|
+
token_rate_input = TokenRateMetric.from_dict(_token_rate_input)
|
89
|
+
|
90
|
+
_token_rate_output = d.pop("tokenRateOutput", UNSET)
|
91
|
+
token_rate_output: Union[Unset, TokenRateMetric]
|
92
|
+
if isinstance(_token_rate_output, Unset):
|
93
|
+
token_rate_output = UNSET
|
94
|
+
else:
|
95
|
+
token_rate_output = TokenRateMetric.from_dict(_token_rate_output)
|
96
|
+
|
97
|
+
token_rate_metrics = cls(
|
98
|
+
token_rate=token_rate,
|
99
|
+
token_rate_input=token_rate_input,
|
100
|
+
token_rate_output=token_rate_output,
|
101
|
+
)
|
102
|
+
|
103
|
+
token_rate_metrics.additional_properties = d
|
104
|
+
return token_rate_metrics
|
105
|
+
|
106
|
+
@property
|
107
|
+
def additional_keys(self) -> list[str]:
|
108
|
+
return list(self.additional_properties.keys())
|
109
|
+
|
110
|
+
def __getitem__(self, key: str) -> Any:
|
111
|
+
return self.additional_properties[key]
|
112
|
+
|
113
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
114
|
+
self.additional_properties[key] = value
|
115
|
+
|
116
|
+
def __delitem__(self, key: str) -> None:
|
117
|
+
del self.additional_properties[key]
|
118
|
+
|
119
|
+
def __contains__(self, key: str) -> bool:
|
120
|
+
return key in self.additional_properties
|
@@ -0,0 +1,106 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="TokenTotalMetric")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class TokenTotalMetric:
|
13
|
+
"""Token total metric
|
14
|
+
|
15
|
+
Attributes:
|
16
|
+
average_token_input_per_request (Union[Unset, float]): Average input token per request
|
17
|
+
average_token_output_per_request (Union[Unset, float]): Average output token per request
|
18
|
+
average_token_per_request (Union[Unset, float]): Average token per request
|
19
|
+
token_input (Union[Unset, float]): Total input tokens
|
20
|
+
token_output (Union[Unset, float]): Total output tokens
|
21
|
+
token_total (Union[Unset, float]): Total tokens
|
22
|
+
"""
|
23
|
+
|
24
|
+
average_token_input_per_request: Union[Unset, float] = UNSET
|
25
|
+
average_token_output_per_request: Union[Unset, float] = UNSET
|
26
|
+
average_token_per_request: Union[Unset, float] = UNSET
|
27
|
+
token_input: Union[Unset, float] = UNSET
|
28
|
+
token_output: Union[Unset, float] = UNSET
|
29
|
+
token_total: Union[Unset, float] = UNSET
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
31
|
+
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
33
|
+
average_token_input_per_request = self.average_token_input_per_request
|
34
|
+
|
35
|
+
average_token_output_per_request = self.average_token_output_per_request
|
36
|
+
|
37
|
+
average_token_per_request = self.average_token_per_request
|
38
|
+
|
39
|
+
token_input = self.token_input
|
40
|
+
|
41
|
+
token_output = self.token_output
|
42
|
+
|
43
|
+
token_total = self.token_total
|
44
|
+
|
45
|
+
field_dict: dict[str, Any] = {}
|
46
|
+
field_dict.update(self.additional_properties)
|
47
|
+
field_dict.update({})
|
48
|
+
if average_token_input_per_request is not UNSET:
|
49
|
+
field_dict["averageTokenInputPerRequest"] = average_token_input_per_request
|
50
|
+
if average_token_output_per_request is not UNSET:
|
51
|
+
field_dict["averageTokenOutputPerRequest"] = average_token_output_per_request
|
52
|
+
if average_token_per_request is not UNSET:
|
53
|
+
field_dict["averageTokenPerRequest"] = average_token_per_request
|
54
|
+
if token_input is not UNSET:
|
55
|
+
field_dict["tokenInput"] = token_input
|
56
|
+
if token_output is not UNSET:
|
57
|
+
field_dict["tokenOutput"] = token_output
|
58
|
+
if token_total is not UNSET:
|
59
|
+
field_dict["tokenTotal"] = token_total
|
60
|
+
|
61
|
+
return field_dict
|
62
|
+
|
63
|
+
@classmethod
|
64
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
65
|
+
if not src_dict:
|
66
|
+
return None
|
67
|
+
d = src_dict.copy()
|
68
|
+
average_token_input_per_request = d.pop("averageTokenInputPerRequest", UNSET)
|
69
|
+
|
70
|
+
average_token_output_per_request = d.pop("averageTokenOutputPerRequest", UNSET)
|
71
|
+
|
72
|
+
average_token_per_request = d.pop("averageTokenPerRequest", UNSET)
|
73
|
+
|
74
|
+
token_input = d.pop("tokenInput", UNSET)
|
75
|
+
|
76
|
+
token_output = d.pop("tokenOutput", UNSET)
|
77
|
+
|
78
|
+
token_total = d.pop("tokenTotal", UNSET)
|
79
|
+
|
80
|
+
token_total_metric = cls(
|
81
|
+
average_token_input_per_request=average_token_input_per_request,
|
82
|
+
average_token_output_per_request=average_token_output_per_request,
|
83
|
+
average_token_per_request=average_token_per_request,
|
84
|
+
token_input=token_input,
|
85
|
+
token_output=token_output,
|
86
|
+
token_total=token_total,
|
87
|
+
)
|
88
|
+
|
89
|
+
token_total_metric.additional_properties = d
|
90
|
+
return token_total_metric
|
91
|
+
|
92
|
+
@property
|
93
|
+
def additional_keys(self) -> list[str]:
|
94
|
+
return list(self.additional_properties.keys())
|
95
|
+
|
96
|
+
def __getitem__(self, key: str) -> Any:
|
97
|
+
return self.additional_properties[key]
|
98
|
+
|
99
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
100
|
+
self.additional_properties[key] = value
|
101
|
+
|
102
|
+
def __delitem__(self, key: str) -> None:
|
103
|
+
del self.additional_properties[key]
|
104
|
+
|
105
|
+
def __contains__(self, key: str) -> bool:
|
106
|
+
return key in self.additional_properties
|
@@ -0,0 +1,45 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="TraceIdsResponse")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class TraceIdsResponse:
|
11
|
+
"""Trace IDs response"""
|
12
|
+
|
13
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
14
|
+
|
15
|
+
def to_dict(self) -> dict[str, Any]:
|
16
|
+
field_dict: dict[str, Any] = {}
|
17
|
+
field_dict.update(self.additional_properties)
|
18
|
+
|
19
|
+
return field_dict
|
20
|
+
|
21
|
+
@classmethod
|
22
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
23
|
+
if not src_dict:
|
24
|
+
return None
|
25
|
+
d = src_dict.copy()
|
26
|
+
trace_ids_response = cls()
|
27
|
+
|
28
|
+
trace_ids_response.additional_properties = d
|
29
|
+
return trace_ids_response
|
30
|
+
|
31
|
+
@property
|
32
|
+
def additional_keys(self) -> list[str]:
|
33
|
+
return list(self.additional_properties.keys())
|
34
|
+
|
35
|
+
def __getitem__(self, key: str) -> Any:
|
36
|
+
return self.additional_properties[key]
|
37
|
+
|
38
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
39
|
+
self.additional_properties[key] = value
|
40
|
+
|
41
|
+
def __delitem__(self, key: str) -> None:
|
42
|
+
del self.additional_properties[key]
|
43
|
+
|
44
|
+
def __contains__(self, key: str) -> bool:
|
45
|
+
return key in self.additional_properties
|
@@ -0,0 +1,69 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="UpdateWorkspaceServiceAccountBody")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class UpdateWorkspaceServiceAccountBody:
|
13
|
+
"""
|
14
|
+
Attributes:
|
15
|
+
description (Union[Unset, str]): Service account description
|
16
|
+
name (Union[Unset, str]): Service account name
|
17
|
+
"""
|
18
|
+
|
19
|
+
description: Union[Unset, str] = UNSET
|
20
|
+
name: Union[Unset, str] = UNSET
|
21
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
22
|
+
|
23
|
+
def to_dict(self) -> dict[str, Any]:
|
24
|
+
description = self.description
|
25
|
+
|
26
|
+
name = self.name
|
27
|
+
|
28
|
+
field_dict: dict[str, Any] = {}
|
29
|
+
field_dict.update(self.additional_properties)
|
30
|
+
field_dict.update({})
|
31
|
+
if description is not UNSET:
|
32
|
+
field_dict["description"] = description
|
33
|
+
if name is not UNSET:
|
34
|
+
field_dict["name"] = name
|
35
|
+
|
36
|
+
return field_dict
|
37
|
+
|
38
|
+
@classmethod
|
39
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
40
|
+
if not src_dict:
|
41
|
+
return None
|
42
|
+
d = src_dict.copy()
|
43
|
+
description = d.pop("description", UNSET)
|
44
|
+
|
45
|
+
name = d.pop("name", UNSET)
|
46
|
+
|
47
|
+
update_workspace_service_account_body = cls(
|
48
|
+
description=description,
|
49
|
+
name=name,
|
50
|
+
)
|
51
|
+
|
52
|
+
update_workspace_service_account_body.additional_properties = d
|
53
|
+
return update_workspace_service_account_body
|
54
|
+
|
55
|
+
@property
|
56
|
+
def additional_keys(self) -> list[str]:
|
57
|
+
return list(self.additional_properties.keys())
|
58
|
+
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
60
|
+
return self.additional_properties[key]
|
61
|
+
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
63
|
+
self.additional_properties[key] = value
|
64
|
+
|
65
|
+
def __delitem__(self, key: str) -> None:
|
66
|
+
del self.additional_properties[key]
|
67
|
+
|
68
|
+
def __contains__(self, key: str) -> bool:
|
69
|
+
return key in self.additional_properties
|
@@ -0,0 +1,96 @@
|
|
1
|
+
from typing import Any, TypeVar, Union
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
from ..types import UNSET, Unset
|
7
|
+
|
8
|
+
T = TypeVar("T", bound="UpdateWorkspaceServiceAccountResponse200")
|
9
|
+
|
10
|
+
|
11
|
+
@_attrs_define
|
12
|
+
class UpdateWorkspaceServiceAccountResponse200:
|
13
|
+
"""
|
14
|
+
Attributes:
|
15
|
+
client_id (Union[Unset, str]): Service account client ID
|
16
|
+
created_at (Union[Unset, str]): Creation timestamp
|
17
|
+
description (Union[Unset, str]): Service account description
|
18
|
+
name (Union[Unset, str]): Service account name
|
19
|
+
updated_at (Union[Unset, str]): Last update timestamp
|
20
|
+
"""
|
21
|
+
|
22
|
+
client_id: Union[Unset, str] = UNSET
|
23
|
+
created_at: Union[Unset, str] = UNSET
|
24
|
+
description: Union[Unset, str] = UNSET
|
25
|
+
name: Union[Unset, str] = UNSET
|
26
|
+
updated_at: Union[Unset, str] = UNSET
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
28
|
+
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
30
|
+
client_id = self.client_id
|
31
|
+
|
32
|
+
created_at = self.created_at
|
33
|
+
|
34
|
+
description = self.description
|
35
|
+
|
36
|
+
name = self.name
|
37
|
+
|
38
|
+
updated_at = self.updated_at
|
39
|
+
|
40
|
+
field_dict: dict[str, Any] = {}
|
41
|
+
field_dict.update(self.additional_properties)
|
42
|
+
field_dict.update({})
|
43
|
+
if client_id is not UNSET:
|
44
|
+
field_dict["client_id"] = client_id
|
45
|
+
if created_at is not UNSET:
|
46
|
+
field_dict["created_at"] = created_at
|
47
|
+
if description is not UNSET:
|
48
|
+
field_dict["description"] = description
|
49
|
+
if name is not UNSET:
|
50
|
+
field_dict["name"] = name
|
51
|
+
if updated_at is not UNSET:
|
52
|
+
field_dict["updated_at"] = updated_at
|
53
|
+
|
54
|
+
return field_dict
|
55
|
+
|
56
|
+
@classmethod
|
57
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
58
|
+
if not src_dict:
|
59
|
+
return None
|
60
|
+
d = src_dict.copy()
|
61
|
+
client_id = d.pop("client_id", UNSET)
|
62
|
+
|
63
|
+
created_at = d.pop("created_at", UNSET)
|
64
|
+
|
65
|
+
description = d.pop("description", UNSET)
|
66
|
+
|
67
|
+
name = d.pop("name", UNSET)
|
68
|
+
|
69
|
+
updated_at = d.pop("updated_at", UNSET)
|
70
|
+
|
71
|
+
update_workspace_service_account_response_200 = cls(
|
72
|
+
client_id=client_id,
|
73
|
+
created_at=created_at,
|
74
|
+
description=description,
|
75
|
+
name=name,
|
76
|
+
updated_at=updated_at,
|
77
|
+
)
|
78
|
+
|
79
|
+
update_workspace_service_account_response_200.additional_properties = d
|
80
|
+
return update_workspace_service_account_response_200
|
81
|
+
|
82
|
+
@property
|
83
|
+
def additional_keys(self) -> list[str]:
|
84
|
+
return list(self.additional_properties.keys())
|
85
|
+
|
86
|
+
def __getitem__(self, key: str) -> Any:
|
87
|
+
return self.additional_properties[key]
|
88
|
+
|
89
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
90
|
+
self.additional_properties[key] = value
|
91
|
+
|
92
|
+
def __delitem__(self, key: str) -> None:
|
93
|
+
del self.additional_properties[key]
|
94
|
+
|
95
|
+
def __contains__(self, key: str) -> bool:
|
96
|
+
return key in self.additional_properties
|
@@ -0,0 +1,60 @@
|
|
1
|
+
from typing import Any, TypeVar
|
2
|
+
|
3
|
+
from attrs import define as _attrs_define
|
4
|
+
from attrs import field as _attrs_field
|
5
|
+
|
6
|
+
T = TypeVar("T", bound="UpdateWorkspaceUserRoleBody")
|
7
|
+
|
8
|
+
|
9
|
+
@_attrs_define
|
10
|
+
class UpdateWorkspaceUserRoleBody:
|
11
|
+
"""
|
12
|
+
Attributes:
|
13
|
+
role (str): The new role to assign to the user
|
14
|
+
"""
|
15
|
+
|
16
|
+
role: str
|
17
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
18
|
+
|
19
|
+
def to_dict(self) -> dict[str, Any]:
|
20
|
+
role = self.role
|
21
|
+
|
22
|
+
field_dict: dict[str, Any] = {}
|
23
|
+
field_dict.update(self.additional_properties)
|
24
|
+
field_dict.update(
|
25
|
+
{
|
26
|
+
"role": role,
|
27
|
+
}
|
28
|
+
)
|
29
|
+
|
30
|
+
return field_dict
|
31
|
+
|
32
|
+
@classmethod
|
33
|
+
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
34
|
+
if not src_dict:
|
35
|
+
return None
|
36
|
+
d = src_dict.copy()
|
37
|
+
role = d.pop("role")
|
38
|
+
|
39
|
+
update_workspace_user_role_body = cls(
|
40
|
+
role=role,
|
41
|
+
)
|
42
|
+
|
43
|
+
update_workspace_user_role_body.additional_properties = d
|
44
|
+
return update_workspace_user_role_body
|
45
|
+
|
46
|
+
@property
|
47
|
+
def additional_keys(self) -> list[str]:
|
48
|
+
return list(self.additional_properties.keys())
|
49
|
+
|
50
|
+
def __getitem__(self, key: str) -> Any:
|
51
|
+
return self.additional_properties[key]
|
52
|
+
|
53
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
54
|
+
self.additional_properties[key] = value
|
55
|
+
|
56
|
+
def __delitem__(self, key: str) -> None:
|
57
|
+
del self.additional_properties[key]
|
58
|
+
|
59
|
+
def __contains__(self, key: str) -> bool:
|
60
|
+
return key in self.additional_properties
|