beamlit 0.0.24rc20__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 +8 -11
  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.24rc20.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.24rc20.dist-info/RECORD +0 -303
  170. {beamlit-0.0.24rc20.dist-info → beamlit-0.0.24rc21.dist-info}/WHEEL +0 -0
@@ -6,15 +6,24 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.model import Model
9
- from ...types import Response
9
+ from ...types import UNSET, Response
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
13
  model_name: str,
14
+ *,
15
+ environment: str,
14
16
  ) -> dict[str, Any]:
17
+ params: dict[str, Any] = {}
18
+
19
+ params["environment"] = environment
20
+
21
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
22
+
15
23
  _kwargs: dict[str, Any] = {
16
24
  "method": "delete",
17
25
  "url": f"/models/{model_name}",
26
+ "params": params,
18
27
  }
19
28
 
20
29
  return _kwargs
@@ -44,6 +53,7 @@ def sync_detailed(
44
53
  model_name: str,
45
54
  *,
46
55
  client: AuthenticatedClient,
56
+ environment: str,
47
57
  ) -> Response[Model]:
48
58
  """Delete model
49
59
 
@@ -51,6 +61,7 @@ def sync_detailed(
51
61
 
52
62
  Args:
53
63
  model_name (str):
64
+ environment (str):
54
65
 
55
66
  Raises:
56
67
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -62,6 +73,7 @@ def sync_detailed(
62
73
 
63
74
  kwargs = _get_kwargs(
64
75
  model_name=model_name,
76
+ environment=environment,
65
77
  )
66
78
 
67
79
  response = client.get_httpx_client().request(
@@ -75,6 +87,7 @@ def sync(
75
87
  model_name: str,
76
88
  *,
77
89
  client: AuthenticatedClient,
90
+ environment: str,
78
91
  ) -> Optional[Model]:
79
92
  """Delete model
80
93
 
@@ -82,6 +95,7 @@ def sync(
82
95
 
83
96
  Args:
84
97
  model_name (str):
98
+ environment (str):
85
99
 
86
100
  Raises:
87
101
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -94,6 +108,7 @@ def sync(
94
108
  return sync_detailed(
95
109
  model_name=model_name,
96
110
  client=client,
111
+ environment=environment,
97
112
  ).parsed
98
113
 
99
114
 
@@ -101,6 +116,7 @@ async def asyncio_detailed(
101
116
  model_name: str,
102
117
  *,
103
118
  client: AuthenticatedClient,
119
+ environment: str,
104
120
  ) -> Response[Model]:
105
121
  """Delete model
106
122
 
@@ -108,6 +124,7 @@ async def asyncio_detailed(
108
124
 
109
125
  Args:
110
126
  model_name (str):
127
+ environment (str):
111
128
 
112
129
  Raises:
113
130
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -119,6 +136,7 @@ async def asyncio_detailed(
119
136
 
120
137
  kwargs = _get_kwargs(
121
138
  model_name=model_name,
139
+ environment=environment,
122
140
  )
123
141
 
124
142
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -130,6 +148,7 @@ async def asyncio(
130
148
  model_name: str,
131
149
  *,
132
150
  client: AuthenticatedClient,
151
+ environment: str,
133
152
  ) -> Optional[Model]:
134
153
  """Delete model
135
154
 
@@ -137,6 +156,7 @@ async def asyncio(
137
156
 
138
157
  Args:
139
158
  model_name (str):
159
+ environment (str):
140
160
 
141
161
  Raises:
142
162
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -150,5 +170,6 @@ async def asyncio(
150
170
  await asyncio_detailed(
151
171
  model_name=model_name,
152
172
  client=client,
173
+ environment=environment,
153
174
  )
154
175
  ).parsed
@@ -6,15 +6,24 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.model import Model
9
- from ...types import Response
9
+ from ...types import UNSET, Response, Unset
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
13
  model_name: str,
14
+ *,
15
+ environment: Union[Unset, str] = UNSET,
14
16
  ) -> dict[str, Any]:
17
+ params: dict[str, Any] = {}
18
+
19
+ params["environment"] = environment
20
+
21
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
22
+
15
23
  _kwargs: dict[str, Any] = {
16
24
  "method": "get",
17
25
  "url": f"/models/{model_name}",
26
+ "params": params,
18
27
  }
19
28
 
20
29
  return _kwargs
@@ -44,6 +53,7 @@ def sync_detailed(
44
53
  model_name: str,
45
54
  *,
46
55
  client: AuthenticatedClient,
56
+ environment: Union[Unset, str] = UNSET,
47
57
  ) -> Response[Model]:
48
58
  """Get model
49
59
 
@@ -51,6 +61,7 @@ def sync_detailed(
51
61
 
52
62
  Args:
53
63
  model_name (str):
64
+ environment (Union[Unset, str]):
54
65
 
55
66
  Raises:
56
67
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -62,6 +73,7 @@ def sync_detailed(
62
73
 
63
74
  kwargs = _get_kwargs(
64
75
  model_name=model_name,
76
+ environment=environment,
65
77
  )
66
78
 
67
79
  response = client.get_httpx_client().request(
@@ -75,6 +87,7 @@ def sync(
75
87
  model_name: str,
76
88
  *,
77
89
  client: AuthenticatedClient,
90
+ environment: Union[Unset, str] = UNSET,
78
91
  ) -> Optional[Model]:
79
92
  """Get model
80
93
 
@@ -82,6 +95,7 @@ def sync(
82
95
 
83
96
  Args:
84
97
  model_name (str):
98
+ environment (Union[Unset, str]):
85
99
 
86
100
  Raises:
87
101
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -94,6 +108,7 @@ def sync(
94
108
  return sync_detailed(
95
109
  model_name=model_name,
96
110
  client=client,
111
+ environment=environment,
97
112
  ).parsed
98
113
 
99
114
 
@@ -101,6 +116,7 @@ async def asyncio_detailed(
101
116
  model_name: str,
102
117
  *,
103
118
  client: AuthenticatedClient,
119
+ environment: Union[Unset, str] = UNSET,
104
120
  ) -> Response[Model]:
105
121
  """Get model
106
122
 
@@ -108,6 +124,7 @@ async def asyncio_detailed(
108
124
 
109
125
  Args:
110
126
  model_name (str):
127
+ environment (Union[Unset, str]):
111
128
 
112
129
  Raises:
113
130
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -119,6 +136,7 @@ async def asyncio_detailed(
119
136
 
120
137
  kwargs = _get_kwargs(
121
138
  model_name=model_name,
139
+ environment=environment,
122
140
  )
123
141
 
124
142
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -130,6 +148,7 @@ async def asyncio(
130
148
  model_name: str,
131
149
  *,
132
150
  client: AuthenticatedClient,
151
+ environment: Union[Unset, str] = UNSET,
133
152
  ) -> Optional[Model]:
134
153
  """Get model
135
154
 
@@ -137,6 +156,7 @@ async def asyncio(
137
156
 
138
157
  Args:
139
158
  model_name (str):
159
+ environment (Union[Unset, str]):
140
160
 
141
161
  Raises:
142
162
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -150,5 +170,6 @@ async def asyncio(
150
170
  await asyncio_detailed(
151
171
  model_name=model_name,
152
172
  client=client,
173
+ environment=environment,
153
174
  )
154
175
  ).parsed
@@ -1,5 +1,5 @@
1
1
  from http import HTTPStatus
2
- from typing import Any, List, Optional, Union
2
+ from typing import Any, Optional, Union
3
3
 
4
4
  import httpx
5
5
 
@@ -22,7 +22,7 @@ def _get_kwargs(
22
22
 
23
23
  def _parse_response(
24
24
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
25
- ) -> Optional[List["ResourceLog"]]:
25
+ ) -> Optional[list["ResourceLog"]]:
26
26
  if response.status_code == 200:
27
27
  response_200 = []
28
28
  _response_200 = response.json()
@@ -40,7 +40,7 @@ def _parse_response(
40
40
 
41
41
  def _build_response(
42
42
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
43
- ) -> Response[List["ResourceLog"]]:
43
+ ) -> Response[list["ResourceLog"]]:
44
44
  return Response(
45
45
  status_code=HTTPStatus(response.status_code),
46
46
  content=response.content,
@@ -53,7 +53,7 @@ def sync_detailed(
53
53
  model_name: str,
54
54
  *,
55
55
  client: AuthenticatedClient,
56
- ) -> Response[List["ResourceLog"]]:
56
+ ) -> Response[list["ResourceLog"]]:
57
57
  """Returns logs for a model deployment by name.
58
58
 
59
59
  Args:
@@ -64,7 +64,7 @@ def sync_detailed(
64
64
  httpx.TimeoutException: If the request takes longer than Client.timeout.
65
65
 
66
66
  Returns:
67
- Response[List['ResourceLog']]
67
+ Response[list['ResourceLog']]
68
68
  """
69
69
 
70
70
  kwargs = _get_kwargs(
@@ -82,7 +82,7 @@ def sync(
82
82
  model_name: str,
83
83
  *,
84
84
  client: AuthenticatedClient,
85
- ) -> Optional[List["ResourceLog"]]:
85
+ ) -> Optional[list["ResourceLog"]]:
86
86
  """Returns logs for a model deployment by name.
87
87
 
88
88
  Args:
@@ -93,7 +93,7 @@ def sync(
93
93
  httpx.TimeoutException: If the request takes longer than Client.timeout.
94
94
 
95
95
  Returns:
96
- List['ResourceLog']
96
+ list['ResourceLog']
97
97
  """
98
98
 
99
99
  return sync_detailed(
@@ -106,7 +106,7 @@ async def asyncio_detailed(
106
106
  model_name: str,
107
107
  *,
108
108
  client: AuthenticatedClient,
109
- ) -> Response[List["ResourceLog"]]:
109
+ ) -> Response[list["ResourceLog"]]:
110
110
  """Returns logs for a model deployment by name.
111
111
 
112
112
  Args:
@@ -117,7 +117,7 @@ async def asyncio_detailed(
117
117
  httpx.TimeoutException: If the request takes longer than Client.timeout.
118
118
 
119
119
  Returns:
120
- Response[List['ResourceLog']]
120
+ Response[list['ResourceLog']]
121
121
  """
122
122
 
123
123
  kwargs = _get_kwargs(
@@ -133,7 +133,7 @@ async def asyncio(
133
133
  model_name: str,
134
134
  *,
135
135
  client: AuthenticatedClient,
136
- ) -> Optional[List["ResourceLog"]]:
136
+ ) -> Optional[list["ResourceLog"]]:
137
137
  """Returns logs for a model deployment by name.
138
138
 
139
139
  Args:
@@ -144,7 +144,7 @@ async def asyncio(
144
144
  httpx.TimeoutException: If the request takes longer than Client.timeout.
145
145
 
146
146
  Returns:
147
- List['ResourceLog']
147
+ list['ResourceLog']
148
148
  """
149
149
 
150
150
  return (
@@ -5,24 +5,35 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.model_metrics import ModelMetrics
9
- from ...types import Response
8
+ from ...models.resource_metrics import ResourceMetrics
9
+ from ...types import UNSET, Response, Unset
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
13
  model_name: str,
14
+ *,
15
+ environment: Union[Unset, str] = UNSET,
14
16
  ) -> dict[str, Any]:
17
+ params: dict[str, Any] = {}
18
+
19
+ params["environment"] = environment
20
+
21
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
22
+
15
23
  _kwargs: dict[str, Any] = {
16
24
  "method": "get",
17
25
  "url": f"/models/{model_name}/metrics",
26
+ "params": params,
18
27
  }
19
28
 
20
29
  return _kwargs
21
30
 
22
31
 
23
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[ModelMetrics]:
32
+ def _parse_response(
33
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
+ ) -> Optional[ResourceMetrics]:
24
35
  if response.status_code == 200:
25
- response_200 = ModelMetrics.from_dict(response.json())
36
+ response_200 = ResourceMetrics.from_dict(response.json())
26
37
 
27
38
  return response_200
28
39
  if client.raise_on_unexpected_status:
@@ -31,7 +42,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
31
42
  return None
32
43
 
33
44
 
34
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[ModelMetrics]:
45
+ def _build_response(
46
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
47
+ ) -> Response[ResourceMetrics]:
35
48
  return Response(
36
49
  status_code=HTTPStatus(response.status_code),
37
50
  content=response.content,
@@ -44,24 +57,27 @@ def sync_detailed(
44
57
  model_name: str,
45
58
  *,
46
59
  client: AuthenticatedClient,
47
- ) -> Response[ModelMetrics]:
60
+ environment: Union[Unset, str] = UNSET,
61
+ ) -> Response[ResourceMetrics]:
48
62
  """Get model metrics
49
63
 
50
64
  Returns metrics for a model by name.
51
65
 
52
66
  Args:
53
67
  model_name (str):
68
+ environment (Union[Unset, str]):
54
69
 
55
70
  Raises:
56
71
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
57
72
  httpx.TimeoutException: If the request takes longer than Client.timeout.
58
73
 
59
74
  Returns:
60
- Response[ModelMetrics]
75
+ Response[ResourceMetrics]
61
76
  """
62
77
 
63
78
  kwargs = _get_kwargs(
64
79
  model_name=model_name,
80
+ environment=environment,
65
81
  )
66
82
 
67
83
  response = client.get_httpx_client().request(
@@ -75,25 +91,28 @@ def sync(
75
91
  model_name: str,
76
92
  *,
77
93
  client: AuthenticatedClient,
78
- ) -> Optional[ModelMetrics]:
94
+ environment: Union[Unset, str] = UNSET,
95
+ ) -> Optional[ResourceMetrics]:
79
96
  """Get model metrics
80
97
 
81
98
  Returns metrics for a model by name.
82
99
 
83
100
  Args:
84
101
  model_name (str):
102
+ environment (Union[Unset, str]):
85
103
 
86
104
  Raises:
87
105
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
88
106
  httpx.TimeoutException: If the request takes longer than Client.timeout.
89
107
 
90
108
  Returns:
91
- ModelMetrics
109
+ ResourceMetrics
92
110
  """
93
111
 
94
112
  return sync_detailed(
95
113
  model_name=model_name,
96
114
  client=client,
115
+ environment=environment,
97
116
  ).parsed
98
117
 
99
118
 
@@ -101,24 +120,27 @@ async def asyncio_detailed(
101
120
  model_name: str,
102
121
  *,
103
122
  client: AuthenticatedClient,
104
- ) -> Response[ModelMetrics]:
123
+ environment: Union[Unset, str] = UNSET,
124
+ ) -> Response[ResourceMetrics]:
105
125
  """Get model metrics
106
126
 
107
127
  Returns metrics for a model by name.
108
128
 
109
129
  Args:
110
130
  model_name (str):
131
+ environment (Union[Unset, str]):
111
132
 
112
133
  Raises:
113
134
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
135
  httpx.TimeoutException: If the request takes longer than Client.timeout.
115
136
 
116
137
  Returns:
117
- Response[ModelMetrics]
138
+ Response[ResourceMetrics]
118
139
  """
119
140
 
120
141
  kwargs = _get_kwargs(
121
142
  model_name=model_name,
143
+ environment=environment,
122
144
  )
123
145
 
124
146
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -130,25 +152,28 @@ async def asyncio(
130
152
  model_name: str,
131
153
  *,
132
154
  client: AuthenticatedClient,
133
- ) -> Optional[ModelMetrics]:
155
+ environment: Union[Unset, str] = UNSET,
156
+ ) -> Optional[ResourceMetrics]:
134
157
  """Get model metrics
135
158
 
136
159
  Returns metrics for a model by name.
137
160
 
138
161
  Args:
139
162
  model_name (str):
163
+ environment (Union[Unset, str]):
140
164
 
141
165
  Raises:
142
166
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
167
  httpx.TimeoutException: If the request takes longer than Client.timeout.
144
168
 
145
169
  Returns:
146
- ModelMetrics
170
+ ResourceMetrics
147
171
  """
148
172
 
149
173
  return (
150
174
  await asyncio_detailed(
151
175
  model_name=model_name,
152
176
  client=client,
177
+ environment=environment,
153
178
  )
154
179
  ).parsed
@@ -6,13 +6,23 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.model import Model
9
- from ...types import Response
9
+ from ...types import UNSET, Response, Unset
10
10
 
11
11
 
12
- def _get_kwargs() -> dict[str, Any]:
12
+ def _get_kwargs(
13
+ *,
14
+ environment: Union[Unset, str] = UNSET,
15
+ ) -> dict[str, Any]:
16
+ params: dict[str, Any] = {}
17
+
18
+ params["environment"] = environment
19
+
20
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
21
+
13
22
  _kwargs: dict[str, Any] = {
14
23
  "method": "get",
15
24
  "url": "/models",
25
+ "params": params,
16
26
  }
17
27
 
18
28
  return _kwargs
@@ -46,11 +56,15 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt
46
56
  def sync_detailed(
47
57
  *,
48
58
  client: AuthenticatedClient,
59
+ environment: Union[Unset, str] = UNSET,
49
60
  ) -> Response[list["Model"]]:
50
61
  """List models
51
62
 
52
63
  Returns a list of all models in the workspace.
53
64
 
65
+ Args:
66
+ environment (Union[Unset, str]):
67
+
54
68
  Raises:
55
69
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
56
70
  httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -59,7 +73,9 @@ def sync_detailed(
59
73
  Response[list['Model']]
60
74
  """
61
75
 
62
- kwargs = _get_kwargs()
76
+ kwargs = _get_kwargs(
77
+ environment=environment,
78
+ )
63
79
 
64
80
  response = client.get_httpx_client().request(
65
81
  **kwargs,
@@ -71,11 +87,15 @@ def sync_detailed(
71
87
  def sync(
72
88
  *,
73
89
  client: AuthenticatedClient,
90
+ environment: Union[Unset, str] = UNSET,
74
91
  ) -> Optional[list["Model"]]:
75
92
  """List models
76
93
 
77
94
  Returns a list of all models in the workspace.
78
95
 
96
+ Args:
97
+ environment (Union[Unset, str]):
98
+
79
99
  Raises:
80
100
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
101
  httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -86,17 +106,22 @@ def sync(
86
106
 
87
107
  return sync_detailed(
88
108
  client=client,
109
+ environment=environment,
89
110
  ).parsed
90
111
 
91
112
 
92
113
  async def asyncio_detailed(
93
114
  *,
94
115
  client: AuthenticatedClient,
116
+ environment: Union[Unset, str] = UNSET,
95
117
  ) -> Response[list["Model"]]:
96
118
  """List models
97
119
 
98
120
  Returns a list of all models in the workspace.
99
121
 
122
+ Args:
123
+ environment (Union[Unset, str]):
124
+
100
125
  Raises:
101
126
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
102
127
  httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -105,7 +130,9 @@ async def asyncio_detailed(
105
130
  Response[list['Model']]
106
131
  """
107
132
 
108
- kwargs = _get_kwargs()
133
+ kwargs = _get_kwargs(
134
+ environment=environment,
135
+ )
109
136
 
110
137
  response = await client.get_async_httpx_client().request(**kwargs)
111
138
 
@@ -115,11 +142,15 @@ async def asyncio_detailed(
115
142
  async def asyncio(
116
143
  *,
117
144
  client: AuthenticatedClient,
145
+ environment: Union[Unset, str] = UNSET,
118
146
  ) -> Optional[list["Model"]]:
119
147
  """List models
120
148
 
121
149
  Returns a list of all models in the workspace.
122
150
 
151
+ Args:
152
+ environment (Union[Unset, str]):
153
+
123
154
  Raises:
124
155
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
125
156
  httpx.TimeoutException: If the request takes longer than Client.timeout.
@@ -131,5 +162,6 @@ async def asyncio(
131
162
  return (
132
163
  await asyncio_detailed(
133
164
  client=client,
165
+ environment=environment,
134
166
  )
135
167
  ).parsed