beamlit 0.0.24rc19__py3-none-any.whl → 0.0.24rc21__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. beamlit/agents/chat.py +37 -11
  2. beamlit/agents/decorator.py +97 -65
  3. beamlit/api/agents/create_agent.py +9 -14
  4. beamlit/api/agents/delete_agent.py +22 -1
  5. beamlit/api/agents/delete_agent_history.py +2 -6
  6. beamlit/api/agents/get_agent.py +22 -1
  7. beamlit/api/agents/get_agent_environment_logs.py +11 -11
  8. beamlit/api/agents/get_agent_history.py +2 -6
  9. beamlit/api/agents/get_agent_metrics.py +22 -1
  10. beamlit/api/agents/list_agent_history.py +11 -11
  11. beamlit/api/agents/list_agents.py +36 -4
  12. beamlit/api/agents/put_agent_history.py +2 -6
  13. beamlit/api/agents/update_agent.py +9 -14
  14. beamlit/api/functions/create_function.py +9 -14
  15. beamlit/api/functions/delete_function.py +22 -1
  16. beamlit/api/functions/get_function.py +22 -1
  17. beamlit/api/functions/get_function_environment_logs.py +11 -11
  18. beamlit/api/functions/get_function_metrics.py +22 -1
  19. beamlit/api/functions/list_functions.py +36 -4
  20. beamlit/api/functions/update_function.py +9 -14
  21. beamlit/api/history/get_agents_history.py +12 -12
  22. beamlit/api/history/list_agents_history.py +12 -12
  23. beamlit/api/integrations/get_integration_connection.py +16 -12
  24. beamlit/api/integrations/get_integration_connection_model.py +8 -1
  25. beamlit/api/integrations/get_integration_model.py +8 -1
  26. beamlit/api/locations/list_locations.py +12 -12
  27. beamlit/api/models/create_model.py +13 -14
  28. beamlit/api/models/delete_model.py +22 -1
  29. beamlit/api/models/get_model.py +22 -1
  30. beamlit/api/models/get_model_environment_logs.py +11 -11
  31. beamlit/api/models/get_model_metrics.py +38 -13
  32. beamlit/api/models/list_models.py +36 -4
  33. beamlit/api/models/update_model.py +13 -14
  34. beamlit/api/privateclusters/__init__.py +0 -0
  35. beamlit/api/{agents/get_agent_deployment_metrics.py → privateclusters/create_private_cluster.py} +28 -55
  36. beamlit/api/{functions/list_function_deployments.py → privateclusters/delete_private_cluster.py} +38 -37
  37. beamlit/api/{agents/get_agent_deployment.py → privateclusters/get_private_cluster.py} +40 -44
  38. beamlit/api/privateclusters/get_private_cluster_health.py +97 -0
  39. beamlit/api/{agents/list_agent_deployments.py → privateclusters/list_private_clusters.py} +30 -45
  40. beamlit/api/{models/list_model_deployments.py → privateclusters/update_private_cluster.py} +38 -45
  41. beamlit/api/privateclusters/update_private_cluster_health.py +97 -0
  42. beamlit/authentication/device_mode.py +3 -9
  43. beamlit/common/generate.py +47 -34
  44. beamlit/common/settings.py +29 -27
  45. beamlit/deploy/deploy.py +101 -342
  46. beamlit/deploy/format.py +70 -0
  47. beamlit/deploy/parser.py +175 -0
  48. beamlit/functions/decorator.py +17 -14
  49. beamlit/models/__init__.py +64 -78
  50. beamlit/models/acl.py +4 -22
  51. beamlit/models/agent.py +34 -95
  52. beamlit/models/agent_history.py +7 -5
  53. beamlit/models/agent_history_event.py +11 -9
  54. beamlit/models/agent_metadata.py +5 -3
  55. beamlit/models/agent_spec.py +54 -45
  56. beamlit/models/api_key.py +14 -14
  57. beamlit/models/configuration.py +11 -0
  58. beamlit/models/core_spec.py +45 -32
  59. beamlit/models/{model_deployment_metrics_query_per_second_per_region_per_code.py → core_spec_configurations.py} +22 -22
  60. beamlit/models/environment.py +33 -105
  61. beamlit/models/environment_metadata.py +146 -0
  62. beamlit/models/environment_spec.py +8 -6
  63. beamlit/models/function.py +34 -95
  64. beamlit/models/function_metadata.py +5 -3
  65. beamlit/models/function_spec.py +53 -40
  66. beamlit/models/integration_connection.py +31 -137
  67. beamlit/models/integration_connection_spec.py +6 -4
  68. beamlit/models/metadata.py +5 -3
  69. beamlit/models/metadata_labels.py +4 -2
  70. beamlit/models/model.py +33 -94
  71. beamlit/models/model_metadata.py +5 -3
  72. beamlit/models/{function_provider_ref.py → model_private_cluster.py} +23 -14
  73. beamlit/models/model_provider.py +27 -43
  74. beamlit/models/model_spec.py +45 -32
  75. beamlit/models/owner_fields.py +4 -2
  76. beamlit/models/pending_invitation.py +14 -14
  77. beamlit/models/pod_template_spec.py +4 -2
  78. beamlit/models/policy.py +33 -159
  79. beamlit/models/policy_spec.py +24 -28
  80. beamlit/models/private_cluster.py +183 -0
  81. beamlit/models/{model_provider_ref.py → private_location.py} +7 -16
  82. beamlit/models/resource_deployment_metrics.py +0 -108
  83. beamlit/models/resource_environment_metrics.py +143 -71
  84. beamlit/models/{resource_deployment_metrics_inference_per_region.py → resource_environment_metrics_inference_per_region.py} +5 -5
  85. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +9 -11
  86. beamlit/models/{resource_deployment_metrics_query_per_region_per_code.py → resource_environment_metrics_query_per_region_per_code.py} +5 -5
  87. beamlit/models/resource_environment_metrics_query_per_second_per_region_per_code.py +5 -3
  88. beamlit/models/resource_log.py +4 -2
  89. beamlit/models/runtime.py +20 -2
  90. beamlit/models/serverless_config.py +28 -21
  91. beamlit/models/spec_configuration.py +7 -5
  92. beamlit/models/store_agent.py +14 -14
  93. beamlit/models/store_function.py +14 -14
  94. beamlit/models/time_fields.py +4 -2
  95. beamlit/models/websocket_channel.py +4 -2
  96. beamlit/models/workspace.py +23 -14
  97. beamlit/run.py +0 -1
  98. beamlit/serve/app.py +1 -0
  99. beamlit/serve/middlewares/accesslog.py +3 -1
  100. {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/METADATA +1 -1
  101. beamlit-0.0.24rc21.dist-info/RECORD +243 -0
  102. beamlit/api/agents/delete_agent_deployment.py +0 -163
  103. beamlit/api/agents/delete_agent_deployment_history.py +0 -172
  104. beamlit/api/agents/get_agent_deployment_history.py +0 -172
  105. beamlit/api/agents/get_agent_deployment_logs.py +0 -164
  106. beamlit/api/agents/list_agent_deployment_history.py +0 -164
  107. beamlit/api/agents/put_agent_deployment.py +0 -185
  108. beamlit/api/agents/put_agent_deployment_history.py +0 -198
  109. beamlit/api/functions/delete_function_deployment.py +0 -163
  110. beamlit/api/functions/get_function_deployment.py +0 -163
  111. beamlit/api/functions/get_function_deployment_logs.py +0 -164
  112. beamlit/api/functions/get_function_deployment_metrics.py +0 -159
  113. beamlit/api/functions/put_function_deployment.py +0 -185
  114. beamlit/api/models/delete_model_deployment.py +0 -171
  115. beamlit/api/models/get_model_deployment.py +0 -171
  116. beamlit/api/models/get_model_deployment_logs.py +0 -168
  117. beamlit/api/models/get_model_deployment_metrics.py +0 -163
  118. beamlit/api/models/put_model_deployment.py +0 -193
  119. beamlit/models/agent_configuration.py +0 -70
  120. beamlit/models/agent_deployment.py +0 -340
  121. beamlit/models/agent_deployment_configuration.py +0 -45
  122. beamlit/models/agent_deployment_configuration_type_0.py +0 -43
  123. beamlit/models/agent_deployment_history.py +0 -185
  124. beamlit/models/agent_deployment_history_event.py +0 -133
  125. beamlit/models/agent_deployment_pod_template.py +0 -45
  126. beamlit/models/agent_deployment_pod_template_type_0.py +0 -43
  127. beamlit/models/agent_with_deployments.py +0 -176
  128. beamlit/models/authentication_provider_model.py +0 -144
  129. beamlit/models/authentication_provider_organization.py +0 -88
  130. beamlit/models/deployment_configuration.py +0 -70
  131. beamlit/models/deployment_configurations.py +0 -58
  132. beamlit/models/deployment_serverless_config.py +0 -131
  133. beamlit/models/deployment_serverless_config_type_0.py +0 -220
  134. beamlit/models/function_configuration.py +0 -70
  135. beamlit/models/function_deployment.py +0 -340
  136. beamlit/models/function_deployment_configuration.py +0 -45
  137. beamlit/models/function_deployment_configuration_type_0.py +0 -43
  138. beamlit/models/function_deployment_pod_template.py +0 -45
  139. beamlit/models/function_deployment_pod_template_type_0.py +0 -43
  140. beamlit/models/function_with_deployments.py +0 -176
  141. beamlit/models/integration.py +0 -198
  142. beamlit/models/integration_config.py +0 -45
  143. beamlit/models/integration_secret.py +0 -61
  144. beamlit/models/labels_type_0.py +0 -45
  145. beamlit/models/location.py +0 -122
  146. beamlit/models/model_deployment.py +0 -296
  147. beamlit/models/model_deployment_log.py +0 -70
  148. beamlit/models/model_deployment_metrics.py +0 -172
  149. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +0 -77
  150. beamlit/models/model_deployment_pod_template.py +0 -45
  151. beamlit/models/model_deployment_pod_template_type_0.py +0 -43
  152. beamlit/models/model_metrics.py +0 -96
  153. beamlit/models/model_with_deployments.py +0 -176
  154. beamlit/models/resource_deployment_log.py +0 -70
  155. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +0 -79
  156. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +0 -79
  157. beamlit/models/resource_deployment_metrics_query_per_region_per_code_type_0.py +0 -73
  158. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code_type_0.py +0 -73
  159. beamlit/models/runtime_readiness_probe_type_0.py +0 -43
  160. beamlit/models/runtime_type_0.py +0 -111
  161. beamlit/models/runtime_type_0_readiness_probe.py +0 -43
  162. beamlit/models/runtime_type_0_readiness_probe_type_0.py +0 -43
  163. beamlit/models/runtime_type_0_resources.py +0 -59
  164. beamlit/models/standard_fields_dynamo_db.py +0 -88
  165. beamlit/models/store_agent_configuration.py +0 -97
  166. beamlit/models/store_agent_labels_type_0.py +0 -43
  167. beamlit/models/store_function_configuration.py +0 -97
  168. beamlit/models/store_function_labels_type_0.py +0 -43
  169. beamlit-0.0.24rc19.dist-info/RECORD +0 -303
  170. {beamlit-0.0.24rc19.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -1,159 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.resource_deployment_metrics import ResourceDeploymentMetrics
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- function_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
16
- _kwargs: dict[str, Any] = {
17
- "method": "get",
18
- "url": f"/functions/{function_name}/deployments/{environment_name}/metrics",
19
- }
20
-
21
- return _kwargs
22
-
23
-
24
- def _parse_response(
25
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[ResourceDeploymentMetrics]:
27
- if response.status_code == 200:
28
- response_200 = ResourceDeploymentMetrics.from_dict(response.json())
29
-
30
- return response_200
31
- if client.raise_on_unexpected_status:
32
- raise errors.UnexpectedStatus(response.status_code, response.content)
33
- else:
34
- return None
35
-
36
-
37
- def _build_response(
38
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[ResourceDeploymentMetrics]:
40
- return Response(
41
- status_code=HTTPStatus(response.status_code),
42
- content=response.content,
43
- headers=response.headers,
44
- parsed=_parse_response(client=client, response=response),
45
- )
46
-
47
-
48
- def sync_detailed(
49
- function_name: str,
50
- environment_name: str,
51
- *,
52
- client: AuthenticatedClient,
53
- ) -> Response[ResourceDeploymentMetrics]:
54
- """
55
- Args:
56
- function_name (str):
57
- environment_name (str):
58
-
59
- Raises:
60
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
61
- httpx.TimeoutException: If the request takes longer than Client.timeout.
62
-
63
- Returns:
64
- Response[ResourceDeploymentMetrics]
65
- """
66
-
67
- kwargs = _get_kwargs(
68
- function_name=function_name,
69
- environment_name=environment_name,
70
- )
71
-
72
- response = client.get_httpx_client().request(
73
- **kwargs,
74
- )
75
-
76
- return _build_response(client=client, response=response)
77
-
78
-
79
- def sync(
80
- function_name: str,
81
- environment_name: str,
82
- *,
83
- client: AuthenticatedClient,
84
- ) -> Optional[ResourceDeploymentMetrics]:
85
- """
86
- Args:
87
- function_name (str):
88
- environment_name (str):
89
-
90
- Raises:
91
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
- httpx.TimeoutException: If the request takes longer than Client.timeout.
93
-
94
- Returns:
95
- ResourceDeploymentMetrics
96
- """
97
-
98
- return sync_detailed(
99
- function_name=function_name,
100
- environment_name=environment_name,
101
- client=client,
102
- ).parsed
103
-
104
-
105
- async def asyncio_detailed(
106
- function_name: str,
107
- environment_name: str,
108
- *,
109
- client: AuthenticatedClient,
110
- ) -> Response[ResourceDeploymentMetrics]:
111
- """
112
- Args:
113
- function_name (str):
114
- environment_name (str):
115
-
116
- Raises:
117
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
118
- httpx.TimeoutException: If the request takes longer than Client.timeout.
119
-
120
- Returns:
121
- Response[ResourceDeploymentMetrics]
122
- """
123
-
124
- kwargs = _get_kwargs(
125
- function_name=function_name,
126
- environment_name=environment_name,
127
- )
128
-
129
- response = await client.get_async_httpx_client().request(**kwargs)
130
-
131
- return _build_response(client=client, response=response)
132
-
133
-
134
- async def asyncio(
135
- function_name: str,
136
- environment_name: str,
137
- *,
138
- client: AuthenticatedClient,
139
- ) -> Optional[ResourceDeploymentMetrics]:
140
- """
141
- Args:
142
- function_name (str):
143
- environment_name (str):
144
-
145
- Raises:
146
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
147
- httpx.TimeoutException: If the request takes longer than Client.timeout.
148
-
149
- Returns:
150
- ResourceDeploymentMetrics
151
- """
152
-
153
- return (
154
- await asyncio_detailed(
155
- function_name=function_name,
156
- environment_name=environment_name,
157
- client=client,
158
- )
159
- ).parsed
@@ -1,185 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.function_deployment import FunctionDeployment
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- function_name: str,
14
- environment_name: str,
15
- *,
16
- body: FunctionDeployment,
17
- ) -> dict[str, Any]:
18
- headers: dict[str, Any] = {}
19
-
20
- _kwargs: dict[str, Any] = {
21
- "method": "put",
22
- "url": f"/functions/{function_name}/deployments/{environment_name}",
23
- }
24
-
25
- _body = body.to_dict()
26
-
27
- _kwargs["json"] = _body
28
- headers["Content-Type"] = "application/json"
29
-
30
- _kwargs["headers"] = headers
31
- return _kwargs
32
-
33
-
34
- def _parse_response(
35
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
- ) -> Optional[FunctionDeployment]:
37
- if response.status_code == 200:
38
- response_200 = FunctionDeployment.from_dict(response.json())
39
-
40
- return response_200
41
- if client.raise_on_unexpected_status:
42
- raise errors.UnexpectedStatus(response.status_code, response.content)
43
- else:
44
- return None
45
-
46
-
47
- def _build_response(
48
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
49
- ) -> Response[FunctionDeployment]:
50
- return Response(
51
- status_code=HTTPStatus(response.status_code),
52
- content=response.content,
53
- headers=response.headers,
54
- parsed=_parse_response(client=client, response=response),
55
- )
56
-
57
-
58
- def sync_detailed(
59
- function_name: str,
60
- environment_name: str,
61
- *,
62
- client: AuthenticatedClient,
63
- body: FunctionDeployment,
64
- ) -> Response[FunctionDeployment]:
65
- """Create or update function deployment by environment name
66
-
67
- Args:
68
- function_name (str):
69
- environment_name (str):
70
- body (FunctionDeployment): Function deployment configuration
71
-
72
- Raises:
73
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
74
- httpx.TimeoutException: If the request takes longer than Client.timeout.
75
-
76
- Returns:
77
- Response[FunctionDeployment]
78
- """
79
-
80
- kwargs = _get_kwargs(
81
- function_name=function_name,
82
- environment_name=environment_name,
83
- body=body,
84
- )
85
-
86
- response = client.get_httpx_client().request(
87
- **kwargs,
88
- )
89
-
90
- return _build_response(client=client, response=response)
91
-
92
-
93
- def sync(
94
- function_name: str,
95
- environment_name: str,
96
- *,
97
- client: AuthenticatedClient,
98
- body: FunctionDeployment,
99
- ) -> Optional[FunctionDeployment]:
100
- """Create or update function deployment by environment name
101
-
102
- Args:
103
- function_name (str):
104
- environment_name (str):
105
- body (FunctionDeployment): Function deployment configuration
106
-
107
- Raises:
108
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
109
- httpx.TimeoutException: If the request takes longer than Client.timeout.
110
-
111
- Returns:
112
- FunctionDeployment
113
- """
114
-
115
- return sync_detailed(
116
- function_name=function_name,
117
- environment_name=environment_name,
118
- client=client,
119
- body=body,
120
- ).parsed
121
-
122
-
123
- async def asyncio_detailed(
124
- function_name: str,
125
- environment_name: str,
126
- *,
127
- client: AuthenticatedClient,
128
- body: FunctionDeployment,
129
- ) -> Response[FunctionDeployment]:
130
- """Create or update function deployment by environment name
131
-
132
- Args:
133
- function_name (str):
134
- environment_name (str):
135
- body (FunctionDeployment): Function deployment configuration
136
-
137
- Raises:
138
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
139
- httpx.TimeoutException: If the request takes longer than Client.timeout.
140
-
141
- Returns:
142
- Response[FunctionDeployment]
143
- """
144
-
145
- kwargs = _get_kwargs(
146
- function_name=function_name,
147
- environment_name=environment_name,
148
- body=body,
149
- )
150
-
151
- response = await client.get_async_httpx_client().request(**kwargs)
152
-
153
- return _build_response(client=client, response=response)
154
-
155
-
156
- async def asyncio(
157
- function_name: str,
158
- environment_name: str,
159
- *,
160
- client: AuthenticatedClient,
161
- body: FunctionDeployment,
162
- ) -> Optional[FunctionDeployment]:
163
- """Create or update function deployment by environment name
164
-
165
- Args:
166
- function_name (str):
167
- environment_name (str):
168
- body (FunctionDeployment): Function deployment configuration
169
-
170
- Raises:
171
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
172
- httpx.TimeoutException: If the request takes longer than Client.timeout.
173
-
174
- Returns:
175
- FunctionDeployment
176
- """
177
-
178
- return (
179
- await asyncio_detailed(
180
- function_name=function_name,
181
- environment_name=environment_name,
182
- client=client,
183
- body=body,
184
- )
185
- ).parsed
@@ -1,171 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.model_deployment import ModelDeployment
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- model_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
16
- _kwargs: dict[str, Any] = {
17
- "method": "delete",
18
- "url": f"/models/{model_name}/deployments/{environment_name}",
19
- }
20
-
21
- return _kwargs
22
-
23
-
24
- def _parse_response(
25
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[ModelDeployment]:
27
- if response.status_code == 200:
28
- response_200 = ModelDeployment.from_dict(response.json())
29
-
30
- return response_200
31
- if client.raise_on_unexpected_status:
32
- raise errors.UnexpectedStatus(response.status_code, response.content)
33
- else:
34
- return None
35
-
36
-
37
- def _build_response(
38
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[ModelDeployment]:
40
- return Response(
41
- status_code=HTTPStatus(response.status_code),
42
- content=response.content,
43
- headers=response.headers,
44
- parsed=_parse_response(client=client, response=response),
45
- )
46
-
47
-
48
- def sync_detailed(
49
- model_name: str,
50
- environment_name: str,
51
- *,
52
- client: AuthenticatedClient,
53
- ) -> Response[ModelDeployment]:
54
- """Delete model deployment
55
-
56
- Deletes a deployment for a model by name.
57
-
58
- Args:
59
- model_name (str):
60
- environment_name (str):
61
-
62
- Raises:
63
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
- httpx.TimeoutException: If the request takes longer than Client.timeout.
65
-
66
- Returns:
67
- Response[ModelDeployment]
68
- """
69
-
70
- kwargs = _get_kwargs(
71
- model_name=model_name,
72
- environment_name=environment_name,
73
- )
74
-
75
- response = client.get_httpx_client().request(
76
- **kwargs,
77
- )
78
-
79
- return _build_response(client=client, response=response)
80
-
81
-
82
- def sync(
83
- model_name: str,
84
- environment_name: str,
85
- *,
86
- client: AuthenticatedClient,
87
- ) -> Optional[ModelDeployment]:
88
- """Delete model deployment
89
-
90
- Deletes a deployment for a model by name.
91
-
92
- Args:
93
- model_name (str):
94
- environment_name (str):
95
-
96
- Raises:
97
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
- httpx.TimeoutException: If the request takes longer than Client.timeout.
99
-
100
- Returns:
101
- ModelDeployment
102
- """
103
-
104
- return sync_detailed(
105
- model_name=model_name,
106
- environment_name=environment_name,
107
- client=client,
108
- ).parsed
109
-
110
-
111
- async def asyncio_detailed(
112
- model_name: str,
113
- environment_name: str,
114
- *,
115
- client: AuthenticatedClient,
116
- ) -> Response[ModelDeployment]:
117
- """Delete model deployment
118
-
119
- Deletes a deployment for a model by name.
120
-
121
- Args:
122
- model_name (str):
123
- environment_name (str):
124
-
125
- Raises:
126
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
127
- httpx.TimeoutException: If the request takes longer than Client.timeout.
128
-
129
- Returns:
130
- Response[ModelDeployment]
131
- """
132
-
133
- kwargs = _get_kwargs(
134
- model_name=model_name,
135
- environment_name=environment_name,
136
- )
137
-
138
- response = await client.get_async_httpx_client().request(**kwargs)
139
-
140
- return _build_response(client=client, response=response)
141
-
142
-
143
- async def asyncio(
144
- model_name: str,
145
- environment_name: str,
146
- *,
147
- client: AuthenticatedClient,
148
- ) -> Optional[ModelDeployment]:
149
- """Delete model deployment
150
-
151
- Deletes a deployment for a model by name.
152
-
153
- Args:
154
- model_name (str):
155
- environment_name (str):
156
-
157
- Raises:
158
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
- httpx.TimeoutException: If the request takes longer than Client.timeout.
160
-
161
- Returns:
162
- ModelDeployment
163
- """
164
-
165
- return (
166
- await asyncio_detailed(
167
- model_name=model_name,
168
- environment_name=environment_name,
169
- client=client,
170
- )
171
- ).parsed
@@ -1,171 +0,0 @@
1
- from http import HTTPStatus
2
- from typing import Any, Optional, Union
3
-
4
- import httpx
5
-
6
- from ... import errors
7
- from ...client import AuthenticatedClient, Client
8
- from ...models.model_deployment import ModelDeployment
9
- from ...types import Response
10
-
11
-
12
- def _get_kwargs(
13
- model_name: str,
14
- environment_name: str,
15
- ) -> dict[str, Any]:
16
- _kwargs: dict[str, Any] = {
17
- "method": "get",
18
- "url": f"/models/{model_name}/deployments/{environment_name}",
19
- }
20
-
21
- return _kwargs
22
-
23
-
24
- def _parse_response(
25
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[ModelDeployment]:
27
- if response.status_code == 200:
28
- response_200 = ModelDeployment.from_dict(response.json())
29
-
30
- return response_200
31
- if client.raise_on_unexpected_status:
32
- raise errors.UnexpectedStatus(response.status_code, response.content)
33
- else:
34
- return None
35
-
36
-
37
- def _build_response(
38
- *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
- ) -> Response[ModelDeployment]:
40
- return Response(
41
- status_code=HTTPStatus(response.status_code),
42
- content=response.content,
43
- headers=response.headers,
44
- parsed=_parse_response(client=client, response=response),
45
- )
46
-
47
-
48
- def sync_detailed(
49
- model_name: str,
50
- environment_name: str,
51
- *,
52
- client: AuthenticatedClient,
53
- ) -> Response[ModelDeployment]:
54
- """Get model deployment
55
-
56
- Returns a deployment for a model by name.
57
-
58
- Args:
59
- model_name (str):
60
- environment_name (str):
61
-
62
- Raises:
63
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
64
- httpx.TimeoutException: If the request takes longer than Client.timeout.
65
-
66
- Returns:
67
- Response[ModelDeployment]
68
- """
69
-
70
- kwargs = _get_kwargs(
71
- model_name=model_name,
72
- environment_name=environment_name,
73
- )
74
-
75
- response = client.get_httpx_client().request(
76
- **kwargs,
77
- )
78
-
79
- return _build_response(client=client, response=response)
80
-
81
-
82
- def sync(
83
- model_name: str,
84
- environment_name: str,
85
- *,
86
- client: AuthenticatedClient,
87
- ) -> Optional[ModelDeployment]:
88
- """Get model deployment
89
-
90
- Returns a deployment for a model by name.
91
-
92
- Args:
93
- model_name (str):
94
- environment_name (str):
95
-
96
- Raises:
97
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
98
- httpx.TimeoutException: If the request takes longer than Client.timeout.
99
-
100
- Returns:
101
- ModelDeployment
102
- """
103
-
104
- return sync_detailed(
105
- model_name=model_name,
106
- environment_name=environment_name,
107
- client=client,
108
- ).parsed
109
-
110
-
111
- async def asyncio_detailed(
112
- model_name: str,
113
- environment_name: str,
114
- *,
115
- client: AuthenticatedClient,
116
- ) -> Response[ModelDeployment]:
117
- """Get model deployment
118
-
119
- Returns a deployment for a model by name.
120
-
121
- Args:
122
- model_name (str):
123
- environment_name (str):
124
-
125
- Raises:
126
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
127
- httpx.TimeoutException: If the request takes longer than Client.timeout.
128
-
129
- Returns:
130
- Response[ModelDeployment]
131
- """
132
-
133
- kwargs = _get_kwargs(
134
- model_name=model_name,
135
- environment_name=environment_name,
136
- )
137
-
138
- response = await client.get_async_httpx_client().request(**kwargs)
139
-
140
- return _build_response(client=client, response=response)
141
-
142
-
143
- async def asyncio(
144
- model_name: str,
145
- environment_name: str,
146
- *,
147
- client: AuthenticatedClient,
148
- ) -> Optional[ModelDeployment]:
149
- """Get model deployment
150
-
151
- Returns a deployment for a model by name.
152
-
153
- Args:
154
- model_name (str):
155
- environment_name (str):
156
-
157
- Raises:
158
- errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
- httpx.TimeoutException: If the request takes longer than Client.timeout.
160
-
161
- Returns:
162
- ModelDeployment
163
- """
164
-
165
- return (
166
- await asyncio_detailed(
167
- model_name=model_name,
168
- environment_name=environment_name,
169
- client=client,
170
- )
171
- ).parsed