blaxel 0.1.9rc35__py3-none-any.whl → 0.1.9rc37__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/agents/__init__.py +53 -16
- blaxel/authentication/__init__.py +3 -4
- blaxel/client/api/compute/__init__.py +0 -0
- blaxel/client/api/compute/create_sandbox.py +166 -0
- blaxel/client/api/compute/delete_sandbox.py +154 -0
- blaxel/client/api/compute/get_sandbox.py +154 -0
- blaxel/client/api/compute/list_sandboxes.py +135 -0
- blaxel/client/api/compute/start_sandbox.py +157 -0
- blaxel/client/api/compute/stop_sandbox.py +157 -0
- blaxel/client/api/compute/update_sandbox.py +179 -0
- blaxel/client/api/default/list_sandbox_hub_definitions.py +123 -0
- blaxel/client/api/functions/list_function_revisions.py +16 -11
- blaxel/client/api/knowledgebases/list_knowledgebase_revisions.py +16 -11
- blaxel/client/api/models/list_model_revisions.py +16 -11
- blaxel/client/api/templates/list_templates.py +16 -11
- blaxel/client/models/__init__.py +32 -2
- blaxel/client/models/agent_spec.py +25 -69
- blaxel/client/models/core_spec.py +1 -45
- blaxel/client/models/function_spec.py +1 -45
- blaxel/client/models/last_n_requests_metric.py +18 -0
- blaxel/client/models/metrics.py +20 -0
- blaxel/client/models/model_spec.py +1 -45
- blaxel/client/models/{agent_chain.py → port.py} +23 -32
- blaxel/client/models/request_total_metric.py +12 -1
- blaxel/client/models/request_total_response_data.py +97 -0
- blaxel/client/models/resource_log.py +9 -0
- blaxel/client/models/resource_metrics.py +144 -0
- blaxel/client/models/resource_metrics_request_total_per_code_previous.py +45 -0
- blaxel/client/models/resource_metrics_rps_per_code_previous.py +45 -0
- blaxel/client/models/runtime.py +83 -7
- blaxel/client/models/runtime_configuration.py +45 -0
- blaxel/client/models/sandbox.py +129 -0
- blaxel/client/models/sandbox_definition.py +181 -0
- blaxel/client/models/sandbox_spec.py +208 -0
- blaxel/client/models/sandboxes.py +129 -0
- blaxel/client/models/serverless_config.py +29 -1
- blaxel/client/models/serverless_config_configuration.py +45 -0
- blaxel/client/models/start_sandbox.py +94 -0
- blaxel/client/models/stop_sandbox.py +94 -0
- blaxel/client/models/trigger.py +98 -0
- blaxel/client/models/trigger_configuration.py +45 -0
- blaxel/client/models/workspace.py +20 -0
- blaxel/client/models/workspace_runtime.py +61 -0
- blaxel/common/autoload.py +0 -4
- blaxel/common/internal.py +75 -0
- blaxel/common/settings.py +6 -1
- blaxel/instrumentation/exporters.py +3 -6
- blaxel/instrumentation/manager.py +5 -3
- blaxel/mcp/client.py +1 -3
- blaxel/mcp/server.py +4 -4
- blaxel/models/__init__.py +2 -1
- blaxel/models/custom/langchain/gemini.py +41 -18
- blaxel/models/custom/llamaindex/cohere.py +25 -16
- blaxel/models/custom/pydantic/gemini.py +0 -1
- blaxel/models/livekit.py +1 -1
- blaxel/tools/__init__.py +63 -22
- blaxel/tools/langchain.py +1 -2
- {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc37.dist-info}/METADATA +1 -4
- {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc37.dist-info}/RECORD +61 -37
- {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc37.dist-info}/WHEEL +0 -0
- {blaxel-0.1.9rc35.dist-info → blaxel-0.1.9rc37.dist-info}/licenses/LICENSE +0 -0
@@ -6,15 +6,13 @@ from attrs import field as _attrs_field
|
|
6
6
|
from ..types import UNSET, Unset
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
|
-
from ..models.agent_chain import AgentChain
|
10
9
|
from ..models.core_spec_configurations import CoreSpecConfigurations
|
11
10
|
from ..models.flavor import Flavor
|
12
11
|
from ..models.model_private_cluster import ModelPrivateCluster
|
13
|
-
from ..models.pod_template_spec import PodTemplateSpec
|
14
12
|
from ..models.repository import Repository
|
15
13
|
from ..models.revision_configuration import RevisionConfiguration
|
16
14
|
from ..models.runtime import Runtime
|
17
|
-
from ..models.
|
15
|
+
from ..models.trigger import Trigger
|
18
16
|
|
19
17
|
|
20
18
|
T = TypeVar("T", bound="AgentSpec")
|
@@ -26,17 +24,14 @@ class AgentSpec:
|
|
26
24
|
|
27
25
|
Attributes:
|
28
26
|
configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
|
29
|
-
enabled (Union[Unset, bool]): Enable or disable the
|
27
|
+
enabled (Union[Unset, bool]): Enable or disable the resource
|
30
28
|
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
31
29
|
integration_connections (Union[Unset, list[str]]):
|
32
|
-
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
33
30
|
policies (Union[Unset, list[str]]):
|
34
31
|
private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
|
35
32
|
revision (Union[Unset, RevisionConfiguration]): Revision configuration
|
36
33
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
37
34
|
sandbox (Union[Unset, bool]): Sandbox mode
|
38
|
-
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
39
|
-
agent_chain (Union[Unset, list['AgentChain']]): Agent chain
|
40
35
|
description (Union[Unset, str]): Description, small description computed from the prompt
|
41
36
|
functions (Union[Unset, list[str]]):
|
42
37
|
knowledgebase (Union[Unset, str]): Knowledgebase Name
|
@@ -44,20 +39,18 @@ class AgentSpec:
|
|
44
39
|
prompt (Union[Unset, str]): Prompt, describe what your agent does
|
45
40
|
repository (Union[Unset, Repository]): Repository
|
46
41
|
store_id (Union[Unset, str]): Store id
|
42
|
+
triggers (Union[Unset, list['Trigger']]): Triggers to use your agent
|
47
43
|
"""
|
48
44
|
|
49
45
|
configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
|
50
46
|
enabled: Union[Unset, bool] = UNSET
|
51
47
|
flavors: Union[Unset, list["Flavor"]] = UNSET
|
52
48
|
integration_connections: Union[Unset, list[str]] = UNSET
|
53
|
-
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
54
49
|
policies: Union[Unset, list[str]] = UNSET
|
55
50
|
private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
|
56
51
|
revision: Union[Unset, "RevisionConfiguration"] = UNSET
|
57
52
|
runtime: Union[Unset, "Runtime"] = UNSET
|
58
53
|
sandbox: Union[Unset, bool] = UNSET
|
59
|
-
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
60
|
-
agent_chain: Union[Unset, list["AgentChain"]] = UNSET
|
61
54
|
description: Union[Unset, str] = UNSET
|
62
55
|
functions: Union[Unset, list[str]] = UNSET
|
63
56
|
knowledgebase: Union[Unset, str] = UNSET
|
@@ -65,6 +58,7 @@ class AgentSpec:
|
|
65
58
|
prompt: Union[Unset, str] = UNSET
|
66
59
|
repository: Union[Unset, "Repository"] = UNSET
|
67
60
|
store_id: Union[Unset, str] = UNSET
|
61
|
+
triggers: Union[Unset, list["Trigger"]] = UNSET
|
68
62
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
69
63
|
|
70
64
|
def to_dict(self) -> dict[str, Any]:
|
@@ -94,12 +88,6 @@ class AgentSpec:
|
|
94
88
|
if not isinstance(self.integration_connections, Unset):
|
95
89
|
integration_connections = self.integration_connections
|
96
90
|
|
97
|
-
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
98
|
-
if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
|
99
|
-
pod_template = self.pod_template.to_dict()
|
100
|
-
elif self.pod_template and isinstance(self.pod_template, dict):
|
101
|
-
pod_template = self.pod_template
|
102
|
-
|
103
91
|
policies: Union[Unset, list[str]] = UNSET
|
104
92
|
if not isinstance(self.policies, Unset):
|
105
93
|
policies = self.policies
|
@@ -128,26 +116,6 @@ class AgentSpec:
|
|
128
116
|
|
129
117
|
sandbox = self.sandbox
|
130
118
|
|
131
|
-
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
132
|
-
if (
|
133
|
-
self.serverless_config
|
134
|
-
and not isinstance(self.serverless_config, Unset)
|
135
|
-
and not isinstance(self.serverless_config, dict)
|
136
|
-
):
|
137
|
-
serverless_config = self.serverless_config.to_dict()
|
138
|
-
elif self.serverless_config and isinstance(self.serverless_config, dict):
|
139
|
-
serverless_config = self.serverless_config
|
140
|
-
|
141
|
-
agent_chain: Union[Unset, list[dict[str, Any]]] = UNSET
|
142
|
-
if not isinstance(self.agent_chain, Unset):
|
143
|
-
agent_chain = []
|
144
|
-
for componentsschemas_agent_chains_item_data in self.agent_chain:
|
145
|
-
if type(componentsschemas_agent_chains_item_data) == dict:
|
146
|
-
componentsschemas_agent_chains_item = componentsschemas_agent_chains_item_data
|
147
|
-
else:
|
148
|
-
componentsschemas_agent_chains_item = componentsschemas_agent_chains_item_data.to_dict()
|
149
|
-
agent_chain.append(componentsschemas_agent_chains_item)
|
150
|
-
|
151
119
|
description = self.description
|
152
120
|
|
153
121
|
functions: Union[Unset, list[str]] = UNSET
|
@@ -168,6 +136,16 @@ class AgentSpec:
|
|
168
136
|
|
169
137
|
store_id = self.store_id
|
170
138
|
|
139
|
+
triggers: Union[Unset, list[dict[str, Any]]] = UNSET
|
140
|
+
if not isinstance(self.triggers, Unset):
|
141
|
+
triggers = []
|
142
|
+
for componentsschemas_triggers_item_data in self.triggers:
|
143
|
+
if type(componentsschemas_triggers_item_data) == dict:
|
144
|
+
componentsschemas_triggers_item = componentsschemas_triggers_item_data
|
145
|
+
else:
|
146
|
+
componentsschemas_triggers_item = componentsschemas_triggers_item_data.to_dict()
|
147
|
+
triggers.append(componentsschemas_triggers_item)
|
148
|
+
|
171
149
|
field_dict: dict[str, Any] = {}
|
172
150
|
field_dict.update(self.additional_properties)
|
173
151
|
field_dict.update({})
|
@@ -179,8 +157,6 @@ class AgentSpec:
|
|
179
157
|
field_dict["flavors"] = flavors
|
180
158
|
if integration_connections is not UNSET:
|
181
159
|
field_dict["integrationConnections"] = integration_connections
|
182
|
-
if pod_template is not UNSET:
|
183
|
-
field_dict["podTemplate"] = pod_template
|
184
160
|
if policies is not UNSET:
|
185
161
|
field_dict["policies"] = policies
|
186
162
|
if private_clusters is not UNSET:
|
@@ -191,10 +167,6 @@ class AgentSpec:
|
|
191
167
|
field_dict["runtime"] = runtime
|
192
168
|
if sandbox is not UNSET:
|
193
169
|
field_dict["sandbox"] = sandbox
|
194
|
-
if serverless_config is not UNSET:
|
195
|
-
field_dict["serverlessConfig"] = serverless_config
|
196
|
-
if agent_chain is not UNSET:
|
197
|
-
field_dict["agentChain"] = agent_chain
|
198
170
|
if description is not UNSET:
|
199
171
|
field_dict["description"] = description
|
200
172
|
if functions is not UNSET:
|
@@ -209,20 +181,20 @@ class AgentSpec:
|
|
209
181
|
field_dict["repository"] = repository
|
210
182
|
if store_id is not UNSET:
|
211
183
|
field_dict["storeId"] = store_id
|
184
|
+
if triggers is not UNSET:
|
185
|
+
field_dict["triggers"] = triggers
|
212
186
|
|
213
187
|
return field_dict
|
214
188
|
|
215
189
|
@classmethod
|
216
190
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
217
|
-
from ..models.agent_chain import AgentChain
|
218
191
|
from ..models.core_spec_configurations import CoreSpecConfigurations
|
219
192
|
from ..models.flavor import Flavor
|
220
193
|
from ..models.model_private_cluster import ModelPrivateCluster
|
221
|
-
from ..models.pod_template_spec import PodTemplateSpec
|
222
194
|
from ..models.repository import Repository
|
223
195
|
from ..models.revision_configuration import RevisionConfiguration
|
224
196
|
from ..models.runtime import Runtime
|
225
|
-
from ..models.
|
197
|
+
from ..models.trigger import Trigger
|
226
198
|
|
227
199
|
if not src_dict:
|
228
200
|
return None
|
@@ -245,13 +217,6 @@ class AgentSpec:
|
|
245
217
|
|
246
218
|
integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
|
247
219
|
|
248
|
-
_pod_template = d.pop("podTemplate", UNSET)
|
249
|
-
pod_template: Union[Unset, PodTemplateSpec]
|
250
|
-
if isinstance(_pod_template, Unset):
|
251
|
-
pod_template = UNSET
|
252
|
-
else:
|
253
|
-
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
254
|
-
|
255
220
|
policies = cast(list[str], d.pop("policies", UNSET))
|
256
221
|
|
257
222
|
_private_clusters = d.pop("privateClusters", UNSET)
|
@@ -277,20 +242,6 @@ class AgentSpec:
|
|
277
242
|
|
278
243
|
sandbox = d.pop("sandbox", UNSET)
|
279
244
|
|
280
|
-
_serverless_config = d.pop("serverlessConfig", UNSET)
|
281
|
-
serverless_config: Union[Unset, ServerlessConfig]
|
282
|
-
if isinstance(_serverless_config, Unset):
|
283
|
-
serverless_config = UNSET
|
284
|
-
else:
|
285
|
-
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
286
|
-
|
287
|
-
agent_chain = []
|
288
|
-
_agent_chain = d.pop("agentChain", UNSET)
|
289
|
-
for componentsschemas_agent_chains_item_data in _agent_chain or []:
|
290
|
-
componentsschemas_agent_chains_item = AgentChain.from_dict(componentsschemas_agent_chains_item_data)
|
291
|
-
|
292
|
-
agent_chain.append(componentsschemas_agent_chains_item)
|
293
|
-
|
294
245
|
description = d.pop("description", UNSET)
|
295
246
|
|
296
247
|
functions = cast(list[str], d.pop("functions", UNSET))
|
@@ -310,19 +261,23 @@ class AgentSpec:
|
|
310
261
|
|
311
262
|
store_id = d.pop("storeId", UNSET)
|
312
263
|
|
264
|
+
triggers = []
|
265
|
+
_triggers = d.pop("triggers", UNSET)
|
266
|
+
for componentsschemas_triggers_item_data in _triggers or []:
|
267
|
+
componentsschemas_triggers_item = Trigger.from_dict(componentsschemas_triggers_item_data)
|
268
|
+
|
269
|
+
triggers.append(componentsschemas_triggers_item)
|
270
|
+
|
313
271
|
agent_spec = cls(
|
314
272
|
configurations=configurations,
|
315
273
|
enabled=enabled,
|
316
274
|
flavors=flavors,
|
317
275
|
integration_connections=integration_connections,
|
318
|
-
pod_template=pod_template,
|
319
276
|
policies=policies,
|
320
277
|
private_clusters=private_clusters,
|
321
278
|
revision=revision,
|
322
279
|
runtime=runtime,
|
323
280
|
sandbox=sandbox,
|
324
|
-
serverless_config=serverless_config,
|
325
|
-
agent_chain=agent_chain,
|
326
281
|
description=description,
|
327
282
|
functions=functions,
|
328
283
|
knowledgebase=knowledgebase,
|
@@ -330,6 +285,7 @@ class AgentSpec:
|
|
330
285
|
prompt=prompt,
|
331
286
|
repository=repository,
|
332
287
|
store_id=store_id,
|
288
|
+
triggers=triggers,
|
333
289
|
)
|
334
290
|
|
335
291
|
agent_spec.additional_properties = d
|
@@ -9,10 +9,8 @@ if TYPE_CHECKING:
|
|
9
9
|
from ..models.core_spec_configurations import CoreSpecConfigurations
|
10
10
|
from ..models.flavor import Flavor
|
11
11
|
from ..models.model_private_cluster import ModelPrivateCluster
|
12
|
-
from ..models.pod_template_spec import PodTemplateSpec
|
13
12
|
from ..models.revision_configuration import RevisionConfiguration
|
14
13
|
from ..models.runtime import Runtime
|
15
|
-
from ..models.serverless_config import ServerlessConfig
|
16
14
|
|
17
15
|
|
18
16
|
T = TypeVar("T", bound="CoreSpec")
|
@@ -24,29 +22,25 @@ class CoreSpec:
|
|
24
22
|
|
25
23
|
Attributes:
|
26
24
|
configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
|
27
|
-
enabled (Union[Unset, bool]): Enable or disable the
|
25
|
+
enabled (Union[Unset, bool]): Enable or disable the resource
|
28
26
|
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
29
27
|
integration_connections (Union[Unset, list[str]]):
|
30
|
-
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
31
28
|
policies (Union[Unset, list[str]]):
|
32
29
|
private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
|
33
30
|
revision (Union[Unset, RevisionConfiguration]): Revision configuration
|
34
31
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
35
32
|
sandbox (Union[Unset, bool]): Sandbox mode
|
36
|
-
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
37
33
|
"""
|
38
34
|
|
39
35
|
configurations: Union[Unset, "CoreSpecConfigurations"] = UNSET
|
40
36
|
enabled: Union[Unset, bool] = UNSET
|
41
37
|
flavors: Union[Unset, list["Flavor"]] = UNSET
|
42
38
|
integration_connections: Union[Unset, list[str]] = UNSET
|
43
|
-
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
44
39
|
policies: Union[Unset, list[str]] = UNSET
|
45
40
|
private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
|
46
41
|
revision: Union[Unset, "RevisionConfiguration"] = UNSET
|
47
42
|
runtime: Union[Unset, "Runtime"] = UNSET
|
48
43
|
sandbox: Union[Unset, bool] = UNSET
|
49
|
-
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
50
44
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
51
45
|
|
52
46
|
def to_dict(self) -> dict[str, Any]:
|
@@ -76,12 +70,6 @@ class CoreSpec:
|
|
76
70
|
if not isinstance(self.integration_connections, Unset):
|
77
71
|
integration_connections = self.integration_connections
|
78
72
|
|
79
|
-
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
80
|
-
if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
|
81
|
-
pod_template = self.pod_template.to_dict()
|
82
|
-
elif self.pod_template and isinstance(self.pod_template, dict):
|
83
|
-
pod_template = self.pod_template
|
84
|
-
|
85
73
|
policies: Union[Unset, list[str]] = UNSET
|
86
74
|
if not isinstance(self.policies, Unset):
|
87
75
|
policies = self.policies
|
@@ -110,16 +98,6 @@ class CoreSpec:
|
|
110
98
|
|
111
99
|
sandbox = self.sandbox
|
112
100
|
|
113
|
-
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
114
|
-
if (
|
115
|
-
self.serverless_config
|
116
|
-
and not isinstance(self.serverless_config, Unset)
|
117
|
-
and not isinstance(self.serverless_config, dict)
|
118
|
-
):
|
119
|
-
serverless_config = self.serverless_config.to_dict()
|
120
|
-
elif self.serverless_config and isinstance(self.serverless_config, dict):
|
121
|
-
serverless_config = self.serverless_config
|
122
|
-
|
123
101
|
field_dict: dict[str, Any] = {}
|
124
102
|
field_dict.update(self.additional_properties)
|
125
103
|
field_dict.update({})
|
@@ -131,8 +109,6 @@ class CoreSpec:
|
|
131
109
|
field_dict["flavors"] = flavors
|
132
110
|
if integration_connections is not UNSET:
|
133
111
|
field_dict["integrationConnections"] = integration_connections
|
134
|
-
if pod_template is not UNSET:
|
135
|
-
field_dict["podTemplate"] = pod_template
|
136
112
|
if policies is not UNSET:
|
137
113
|
field_dict["policies"] = policies
|
138
114
|
if private_clusters is not UNSET:
|
@@ -143,8 +119,6 @@ class CoreSpec:
|
|
143
119
|
field_dict["runtime"] = runtime
|
144
120
|
if sandbox is not UNSET:
|
145
121
|
field_dict["sandbox"] = sandbox
|
146
|
-
if serverless_config is not UNSET:
|
147
|
-
field_dict["serverlessConfig"] = serverless_config
|
148
122
|
|
149
123
|
return field_dict
|
150
124
|
|
@@ -153,10 +127,8 @@ class CoreSpec:
|
|
153
127
|
from ..models.core_spec_configurations import CoreSpecConfigurations
|
154
128
|
from ..models.flavor import Flavor
|
155
129
|
from ..models.model_private_cluster import ModelPrivateCluster
|
156
|
-
from ..models.pod_template_spec import PodTemplateSpec
|
157
130
|
from ..models.revision_configuration import RevisionConfiguration
|
158
131
|
from ..models.runtime import Runtime
|
159
|
-
from ..models.serverless_config import ServerlessConfig
|
160
132
|
|
161
133
|
if not src_dict:
|
162
134
|
return None
|
@@ -179,13 +151,6 @@ class CoreSpec:
|
|
179
151
|
|
180
152
|
integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
|
181
153
|
|
182
|
-
_pod_template = d.pop("podTemplate", UNSET)
|
183
|
-
pod_template: Union[Unset, PodTemplateSpec]
|
184
|
-
if isinstance(_pod_template, Unset):
|
185
|
-
pod_template = UNSET
|
186
|
-
else:
|
187
|
-
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
188
|
-
|
189
154
|
policies = cast(list[str], d.pop("policies", UNSET))
|
190
155
|
|
191
156
|
_private_clusters = d.pop("privateClusters", UNSET)
|
@@ -211,25 +176,16 @@ class CoreSpec:
|
|
211
176
|
|
212
177
|
sandbox = d.pop("sandbox", UNSET)
|
213
178
|
|
214
|
-
_serverless_config = d.pop("serverlessConfig", UNSET)
|
215
|
-
serverless_config: Union[Unset, ServerlessConfig]
|
216
|
-
if isinstance(_serverless_config, Unset):
|
217
|
-
serverless_config = UNSET
|
218
|
-
else:
|
219
|
-
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
220
|
-
|
221
179
|
core_spec = cls(
|
222
180
|
configurations=configurations,
|
223
181
|
enabled=enabled,
|
224
182
|
flavors=flavors,
|
225
183
|
integration_connections=integration_connections,
|
226
|
-
pod_template=pod_template,
|
227
184
|
policies=policies,
|
228
185
|
private_clusters=private_clusters,
|
229
186
|
revision=revision,
|
230
187
|
runtime=runtime,
|
231
188
|
sandbox=sandbox,
|
232
|
-
serverless_config=serverless_config,
|
233
189
|
)
|
234
190
|
|
235
191
|
core_spec.additional_properties = d
|
@@ -11,10 +11,8 @@ if TYPE_CHECKING:
|
|
11
11
|
from ..models.function_kit import FunctionKit
|
12
12
|
from ..models.function_schema import FunctionSchema
|
13
13
|
from ..models.model_private_cluster import ModelPrivateCluster
|
14
|
-
from ..models.pod_template_spec import PodTemplateSpec
|
15
14
|
from ..models.revision_configuration import RevisionConfiguration
|
16
15
|
from ..models.runtime import Runtime
|
17
|
-
from ..models.serverless_config import ServerlessConfig
|
18
16
|
|
19
17
|
|
20
18
|
T = TypeVar("T", bound="FunctionSpec")
|
@@ -26,16 +24,14 @@ class FunctionSpec:
|
|
26
24
|
|
27
25
|
Attributes:
|
28
26
|
configurations (Union[Unset, CoreSpecConfigurations]): Optional configurations for the object
|
29
|
-
enabled (Union[Unset, bool]): Enable or disable the
|
27
|
+
enabled (Union[Unset, bool]): Enable or disable the resource
|
30
28
|
flavors (Union[Unset, list['Flavor']]): Types of hardware available for deployments
|
31
29
|
integration_connections (Union[Unset, list[str]]):
|
32
|
-
pod_template (Union[Unset, PodTemplateSpec]): Pod template specification
|
33
30
|
policies (Union[Unset, list[str]]):
|
34
31
|
private_clusters (Union[Unset, ModelPrivateCluster]): Private cluster where the model deployment is deployed
|
35
32
|
revision (Union[Unset, RevisionConfiguration]): Revision configuration
|
36
33
|
runtime (Union[Unset, Runtime]): Set of configurations for a deployment
|
37
34
|
sandbox (Union[Unset, bool]): Sandbox mode
|
38
|
-
serverless_config (Union[Unset, ServerlessConfig]): Configuration for a serverless deployment
|
39
35
|
description (Union[Unset, str]): Function description, very important for the agent function to work with an LLM
|
40
36
|
kit (Union[Unset, list['FunctionKit']]): Function kits
|
41
37
|
schema (Union[Unset, FunctionSchema]): Function schema
|
@@ -45,13 +41,11 @@ class FunctionSpec:
|
|
45
41
|
enabled: Union[Unset, bool] = UNSET
|
46
42
|
flavors: Union[Unset, list["Flavor"]] = UNSET
|
47
43
|
integration_connections: Union[Unset, list[str]] = UNSET
|
48
|
-
pod_template: Union[Unset, "PodTemplateSpec"] = UNSET
|
49
44
|
policies: Union[Unset, list[str]] = UNSET
|
50
45
|
private_clusters: Union[Unset, "ModelPrivateCluster"] = UNSET
|
51
46
|
revision: Union[Unset, "RevisionConfiguration"] = UNSET
|
52
47
|
runtime: Union[Unset, "Runtime"] = UNSET
|
53
48
|
sandbox: Union[Unset, bool] = UNSET
|
54
|
-
serverless_config: Union[Unset, "ServerlessConfig"] = UNSET
|
55
49
|
description: Union[Unset, str] = UNSET
|
56
50
|
kit: Union[Unset, list["FunctionKit"]] = UNSET
|
57
51
|
schema: Union[Unset, "FunctionSchema"] = UNSET
|
@@ -84,12 +78,6 @@ class FunctionSpec:
|
|
84
78
|
if not isinstance(self.integration_connections, Unset):
|
85
79
|
integration_connections = self.integration_connections
|
86
80
|
|
87
|
-
pod_template: Union[Unset, dict[str, Any]] = UNSET
|
88
|
-
if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
|
89
|
-
pod_template = self.pod_template.to_dict()
|
90
|
-
elif self.pod_template and isinstance(self.pod_template, dict):
|
91
|
-
pod_template = self.pod_template
|
92
|
-
|
93
81
|
policies: Union[Unset, list[str]] = UNSET
|
94
82
|
if not isinstance(self.policies, Unset):
|
95
83
|
policies = self.policies
|
@@ -118,16 +106,6 @@ class FunctionSpec:
|
|
118
106
|
|
119
107
|
sandbox = self.sandbox
|
120
108
|
|
121
|
-
serverless_config: Union[Unset, dict[str, Any]] = UNSET
|
122
|
-
if (
|
123
|
-
self.serverless_config
|
124
|
-
and not isinstance(self.serverless_config, Unset)
|
125
|
-
and not isinstance(self.serverless_config, dict)
|
126
|
-
):
|
127
|
-
serverless_config = self.serverless_config.to_dict()
|
128
|
-
elif self.serverless_config and isinstance(self.serverless_config, dict):
|
129
|
-
serverless_config = self.serverless_config
|
130
|
-
|
131
109
|
description = self.description
|
132
110
|
|
133
111
|
kit: Union[Unset, list[dict[str, Any]]] = UNSET
|
@@ -157,8 +135,6 @@ class FunctionSpec:
|
|
157
135
|
field_dict["flavors"] = flavors
|
158
136
|
if integration_connections is not UNSET:
|
159
137
|
field_dict["integrationConnections"] = integration_connections
|
160
|
-
if pod_template is not UNSET:
|
161
|
-
field_dict["podTemplate"] = pod_template
|
162
138
|
if policies is not UNSET:
|
163
139
|
field_dict["policies"] = policies
|
164
140
|
if private_clusters is not UNSET:
|
@@ -169,8 +145,6 @@ class FunctionSpec:
|
|
169
145
|
field_dict["runtime"] = runtime
|
170
146
|
if sandbox is not UNSET:
|
171
147
|
field_dict["sandbox"] = sandbox
|
172
|
-
if serverless_config is not UNSET:
|
173
|
-
field_dict["serverlessConfig"] = serverless_config
|
174
148
|
if description is not UNSET:
|
175
149
|
field_dict["description"] = description
|
176
150
|
if kit is not UNSET:
|
@@ -187,10 +161,8 @@ class FunctionSpec:
|
|
187
161
|
from ..models.function_kit import FunctionKit
|
188
162
|
from ..models.function_schema import FunctionSchema
|
189
163
|
from ..models.model_private_cluster import ModelPrivateCluster
|
190
|
-
from ..models.pod_template_spec import PodTemplateSpec
|
191
164
|
from ..models.revision_configuration import RevisionConfiguration
|
192
165
|
from ..models.runtime import Runtime
|
193
|
-
from ..models.serverless_config import ServerlessConfig
|
194
166
|
|
195
167
|
if not src_dict:
|
196
168
|
return None
|
@@ -213,13 +185,6 @@ class FunctionSpec:
|
|
213
185
|
|
214
186
|
integration_connections = cast(list[str], d.pop("integrationConnections", UNSET))
|
215
187
|
|
216
|
-
_pod_template = d.pop("podTemplate", UNSET)
|
217
|
-
pod_template: Union[Unset, PodTemplateSpec]
|
218
|
-
if isinstance(_pod_template, Unset):
|
219
|
-
pod_template = UNSET
|
220
|
-
else:
|
221
|
-
pod_template = PodTemplateSpec.from_dict(_pod_template)
|
222
|
-
|
223
188
|
policies = cast(list[str], d.pop("policies", UNSET))
|
224
189
|
|
225
190
|
_private_clusters = d.pop("privateClusters", UNSET)
|
@@ -245,13 +210,6 @@ class FunctionSpec:
|
|
245
210
|
|
246
211
|
sandbox = d.pop("sandbox", UNSET)
|
247
212
|
|
248
|
-
_serverless_config = d.pop("serverlessConfig", UNSET)
|
249
|
-
serverless_config: Union[Unset, ServerlessConfig]
|
250
|
-
if isinstance(_serverless_config, Unset):
|
251
|
-
serverless_config = UNSET
|
252
|
-
else:
|
253
|
-
serverless_config = ServerlessConfig.from_dict(_serverless_config)
|
254
|
-
|
255
213
|
description = d.pop("description", UNSET)
|
256
214
|
|
257
215
|
kit = []
|
@@ -273,13 +231,11 @@ class FunctionSpec:
|
|
273
231
|
enabled=enabled,
|
274
232
|
flavors=flavors,
|
275
233
|
integration_connections=integration_connections,
|
276
|
-
pod_template=pod_template,
|
277
234
|
policies=policies,
|
278
235
|
private_clusters=private_clusters,
|
279
236
|
revision=revision,
|
280
237
|
runtime=runtime,
|
281
238
|
sandbox=sandbox,
|
282
|
-
serverless_config=serverless_config,
|
283
239
|
description=description,
|
284
240
|
kit=kit,
|
285
241
|
schema=schema,
|
@@ -14,11 +14,15 @@ class LastNRequestsMetric:
|
|
14
14
|
|
15
15
|
Attributes:
|
16
16
|
date (Union[Unset, str]): Timestamp
|
17
|
+
status_code (Union[Unset, str]): Status code
|
18
|
+
workload_id (Union[Unset, str]): Workload ID
|
17
19
|
workload_type (Union[Unset, str]): Workload type
|
18
20
|
workspace (Union[Unset, str]): Workspace
|
19
21
|
"""
|
20
22
|
|
21
23
|
date: Union[Unset, str] = UNSET
|
24
|
+
status_code: Union[Unset, str] = UNSET
|
25
|
+
workload_id: Union[Unset, str] = UNSET
|
22
26
|
workload_type: Union[Unset, str] = UNSET
|
23
27
|
workspace: Union[Unset, str] = UNSET
|
24
28
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -26,6 +30,10 @@ class LastNRequestsMetric:
|
|
26
30
|
def to_dict(self) -> dict[str, Any]:
|
27
31
|
date = self.date
|
28
32
|
|
33
|
+
status_code = self.status_code
|
34
|
+
|
35
|
+
workload_id = self.workload_id
|
36
|
+
|
29
37
|
workload_type = self.workload_type
|
30
38
|
|
31
39
|
workspace = self.workspace
|
@@ -35,6 +43,10 @@ class LastNRequestsMetric:
|
|
35
43
|
field_dict.update({})
|
36
44
|
if date is not UNSET:
|
37
45
|
field_dict["date"] = date
|
46
|
+
if status_code is not UNSET:
|
47
|
+
field_dict["statusCode"] = status_code
|
48
|
+
if workload_id is not UNSET:
|
49
|
+
field_dict["workloadId"] = workload_id
|
38
50
|
if workload_type is not UNSET:
|
39
51
|
field_dict["workloadType"] = workload_type
|
40
52
|
if workspace is not UNSET:
|
@@ -49,12 +61,18 @@ class LastNRequestsMetric:
|
|
49
61
|
d = src_dict.copy()
|
50
62
|
date = d.pop("date", UNSET)
|
51
63
|
|
64
|
+
status_code = d.pop("statusCode", UNSET)
|
65
|
+
|
66
|
+
workload_id = d.pop("workloadId", UNSET)
|
67
|
+
|
52
68
|
workload_type = d.pop("workloadType", UNSET)
|
53
69
|
|
54
70
|
workspace = d.pop("workspace", UNSET)
|
55
71
|
|
56
72
|
last_n_requests_metric = cls(
|
57
73
|
date=date,
|
74
|
+
status_code=status_code,
|
75
|
+
workload_id=workload_id,
|
58
76
|
workload_type=workload_type,
|
59
77
|
workspace=workspace,
|
60
78
|
)
|
blaxel/client/models/metrics.py
CHANGED
@@ -22,6 +22,8 @@ class Metrics:
|
|
22
22
|
agents (Union[Unset, Any]): Metrics for agents
|
23
23
|
functions (Union[Unset, Any]): Metrics for functions
|
24
24
|
inference_global (Union[Unset, list[Any]]): Historical requests for all resources globally
|
25
|
+
items (Union[Unset, list[Any]]): Historical requests for all resources globally
|
26
|
+
last_n_requests (Union[Unset, int]): Metric value
|
25
27
|
models (Union[Unset, MetricsModels]): Metrics for models
|
26
28
|
request_total (Union[Unset, float]): Number of requests for all resources globally
|
27
29
|
request_total_per_code (Union[Unset, MetricsRequestTotalPerCode]): Number of requests for all resources globally
|
@@ -34,6 +36,8 @@ class Metrics:
|
|
34
36
|
agents: Union[Unset, Any] = UNSET
|
35
37
|
functions: Union[Unset, Any] = UNSET
|
36
38
|
inference_global: Union[Unset, list[Any]] = UNSET
|
39
|
+
items: Union[Unset, list[Any]] = UNSET
|
40
|
+
last_n_requests: Union[Unset, int] = UNSET
|
37
41
|
models: Union[Unset, "MetricsModels"] = UNSET
|
38
42
|
request_total: Union[Unset, float] = UNSET
|
39
43
|
request_total_per_code: Union[Unset, "MetricsRequestTotalPerCode"] = UNSET
|
@@ -50,6 +54,12 @@ class Metrics:
|
|
50
54
|
if not isinstance(self.inference_global, Unset):
|
51
55
|
inference_global = self.inference_global
|
52
56
|
|
57
|
+
items: Union[Unset, list[Any]] = UNSET
|
58
|
+
if not isinstance(self.items, Unset):
|
59
|
+
items = self.items
|
60
|
+
|
61
|
+
last_n_requests = self.last_n_requests
|
62
|
+
|
53
63
|
models: Union[Unset, dict[str, Any]] = UNSET
|
54
64
|
if self.models and not isinstance(self.models, Unset) and not isinstance(self.models, dict):
|
55
65
|
models = self.models.to_dict()
|
@@ -85,6 +95,10 @@ class Metrics:
|
|
85
95
|
field_dict["functions"] = functions
|
86
96
|
if inference_global is not UNSET:
|
87
97
|
field_dict["inferenceGlobal"] = inference_global
|
98
|
+
if items is not UNSET:
|
99
|
+
field_dict["items"] = items
|
100
|
+
if last_n_requests is not UNSET:
|
101
|
+
field_dict["lastNRequests"] = last_n_requests
|
88
102
|
if models is not UNSET:
|
89
103
|
field_dict["models"] = models
|
90
104
|
if request_total is not UNSET:
|
@@ -113,6 +127,10 @@ class Metrics:
|
|
113
127
|
|
114
128
|
inference_global = cast(list[Any], d.pop("inferenceGlobal", UNSET))
|
115
129
|
|
130
|
+
items = cast(list[Any], d.pop("items", UNSET))
|
131
|
+
|
132
|
+
last_n_requests = d.pop("lastNRequests", UNSET)
|
133
|
+
|
116
134
|
_models = d.pop("models", UNSET)
|
117
135
|
models: Union[Unset, MetricsModels]
|
118
136
|
if isinstance(_models, Unset):
|
@@ -142,6 +160,8 @@ class Metrics:
|
|
142
160
|
agents=agents,
|
143
161
|
functions=functions,
|
144
162
|
inference_global=inference_global,
|
163
|
+
items=items,
|
164
|
+
last_n_requests=last_n_requests,
|
145
165
|
models=models,
|
146
166
|
request_total=request_total,
|
147
167
|
request_total_per_code=request_total_per_code,
|