beamlit 0.0.46__py3-none-any.whl → 0.0.47__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.
Files changed (45) hide show
  1. beamlit/api/agents/get_agent_metrics.py +12 -12
  2. beamlit/api/functions/get_function_metrics.py +12 -12
  3. beamlit/api/models/get_model_metrics.py +12 -12
  4. beamlit/functions/common.py +0 -1
  5. beamlit/functions/mcp/mcp.py +3 -2
  6. beamlit/models/__init__.py +8 -28
  7. beamlit/models/agent.py +6 -2
  8. beamlit/models/agent_spec.py +30 -6
  9. beamlit/models/core_spec.py +27 -5
  10. beamlit/models/core_spec_configurations.py +3 -1
  11. beamlit/models/environment.py +6 -2
  12. beamlit/models/environment_metadata.py +3 -1
  13. beamlit/models/function.py +6 -2
  14. beamlit/models/function_metadata.py +3 -1
  15. beamlit/models/function_spec.py +27 -5
  16. beamlit/models/integration_connection.py +6 -2
  17. beamlit/models/integration_connection_spec.py +18 -14
  18. beamlit/models/integration_connection_spec_config.py +45 -0
  19. beamlit/models/integration_connection_spec_secret.py +45 -0
  20. beamlit/models/latency_metric.py +24 -4
  21. beamlit/models/metadata.py +3 -1
  22. beamlit/models/metrics.py +13 -3
  23. beamlit/models/model.py +6 -2
  24. beamlit/models/model_spec.py +27 -5
  25. beamlit/models/pending_invitation_accept.py +3 -1
  26. beamlit/models/pending_invitation_render.py +13 -3
  27. beamlit/models/pod_template.py +45 -0
  28. beamlit/models/policy.py +6 -2
  29. beamlit/models/policy_max_tokens.py +106 -0
  30. beamlit/models/policy_spec.py +30 -0
  31. beamlit/models/request_duration_over_time_metrics.py +7 -1
  32. beamlit/models/request_total_by_origin_metric.py +14 -2
  33. beamlit/models/request_total_metric.py +10 -2
  34. beamlit/models/resource_environment_metrics.py +33 -7
  35. beamlit/models/resource_log.py +9 -0
  36. beamlit/models/runtime.py +10 -2
  37. beamlit/models/store_agent.py +3 -1
  38. beamlit/models/store_function.py +3 -1
  39. beamlit/models/token_rate_metrics.py +17 -3
  40. beamlit/models/trace_ids_response.py +3 -21
  41. beamlit/models/workspace.py +3 -1
  42. {beamlit-0.0.46.dist-info → beamlit-0.0.47.dist-info}/METADATA +1 -7
  43. {beamlit-0.0.46.dist-info → beamlit-0.0.47.dist-info}/RECORD +45 -41
  44. {beamlit-0.0.46.dist-info → beamlit-0.0.47.dist-info}/WHEEL +0 -0
  45. {beamlit-0.0.46.dist-info → beamlit-0.0.47.dist-info}/licenses/LICENSE +0 -0
@@ -5,7 +5,7 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.resource_metrics import ResourceMetrics
8
+ from ...models.resource_environment_metrics import ResourceEnvironmentMetrics
9
9
  from ...types import UNSET, Response, Unset
10
10
 
11
11
 
@@ -31,9 +31,9 @@ def _get_kwargs(
31
31
 
32
32
  def _parse_response(
33
33
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
- ) -> Optional[ResourceMetrics]:
34
+ ) -> Optional[ResourceEnvironmentMetrics]:
35
35
  if response.status_code == 200:
36
- response_200 = ResourceMetrics.from_dict(response.json())
36
+ response_200 = ResourceEnvironmentMetrics.from_dict(response.json())
37
37
 
38
38
  return response_200
39
39
  if client.raise_on_unexpected_status:
@@ -44,7 +44,7 @@ def _parse_response(
44
44
 
45
45
  def _build_response(
46
46
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
- ) -> Response[ResourceMetrics]:
47
+ ) -> Response[ResourceEnvironmentMetrics]:
48
48
  return Response(
49
49
  status_code=HTTPStatus(response.status_code),
50
50
  content=response.content,
@@ -58,7 +58,7 @@ def sync_detailed(
58
58
  *,
59
59
  client: AuthenticatedClient,
60
60
  environment: Union[Unset, str] = UNSET,
61
- ) -> Response[ResourceMetrics]:
61
+ ) -> Response[ResourceEnvironmentMetrics]:
62
62
  """Get agent metrics
63
63
 
64
64
  Args:
@@ -70,7 +70,7 @@ def sync_detailed(
70
70
  httpx.TimeoutException: If the request takes longer than Client.timeout.
71
71
 
72
72
  Returns:
73
- Response[ResourceMetrics]
73
+ Response[ResourceEnvironmentMetrics]
74
74
  """
75
75
 
76
76
  kwargs = _get_kwargs(
@@ -90,7 +90,7 @@ def sync(
90
90
  *,
91
91
  client: AuthenticatedClient,
92
92
  environment: Union[Unset, str] = UNSET,
93
- ) -> Optional[ResourceMetrics]:
93
+ ) -> Optional[ResourceEnvironmentMetrics]:
94
94
  """Get agent metrics
95
95
 
96
96
  Args:
@@ -102,7 +102,7 @@ def sync(
102
102
  httpx.TimeoutException: If the request takes longer than Client.timeout.
103
103
 
104
104
  Returns:
105
- ResourceMetrics
105
+ ResourceEnvironmentMetrics
106
106
  """
107
107
 
108
108
  return sync_detailed(
@@ -117,7 +117,7 @@ async def asyncio_detailed(
117
117
  *,
118
118
  client: AuthenticatedClient,
119
119
  environment: Union[Unset, str] = UNSET,
120
- ) -> Response[ResourceMetrics]:
120
+ ) -> Response[ResourceEnvironmentMetrics]:
121
121
  """Get agent metrics
122
122
 
123
123
  Args:
@@ -129,7 +129,7 @@ async def asyncio_detailed(
129
129
  httpx.TimeoutException: If the request takes longer than Client.timeout.
130
130
 
131
131
  Returns:
132
- Response[ResourceMetrics]
132
+ Response[ResourceEnvironmentMetrics]
133
133
  """
134
134
 
135
135
  kwargs = _get_kwargs(
@@ -147,7 +147,7 @@ async def asyncio(
147
147
  *,
148
148
  client: AuthenticatedClient,
149
149
  environment: Union[Unset, str] = UNSET,
150
- ) -> Optional[ResourceMetrics]:
150
+ ) -> Optional[ResourceEnvironmentMetrics]:
151
151
  """Get agent metrics
152
152
 
153
153
  Args:
@@ -159,7 +159,7 @@ async def asyncio(
159
159
  httpx.TimeoutException: If the request takes longer than Client.timeout.
160
160
 
161
161
  Returns:
162
- ResourceMetrics
162
+ ResourceEnvironmentMetrics
163
163
  """
164
164
 
165
165
  return (
@@ -5,7 +5,7 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.resource_metrics import ResourceMetrics
8
+ from ...models.resource_environment_metrics import ResourceEnvironmentMetrics
9
9
  from ...types import UNSET, Response, Unset
10
10
 
11
11
 
@@ -31,9 +31,9 @@ def _get_kwargs(
31
31
 
32
32
  def _parse_response(
33
33
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
- ) -> Optional[ResourceMetrics]:
34
+ ) -> Optional[ResourceEnvironmentMetrics]:
35
35
  if response.status_code == 200:
36
- response_200 = ResourceMetrics.from_dict(response.json())
36
+ response_200 = ResourceEnvironmentMetrics.from_dict(response.json())
37
37
 
38
38
  return response_200
39
39
  if client.raise_on_unexpected_status:
@@ -44,7 +44,7 @@ def _parse_response(
44
44
 
45
45
  def _build_response(
46
46
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
- ) -> Response[ResourceMetrics]:
47
+ ) -> Response[ResourceEnvironmentMetrics]:
48
48
  return Response(
49
49
  status_code=HTTPStatus(response.status_code),
50
50
  content=response.content,
@@ -58,7 +58,7 @@ def sync_detailed(
58
58
  *,
59
59
  client: AuthenticatedClient,
60
60
  environment: Union[Unset, str] = UNSET,
61
- ) -> Response[ResourceMetrics]:
61
+ ) -> Response[ResourceEnvironmentMetrics]:
62
62
  """Get function metrics
63
63
 
64
64
  Args:
@@ -70,7 +70,7 @@ def sync_detailed(
70
70
  httpx.TimeoutException: If the request takes longer than Client.timeout.
71
71
 
72
72
  Returns:
73
- Response[ResourceMetrics]
73
+ Response[ResourceEnvironmentMetrics]
74
74
  """
75
75
 
76
76
  kwargs = _get_kwargs(
@@ -90,7 +90,7 @@ def sync(
90
90
  *,
91
91
  client: AuthenticatedClient,
92
92
  environment: Union[Unset, str] = UNSET,
93
- ) -> Optional[ResourceMetrics]:
93
+ ) -> Optional[ResourceEnvironmentMetrics]:
94
94
  """Get function metrics
95
95
 
96
96
  Args:
@@ -102,7 +102,7 @@ def sync(
102
102
  httpx.TimeoutException: If the request takes longer than Client.timeout.
103
103
 
104
104
  Returns:
105
- ResourceMetrics
105
+ ResourceEnvironmentMetrics
106
106
  """
107
107
 
108
108
  return sync_detailed(
@@ -117,7 +117,7 @@ async def asyncio_detailed(
117
117
  *,
118
118
  client: AuthenticatedClient,
119
119
  environment: Union[Unset, str] = UNSET,
120
- ) -> Response[ResourceMetrics]:
120
+ ) -> Response[ResourceEnvironmentMetrics]:
121
121
  """Get function metrics
122
122
 
123
123
  Args:
@@ -129,7 +129,7 @@ async def asyncio_detailed(
129
129
  httpx.TimeoutException: If the request takes longer than Client.timeout.
130
130
 
131
131
  Returns:
132
- Response[ResourceMetrics]
132
+ Response[ResourceEnvironmentMetrics]
133
133
  """
134
134
 
135
135
  kwargs = _get_kwargs(
@@ -147,7 +147,7 @@ async def asyncio(
147
147
  *,
148
148
  client: AuthenticatedClient,
149
149
  environment: Union[Unset, str] = UNSET,
150
- ) -> Optional[ResourceMetrics]:
150
+ ) -> Optional[ResourceEnvironmentMetrics]:
151
151
  """Get function metrics
152
152
 
153
153
  Args:
@@ -159,7 +159,7 @@ async def asyncio(
159
159
  httpx.TimeoutException: If the request takes longer than Client.timeout.
160
160
 
161
161
  Returns:
162
- ResourceMetrics
162
+ ResourceEnvironmentMetrics
163
163
  """
164
164
 
165
165
  return (
@@ -5,7 +5,7 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.resource_metrics import ResourceMetrics
8
+ from ...models.resource_environment_metrics import ResourceEnvironmentMetrics
9
9
  from ...types import UNSET, Response, Unset
10
10
 
11
11
 
@@ -31,9 +31,9 @@ def _get_kwargs(
31
31
 
32
32
  def _parse_response(
33
33
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
- ) -> Optional[ResourceMetrics]:
34
+ ) -> Optional[ResourceEnvironmentMetrics]:
35
35
  if response.status_code == 200:
36
- response_200 = ResourceMetrics.from_dict(response.json())
36
+ response_200 = ResourceEnvironmentMetrics.from_dict(response.json())
37
37
 
38
38
  return response_200
39
39
  if client.raise_on_unexpected_status:
@@ -44,7 +44,7 @@ def _parse_response(
44
44
 
45
45
  def _build_response(
46
46
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
- ) -> Response[ResourceMetrics]:
47
+ ) -> Response[ResourceEnvironmentMetrics]:
48
48
  return Response(
49
49
  status_code=HTTPStatus(response.status_code),
50
50
  content=response.content,
@@ -58,7 +58,7 @@ def sync_detailed(
58
58
  *,
59
59
  client: AuthenticatedClient,
60
60
  environment: Union[Unset, str] = UNSET,
61
- ) -> Response[ResourceMetrics]:
61
+ ) -> Response[ResourceEnvironmentMetrics]:
62
62
  """Get model metrics
63
63
 
64
64
  Returns metrics for a model by name.
@@ -72,7 +72,7 @@ def sync_detailed(
72
72
  httpx.TimeoutException: If the request takes longer than Client.timeout.
73
73
 
74
74
  Returns:
75
- Response[ResourceMetrics]
75
+ Response[ResourceEnvironmentMetrics]
76
76
  """
77
77
 
78
78
  kwargs = _get_kwargs(
@@ -92,7 +92,7 @@ def sync(
92
92
  *,
93
93
  client: AuthenticatedClient,
94
94
  environment: Union[Unset, str] = UNSET,
95
- ) -> Optional[ResourceMetrics]:
95
+ ) -> Optional[ResourceEnvironmentMetrics]:
96
96
  """Get model metrics
97
97
 
98
98
  Returns metrics for a model by name.
@@ -106,7 +106,7 @@ def sync(
106
106
  httpx.TimeoutException: If the request takes longer than Client.timeout.
107
107
 
108
108
  Returns:
109
- ResourceMetrics
109
+ ResourceEnvironmentMetrics
110
110
  """
111
111
 
112
112
  return sync_detailed(
@@ -121,7 +121,7 @@ async def asyncio_detailed(
121
121
  *,
122
122
  client: AuthenticatedClient,
123
123
  environment: Union[Unset, str] = UNSET,
124
- ) -> Response[ResourceMetrics]:
124
+ ) -> Response[ResourceEnvironmentMetrics]:
125
125
  """Get model metrics
126
126
 
127
127
  Returns metrics for a model by name.
@@ -135,7 +135,7 @@ async def asyncio_detailed(
135
135
  httpx.TimeoutException: If the request takes longer than Client.timeout.
136
136
 
137
137
  Returns:
138
- Response[ResourceMetrics]
138
+ Response[ResourceEnvironmentMetrics]
139
139
  """
140
140
 
141
141
  kwargs = _get_kwargs(
@@ -153,7 +153,7 @@ async def asyncio(
153
153
  *,
154
154
  client: AuthenticatedClient,
155
155
  environment: Union[Unset, str] = UNSET,
156
- ) -> Optional[ResourceMetrics]:
156
+ ) -> Optional[ResourceEnvironmentMetrics]:
157
157
  """Get model metrics
158
158
 
159
159
  Returns metrics for a model by name.
@@ -167,7 +167,7 @@ async def asyncio(
167
167
  httpx.TimeoutException: If the request takes longer than Client.timeout.
168
168
 
169
169
  Returns:
170
- ResourceMetrics
170
+ ResourceEnvironmentMetrics
171
171
  """
172
172
 
173
173
  return (
@@ -4,7 +4,6 @@ import asyncio
4
4
  import importlib.util
5
5
  import os
6
6
  import traceback
7
-
8
7
  from logging import getLogger
9
8
  from typing import Union
10
9
 
@@ -6,13 +6,14 @@ import pydantic
6
6
  import pydantic_core
7
7
  import requests
8
8
  import typing_extensions as t
9
- from beamlit.authentication.authentication import AuthenticatedClient
10
- from beamlit.common.settings import get_settings
11
9
  from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
12
10
  from mcp.types import CallToolResult, ListToolsResult
13
11
  from pydantic.json_schema import JsonSchemaValue
14
12
  from pydantic_core import core_schema as cs
15
13
 
14
+ from beamlit.authentication.authentication import AuthenticatedClient
15
+ from beamlit.common.settings import get_settings
16
+
16
17
  settings = get_settings()
17
18
 
18
19
  TYPE_MAP = {
@@ -5,7 +5,6 @@ from .agent import Agent
5
5
  from .agent_chain import AgentChain
6
6
  from .agent_history import AgentHistory
7
7
  from .agent_history_event import AgentHistoryEvent
8
- from .agent_metadata import AgentMetadata
9
8
  from .agent_release import AgentRelease
10
9
  from .agent_spec import AgentSpec
11
10
  from .api_key import ApiKey
@@ -37,12 +36,10 @@ from .get_workspace_service_accounts_response_200_item import (
37
36
  )
38
37
  from .histogram_bucket import HistogramBucket
39
38
  from .histogram_stats import HistogramStats
40
- from .increase_and_rate_metric import IncreaseAndRateMetric
41
- from .integration_config import IntegrationConfig
42
39
  from .integration_connection import IntegrationConnection
43
- from .integration_connection_config import IntegrationConnectionConfig
44
- from .integration_connection_secret import IntegrationConnectionSecret
45
40
  from .integration_connection_spec import IntegrationConnectionSpec
41
+ from .integration_connection_spec_config import IntegrationConnectionSpecConfig
42
+ from .integration_connection_spec_secret import IntegrationConnectionSpecSecret
46
43
  from .integration_model import IntegrationModel
47
44
  from .integration_repository import IntegrationRepository
48
45
  from .invite_workspace_user_body import InviteWorkspaceUserBody
@@ -57,7 +54,6 @@ from .metrics_models import MetricsModels
57
54
  from .metrics_request_total_per_code import MetricsRequestTotalPerCode
58
55
  from .metrics_rps_per_code import MetricsRpsPerCode
59
56
  from .model import Model
60
- from .model_metadata import ModelMetadata
61
57
  from .model_private_cluster import ModelPrivateCluster
62
58
  from .model_release import ModelRelease
63
59
  from .model_spec import ModelSpec
@@ -68,14 +64,14 @@ from .pending_invitation_render import PendingInvitationRender
68
64
  from .pending_invitation_render_invited_by import PendingInvitationRenderInvitedBy
69
65
  from .pending_invitation_render_workspace import PendingInvitationRenderWorkspace
70
66
  from .pending_invitation_workspace_details import PendingInvitationWorkspaceDetails
67
+ from .pod_template import PodTemplate
71
68
  from .pod_template_spec import PodTemplateSpec
72
69
  from .policy import Policy
73
70
  from .policy_location import PolicyLocation
71
+ from .policy_max_tokens import PolicyMaxTokens
74
72
  from .policy_spec import PolicySpec
75
73
  from .private_cluster import PrivateCluster
76
74
  from .private_location import PrivateLocation
77
- from .provider_config import ProviderConfig
78
- from .qps import QPS
79
75
  from .repository import Repository
80
76
  from .request_duration_over_time_metric import RequestDurationOverTimeMetric
81
77
  from .request_duration_over_time_metrics import RequestDurationOverTimeMetrics
@@ -89,20 +85,12 @@ from .request_total_by_origin_metric_request_total_by_origin_and_code import (
89
85
  from .request_total_metric import RequestTotalMetric
90
86
  from .request_total_metric_request_total_per_code import RequestTotalMetricRequestTotalPerCode
91
87
  from .request_total_metric_rps_per_code import RequestTotalMetricRpsPerCode
92
- from .resource_deployment_metrics import ResourceDeploymentMetrics
93
- from .resource_deployment_metrics_inference_per_second_per_region import (
94
- ResourceDeploymentMetricsInferencePerSecondPerRegion,
95
- )
96
- from .resource_deployment_metrics_query_per_second_per_region_per_code import (
97
- ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode,
98
- )
99
88
  from .resource_environment_metrics import ResourceEnvironmentMetrics
100
89
  from .resource_environment_metrics_request_total_per_code import (
101
90
  ResourceEnvironmentMetricsRequestTotalPerCode,
102
91
  )
103
92
  from .resource_environment_metrics_rps_per_code import ResourceEnvironmentMetricsRpsPerCode
104
93
  from .resource_log import ResourceLog
105
- from .resource_metrics import ResourceMetrics
106
94
  from .runtime import Runtime
107
95
  from .runtime_readiness_probe import RuntimeReadinessProbe
108
96
  from .runtime_resources import RuntimeResources
@@ -135,7 +123,6 @@ __all__ = (
135
123
  "AgentChain",
136
124
  "AgentHistory",
137
125
  "AgentHistoryEvent",
138
- "AgentMetadata",
139
126
  "AgentRelease",
140
127
  "AgentSpec",
141
128
  "ApiKey",
@@ -165,12 +152,10 @@ __all__ = (
165
152
  "GetWorkspaceServiceAccountsResponse200Item",
166
153
  "HistogramBucket",
167
154
  "HistogramStats",
168
- "IncreaseAndRateMetric",
169
- "IntegrationConfig",
170
155
  "IntegrationConnection",
171
- "IntegrationConnectionConfig",
172
- "IntegrationConnectionSecret",
173
156
  "IntegrationConnectionSpec",
157
+ "IntegrationConnectionSpecConfig",
158
+ "IntegrationConnectionSpecSecret",
174
159
  "IntegrationModel",
175
160
  "IntegrationRepository",
176
161
  "InviteWorkspaceUserBody",
@@ -185,7 +170,6 @@ __all__ = (
185
170
  "MetricsRequestTotalPerCode",
186
171
  "MetricsRpsPerCode",
187
172
  "Model",
188
- "ModelMetadata",
189
173
  "ModelPrivateCluster",
190
174
  "ModelRelease",
191
175
  "ModelSpec",
@@ -196,14 +180,14 @@ __all__ = (
196
180
  "PendingInvitationRenderInvitedBy",
197
181
  "PendingInvitationRenderWorkspace",
198
182
  "PendingInvitationWorkspaceDetails",
183
+ "PodTemplate",
199
184
  "PodTemplateSpec",
200
185
  "Policy",
201
186
  "PolicyLocation",
187
+ "PolicyMaxTokens",
202
188
  "PolicySpec",
203
189
  "PrivateCluster",
204
190
  "PrivateLocation",
205
- "ProviderConfig",
206
- "QPS",
207
191
  "Repository",
208
192
  "RequestDurationOverTimeMetric",
209
193
  "RequestDurationOverTimeMetrics",
@@ -213,14 +197,10 @@ __all__ = (
213
197
  "RequestTotalMetric",
214
198
  "RequestTotalMetricRequestTotalPerCode",
215
199
  "RequestTotalMetricRpsPerCode",
216
- "ResourceDeploymentMetrics",
217
- "ResourceDeploymentMetricsInferencePerSecondPerRegion",
218
- "ResourceDeploymentMetricsQueryPerSecondPerRegionPerCode",
219
200
  "ResourceEnvironmentMetrics",
220
201
  "ResourceEnvironmentMetricsRequestTotalPerCode",
221
202
  "ResourceEnvironmentMetricsRpsPerCode",
222
203
  "ResourceLog",
223
- "ResourceMetrics",
224
204
  "Runtime",
225
205
  "RuntimeReadinessProbe",
226
206
  "RuntimeResources",
beamlit/models/agent.py CHANGED
@@ -40,12 +40,16 @@ class Agent:
40
40
  events.append(componentsschemas_core_events_item)
41
41
 
42
42
  metadata: Union[Unset, dict[str, Any]] = UNSET
43
- if self.metadata and not isinstance(self.metadata, Unset):
43
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
44
44
  metadata = self.metadata.to_dict()
45
+ elif self.metadata and isinstance(self.metadata, dict):
46
+ metadata = self.metadata
45
47
 
46
48
  spec: Union[Unset, dict[str, Any]] = UNSET
47
- if self.spec and not isinstance(self.spec, Unset):
49
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
48
50
  spec = self.spec.to_dict()
51
+ elif self.spec and isinstance(self.spec, dict):
52
+ spec = self.spec
49
53
 
50
54
  status = self.status
51
55
 
@@ -62,8 +62,14 @@ class AgentSpec:
62
62
 
63
63
  def to_dict(self) -> dict[str, Any]:
64
64
  configurations: Union[Unset, dict[str, Any]] = UNSET
65
- if self.configurations and not isinstance(self.configurations, Unset):
65
+ if (
66
+ self.configurations
67
+ and not isinstance(self.configurations, Unset)
68
+ and not isinstance(self.configurations, dict)
69
+ ):
66
70
  configurations = self.configurations.to_dict()
71
+ elif self.configurations and isinstance(self.configurations, dict):
72
+ configurations = self.configurations
67
73
 
68
74
  enabled = self.enabled
69
75
 
@@ -79,26 +85,42 @@ class AgentSpec:
79
85
  integration_connections = self.integration_connections
80
86
 
81
87
  pod_template: Union[Unset, dict[str, Any]] = UNSET
82
- if self.pod_template and not isinstance(self.pod_template, Unset):
88
+ if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
83
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
84
92
 
85
93
  policies: Union[Unset, list[str]] = UNSET
86
94
  if not isinstance(self.policies, Unset):
87
95
  policies = self.policies
88
96
 
89
97
  private_clusters: Union[Unset, dict[str, Any]] = UNSET
90
- if self.private_clusters and not isinstance(self.private_clusters, Unset):
98
+ if (
99
+ self.private_clusters
100
+ and not isinstance(self.private_clusters, Unset)
101
+ and not isinstance(self.private_clusters, dict)
102
+ ):
91
103
  private_clusters = self.private_clusters.to_dict()
104
+ elif self.private_clusters and isinstance(self.private_clusters, dict):
105
+ private_clusters = self.private_clusters
92
106
 
93
107
  runtime: Union[Unset, dict[str, Any]] = UNSET
94
- if self.runtime and not isinstance(self.runtime, Unset):
108
+ if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
95
109
  runtime = self.runtime.to_dict()
110
+ elif self.runtime and isinstance(self.runtime, dict):
111
+ runtime = self.runtime
96
112
 
97
113
  sandbox = self.sandbox
98
114
 
99
115
  serverless_config: Union[Unset, dict[str, Any]] = UNSET
100
- if self.serverless_config and not isinstance(self.serverless_config, Unset):
116
+ if (
117
+ self.serverless_config
118
+ and not isinstance(self.serverless_config, Unset)
119
+ and not isinstance(self.serverless_config, dict)
120
+ ):
101
121
  serverless_config = self.serverless_config.to_dict()
122
+ elif self.serverless_config and isinstance(self.serverless_config, dict):
123
+ serverless_config = self.serverless_config
102
124
 
103
125
  agent_chain: Union[Unset, list[dict[str, Any]]] = UNSET
104
126
  if not isinstance(self.agent_chain, Unset):
@@ -116,8 +138,10 @@ class AgentSpec:
116
138
  model = self.model
117
139
 
118
140
  repository: Union[Unset, dict[str, Any]] = UNSET
119
- if self.repository and not isinstance(self.repository, Unset):
141
+ if self.repository and not isinstance(self.repository, Unset) and not isinstance(self.repository, dict):
120
142
  repository = self.repository.to_dict()
143
+ elif self.repository and isinstance(self.repository, dict):
144
+ repository = self.repository
121
145
 
122
146
  store_id = self.store_id
123
147
 
@@ -48,8 +48,14 @@ class CoreSpec:
48
48
 
49
49
  def to_dict(self) -> dict[str, Any]:
50
50
  configurations: Union[Unset, dict[str, Any]] = UNSET
51
- if self.configurations and not isinstance(self.configurations, Unset):
51
+ if (
52
+ self.configurations
53
+ and not isinstance(self.configurations, Unset)
54
+ and not isinstance(self.configurations, dict)
55
+ ):
52
56
  configurations = self.configurations.to_dict()
57
+ elif self.configurations and isinstance(self.configurations, dict):
58
+ configurations = self.configurations
53
59
 
54
60
  enabled = self.enabled
55
61
 
@@ -65,26 +71,42 @@ class CoreSpec:
65
71
  integration_connections = self.integration_connections
66
72
 
67
73
  pod_template: Union[Unset, dict[str, Any]] = UNSET
68
- if self.pod_template and not isinstance(self.pod_template, Unset):
74
+ if self.pod_template and not isinstance(self.pod_template, Unset) and not isinstance(self.pod_template, dict):
69
75
  pod_template = self.pod_template.to_dict()
76
+ elif self.pod_template and isinstance(self.pod_template, dict):
77
+ pod_template = self.pod_template
70
78
 
71
79
  policies: Union[Unset, list[str]] = UNSET
72
80
  if not isinstance(self.policies, Unset):
73
81
  policies = self.policies
74
82
 
75
83
  private_clusters: Union[Unset, dict[str, Any]] = UNSET
76
- if self.private_clusters and not isinstance(self.private_clusters, Unset):
84
+ if (
85
+ self.private_clusters
86
+ and not isinstance(self.private_clusters, Unset)
87
+ and not isinstance(self.private_clusters, dict)
88
+ ):
77
89
  private_clusters = self.private_clusters.to_dict()
90
+ elif self.private_clusters and isinstance(self.private_clusters, dict):
91
+ private_clusters = self.private_clusters
78
92
 
79
93
  runtime: Union[Unset, dict[str, Any]] = UNSET
80
- if self.runtime and not isinstance(self.runtime, Unset):
94
+ if self.runtime and not isinstance(self.runtime, Unset) and not isinstance(self.runtime, dict):
81
95
  runtime = self.runtime.to_dict()
96
+ elif self.runtime and isinstance(self.runtime, dict):
97
+ runtime = self.runtime
82
98
 
83
99
  sandbox = self.sandbox
84
100
 
85
101
  serverless_config: Union[Unset, dict[str, Any]] = UNSET
86
- if self.serverless_config and not isinstance(self.serverless_config, Unset):
102
+ if (
103
+ self.serverless_config
104
+ and not isinstance(self.serverless_config, Unset)
105
+ and not isinstance(self.serverless_config, dict)
106
+ ):
87
107
  serverless_config = self.serverless_config.to_dict()
108
+ elif self.serverless_config and isinstance(self.serverless_config, dict):
109
+ serverless_config = self.serverless_config
88
110
 
89
111
  field_dict: dict[str, Any] = {}
90
112
  field_dict.update(self.additional_properties)
@@ -26,8 +26,10 @@ class CoreSpecConfigurations:
26
26
 
27
27
  def to_dict(self) -> dict[str, Any]:
28
28
  key: Union[Unset, dict[str, Any]] = UNSET
29
- if self.key and not isinstance(self.key, Unset):
29
+ if self.key and not isinstance(self.key, Unset) and not isinstance(self.key, dict):
30
30
  key = self.key.to_dict()
31
+ elif self.key and isinstance(self.key, dict):
32
+ key = self.key
31
33
 
32
34
  field_dict: dict[str, Any] = {}
33
35
  field_dict.update(self.additional_properties)
@@ -28,12 +28,16 @@ class Environment:
28
28
 
29
29
  def to_dict(self) -> dict[str, Any]:
30
30
  metadata: Union[Unset, dict[str, Any]] = UNSET
31
- if self.metadata and not isinstance(self.metadata, Unset):
31
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
32
32
  metadata = self.metadata.to_dict()
33
+ elif self.metadata and isinstance(self.metadata, dict):
34
+ metadata = self.metadata
33
35
 
34
36
  spec: Union[Unset, dict[str, Any]] = UNSET
35
- if self.spec and not isinstance(self.spec, Unset):
37
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
36
38
  spec = self.spec.to_dict()
39
+ elif self.spec and isinstance(self.spec, dict):
40
+ spec = self.spec
37
41
 
38
42
  field_dict: dict[str, Any] = {}
39
43
  field_dict.update(self.additional_properties)
@@ -51,8 +51,10 @@ class EnvironmentMetadata:
51
51
  display_name = self.display_name
52
52
 
53
53
  labels: Union[Unset, dict[str, Any]] = UNSET
54
- if self.labels and not isinstance(self.labels, Unset):
54
+ if self.labels and not isinstance(self.labels, Unset) and not isinstance(self.labels, dict):
55
55
  labels = self.labels.to_dict()
56
+ elif self.labels and isinstance(self.labels, dict):
57
+ labels = self.labels
56
58
 
57
59
  name = self.name
58
60
 
@@ -40,12 +40,16 @@ class Function:
40
40
  events.append(componentsschemas_core_events_item)
41
41
 
42
42
  metadata: Union[Unset, dict[str, Any]] = UNSET
43
- if self.metadata and not isinstance(self.metadata, Unset):
43
+ if self.metadata and not isinstance(self.metadata, Unset) and not isinstance(self.metadata, dict):
44
44
  metadata = self.metadata.to_dict()
45
+ elif self.metadata and isinstance(self.metadata, dict):
46
+ metadata = self.metadata
45
47
 
46
48
  spec: Union[Unset, dict[str, Any]] = UNSET
47
- if self.spec and not isinstance(self.spec, Unset):
49
+ if self.spec and not isinstance(self.spec, Unset) and not isinstance(self.spec, dict):
48
50
  spec = self.spec.to_dict()
51
+ elif self.spec and isinstance(self.spec, dict):
52
+ spec = self.spec
49
53
 
50
54
  status = self.status
51
55