beamlit 0.0.20rc5__py3-none-any.whl → 0.0.20rc6__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. beamlit/agents/__init__.py +4 -0
  2. beamlit/agents/chat.py +87 -0
  3. beamlit/agents/decorator.py +129 -0
  4. beamlit/api/agents/delete_agent_history.py +6 -2
  5. beamlit/api/agents/get_agent_deployment_logs.py +11 -11
  6. beamlit/api/agents/get_agent_history.py +6 -2
  7. beamlit/api/agents/list_agent_deployment_history.py +11 -11
  8. beamlit/api/agents/list_agent_deployments.py +11 -11
  9. beamlit/api/agents/list_agents.py +11 -11
  10. beamlit/api/agents/put_agent_history.py +6 -2
  11. beamlit/api/environments/list_environments.py +11 -11
  12. beamlit/api/functions/get_function_deployment_logs.py +11 -11
  13. beamlit/api/functions/list_function_deployments.py +11 -11
  14. beamlit/api/functions/list_functions.py +11 -11
  15. beamlit/api/history/get_agents_history.py +11 -11
  16. beamlit/api/history/list_agents_history.py +11 -11
  17. beamlit/api/integrations/list_integration_connections.py +11 -11
  18. beamlit/api/invitations/list_all_pending_invitations.py +11 -11
  19. beamlit/api/locations/list_locations.py +11 -11
  20. beamlit/api/model_providers/list_model_providers.py +11 -11
  21. beamlit/api/models/get_model_deployment_logs.py +11 -11
  22. beamlit/api/models/list_model_deployments.py +11 -11
  23. beamlit/api/models/list_models.py +11 -11
  24. beamlit/api/policies/list_policies.py +11 -11
  25. beamlit/api/service_accounts/get_workspace_service_accounts.py +11 -11
  26. beamlit/api/service_accounts/list_api_keys_for_service_account.py +11 -11
  27. beamlit/api/store/list_store_agents.py +11 -11
  28. beamlit/api/store/list_store_functions.py +11 -11
  29. beamlit/api/workspaces/list_workspace_users.py +11 -11
  30. beamlit/api/workspaces/list_workspaces.py +11 -11
  31. beamlit/authentication/__init__.py +26 -10
  32. beamlit/authentication/apikey.py +4 -4
  33. beamlit/authentication/authentication.py +35 -6
  34. beamlit/authentication/clientcredentials.py +18 -20
  35. beamlit/authentication/credentials.py +9 -8
  36. beamlit/authentication/device_mode.py +15 -12
  37. beamlit/common/__init__.py +13 -0
  38. beamlit/common/generate.py +25 -13
  39. beamlit/common/logger.py +9 -12
  40. beamlit/common/secrets.py +11 -0
  41. beamlit/common/settings.py +29 -11
  42. beamlit/common/utils.py +4 -2
  43. beamlit/functions/__init__.py +5 -0
  44. beamlit/functions/decorator.py +90 -0
  45. beamlit/models/acl.py +2 -2
  46. beamlit/models/agent.py +3 -3
  47. beamlit/models/agent_chain.py +2 -2
  48. beamlit/models/agent_configuration.py +2 -2
  49. beamlit/models/agent_deployment.py +25 -25
  50. beamlit/models/agent_deployment_configuration.py +2 -2
  51. beamlit/models/agent_deployment_history.py +5 -5
  52. beamlit/models/agent_deployment_history_event.py +9 -9
  53. beamlit/models/agent_deployment_pod_template.py +2 -2
  54. beamlit/models/agent_release.py +2 -2
  55. beamlit/models/agent_spec.py +15 -5
  56. beamlit/models/agent_with_deployments.py +6 -6
  57. beamlit/models/api_key.py +2 -2
  58. beamlit/models/authentication_provider_model.py +6 -6
  59. beamlit/models/authentication_provider_organization.py +2 -2
  60. beamlit/models/configuration.py +10 -10
  61. beamlit/models/continent.py +2 -2
  62. beamlit/models/core_spec.py +9 -3
  63. beamlit/models/country.py +2 -2
  64. beamlit/models/create_api_key_for_service_account_body.py +2 -2
  65. beamlit/models/create_workspace_service_account_body.py +2 -2
  66. beamlit/models/create_workspace_service_account_response_200.py +2 -2
  67. beamlit/models/delete_workspace_service_account_response_200.py +2 -2
  68. beamlit/models/deployment_configuration.py +2 -2
  69. beamlit/models/deployment_configurations.py +2 -2
  70. beamlit/models/deployment_serverless_config.py +2 -2
  71. beamlit/models/deployment_serverless_config_type_0.py +3 -1
  72. beamlit/models/environment.py +7 -7
  73. beamlit/models/environment_metrics.py +8 -8
  74. beamlit/models/flavor.py +9 -9
  75. beamlit/models/function.py +3 -3
  76. beamlit/models/function_configuration.py +2 -2
  77. beamlit/models/function_deployment.py +24 -24
  78. beamlit/models/function_deployment_configuration.py +2 -2
  79. beamlit/models/function_deployment_pod_template.py +2 -2
  80. beamlit/models/function_kit.py +5 -5
  81. beamlit/models/function_provider_ref.py +2 -2
  82. beamlit/models/function_release.py +2 -2
  83. beamlit/models/function_spec.py +9 -3
  84. beamlit/models/function_with_deployments.py +6 -6
  85. beamlit/models/get_workspace_service_accounts_response_200_item.py +2 -2
  86. beamlit/models/increase_and_rate_metric.py +5 -5
  87. beamlit/models/integration.py +12 -12
  88. beamlit/models/integration_config.py +2 -2
  89. beamlit/models/integration_connection.py +5 -5
  90. beamlit/models/integration_connection_config.py +2 -2
  91. beamlit/models/integration_connection_secret.py +2 -2
  92. beamlit/models/integration_model.py +6 -6
  93. beamlit/models/integration_secret.py +2 -2
  94. beamlit/models/invite_workspace_user_body.py +2 -2
  95. beamlit/models/labels_type_0.py +2 -2
  96. beamlit/models/location.py +5 -5
  97. beamlit/models/location_response.py +5 -5
  98. beamlit/models/metric.py +2 -2
  99. beamlit/models/metrics.py +8 -8
  100. beamlit/models/model.py +3 -3
  101. beamlit/models/model_deployment.py +18 -18
  102. beamlit/models/model_deployment_log.py +2 -2
  103. beamlit/models/model_deployment_metrics.py +9 -9
  104. beamlit/models/model_deployment_metrics_inference_per_second_per_region.py +5 -5
  105. beamlit/models/model_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
  106. beamlit/models/model_deployment_pod_template.py +2 -2
  107. beamlit/models/model_metrics.py +6 -6
  108. beamlit/models/model_provider.py +11 -11
  109. beamlit/models/model_provider_ref.py +2 -2
  110. beamlit/models/model_release.py +2 -2
  111. beamlit/models/model_spec.py +9 -3
  112. beamlit/models/model_with_deployments.py +6 -6
  113. beamlit/models/pending_invitation.py +2 -2
  114. beamlit/models/pending_invitation_accept.py +3 -3
  115. beamlit/models/pending_invitation_render.py +5 -5
  116. beamlit/models/pending_invitation_render_invited_by.py +2 -2
  117. beamlit/models/pending_invitation_render_workspace.py +2 -2
  118. beamlit/models/pending_invitation_workspace_details.py +6 -6
  119. beamlit/models/policy.py +20 -20
  120. beamlit/models/policy_location.py +9 -9
  121. beamlit/models/policy_spec.py +9 -3
  122. beamlit/models/provider_config.py +7 -7
  123. beamlit/models/qps.py +2 -2
  124. beamlit/models/resource_deployment_log.py +2 -2
  125. beamlit/models/resource_deployment_metrics.py +16 -16
  126. beamlit/models/resource_deployment_metrics_inference_per_region.py +5 -5
  127. beamlit/models/resource_deployment_metrics_inference_per_region_type_0.py +6 -2
  128. beamlit/models/resource_deployment_metrics_inference_per_second_per_region.py +5 -5
  129. beamlit/models/resource_deployment_metrics_inference_per_second_per_region_type_0.py +6 -2
  130. beamlit/models/resource_deployment_metrics_query_per_region_per_code.py +3 -3
  131. beamlit/models/resource_deployment_metrics_query_per_second_per_region_per_code.py +3 -3
  132. beamlit/models/resource_environment_metrics.py +62 -24
  133. beamlit/models/resource_environment_metrics_inference_per_second_per_region.py +6 -2
  134. beamlit/models/resource_metrics.py +10 -10
  135. beamlit/models/runtime.py +23 -23
  136. beamlit/models/runtime_readiness_probe.py +2 -2
  137. beamlit/models/runtime_resources.py +2 -2
  138. beamlit/models/serverless_config.py +2 -2
  139. beamlit/models/standard_fields_dynamo_db.py +2 -2
  140. beamlit/models/store_agent.py +6 -6
  141. beamlit/models/store_agent_configuration.py +2 -2
  142. beamlit/models/store_agent_labels.py +2 -2
  143. beamlit/models/store_configuration.py +16 -16
  144. beamlit/models/store_configuration_option.py +2 -2
  145. beamlit/models/store_function.py +12 -12
  146. beamlit/models/store_function_configuration.py +2 -2
  147. beamlit/models/store_function_kit.py +5 -5
  148. beamlit/models/store_function_labels.py +2 -2
  149. beamlit/models/store_function_parameter.py +9 -9
  150. beamlit/models/update_workspace_service_account_body.py +2 -2
  151. beamlit/models/update_workspace_service_account_response_200.py +2 -2
  152. beamlit/models/update_workspace_user_role_body.py +2 -2
  153. beamlit/models/workspace.py +3 -3
  154. beamlit/models/workspace_labels.py +2 -2
  155. beamlit/models/workspace_user.py +2 -2
  156. beamlit/run.py +6 -6
  157. beamlit/serve.py +120 -0
  158. {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc6.dist-info}/METADATA +5 -1
  159. beamlit-0.0.20rc6.dist-info/RECORD +290 -0
  160. beamlit-0.0.20rc5.dist-info/RECORD +0 -282
  161. {beamlit-0.0.20rc5.dist-info → beamlit-0.0.20rc6.dist-info}/WHEEL +0 -0
@@ -0,0 +1,4 @@
1
+ from .chat import get_chat_model
2
+ from .decorator import agent
3
+
4
+ __all__ = ["agent", "get_chat_model"]
beamlit/agents/chat.py ADDED
@@ -0,0 +1,87 @@
1
+ from logging import getLogger
2
+
3
+ from beamlit.authentication import get_authentication_headers, new_client
4
+ from beamlit.common.settings import get_settings
5
+ from beamlit.models import AgentDeployment
6
+
7
+ logger = getLogger(__name__)
8
+
9
+
10
+ def get_base_url(agent_model: AgentDeployment):
11
+ settings = get_settings()
12
+ return f"{settings.run_url}/{settings.workspace}/models/{agent_model.model}/v1"
13
+
14
+
15
+ def get_mistral_chat_model(**kwargs):
16
+ from langchain_mistralai.chat_models import ChatMistralAI # type: ignore
17
+
18
+ return ChatMistralAI(**kwargs)
19
+
20
+
21
+ def get_openai_chat_model(**kwargs):
22
+ from langchain_openai import ChatOpenAI # type: ignore
23
+
24
+ return ChatOpenAI(**kwargs)
25
+
26
+
27
+ def get_anthropic_chat_model(**kwargs):
28
+ from langchain_anthropic import ChatAnthropic # type: ignore
29
+
30
+ return ChatAnthropic(**kwargs)
31
+
32
+
33
+ def get_chat_model(agent_model: AgentDeployment):
34
+ settings = get_settings()
35
+ client = new_client()
36
+
37
+ headers = get_authentication_headers(settings)
38
+ headers["X-Beamlit-Environment"] = agent_model.environment
39
+
40
+ jwt = headers.pop("X-Beamlit-Authorization").replace("Bearer ", "")
41
+ params = {"environment": agent_model.environment}
42
+ chat_classes = {
43
+ "openai": {
44
+ "func": get_openai_chat_model,
45
+ "kwargs": {
46
+ "http_client": client.get_httpx_client(),
47
+ },
48
+ },
49
+ "anthropic": {
50
+ "func": get_anthropic_chat_model,
51
+ "kwargs": {},
52
+ },
53
+ "mistral": {
54
+ "func": get_mistral_chat_model,
55
+ "kwargs": {
56
+ "api_key": jwt,
57
+ },
58
+ },
59
+ }
60
+
61
+ if agent_model is None:
62
+ raise ValueError("agent_model not found in configuration")
63
+ if agent_model.runtime is None:
64
+ raise ValueError("runtime not found in agent model")
65
+ if agent_model.runtime.type is None:
66
+ raise ValueError("type not found in runtime")
67
+ if agent_model.runtime.model is None:
68
+ raise ValueError("model not found in runtime")
69
+
70
+ provider = agent_model.runtime.type
71
+ model = agent_model.runtime.model
72
+
73
+ kwargs = {
74
+ "model": model,
75
+ "base_url": get_base_url(agent_model),
76
+ "default_query": params,
77
+ "default_headers": headers,
78
+ "api_key": "fake_api_key",
79
+ "temperature": 0,
80
+ }
81
+ chat_class = chat_classes.get(provider)
82
+ if not chat_class:
83
+ logger.warning(f"Provider {provider} not currently supported, defaulting to OpenAI")
84
+ chat_class = chat_classes["openai"]
85
+ if "kwargs" in chat_class:
86
+ kwargs.update(chat_class["kwargs"])
87
+ return chat_class["func"](**kwargs)
@@ -0,0 +1,129 @@
1
+ # Import necessary modules
2
+ import ast
3
+ import importlib
4
+ import os
5
+ from logging import getLogger
6
+
7
+ from langgraph.checkpoint.memory import MemorySaver
8
+ from langgraph.prebuilt import create_react_agent
9
+
10
+ from beamlit.api.models import get_model_deployment
11
+ from beamlit.authentication import new_client
12
+ from beamlit.common.settings import get_settings, init
13
+ from beamlit.errors import UnexpectedStatus
14
+ from beamlit.models import AgentDeployment
15
+
16
+ from .chat import get_chat_model
17
+
18
+
19
+ def get_functions(dir="src/functions", from_decorator="function"):
20
+ functions = []
21
+ logger = getLogger(__name__)
22
+
23
+ # Walk through all Python files in functions directory and subdirectories
24
+ for root, _, files in os.walk(dir):
25
+ for file in files:
26
+ if file.endswith(".py"):
27
+ file_path = os.path.join(root, file)
28
+ # Read and compile the file content
29
+ with open(file_path) as f:
30
+ try:
31
+ file_content = f.read()
32
+ # Parse the file content to find decorated functions
33
+ tree = ast.parse(file_content)
34
+
35
+ # Look for function definitions with decorators
36
+ for node in ast.walk(tree):
37
+ if not isinstance(node, ast.FunctionDef) or len(node.decorator_list) == 0:
38
+ continue
39
+ decorator = node.decorator_list[0]
40
+
41
+ decorator_name = ""
42
+ if isinstance(decorator, ast.Call):
43
+ decorator_name = decorator.func.id
44
+ if isinstance(decorator, ast.Name):
45
+ decorator_name = decorator.id
46
+
47
+ if decorator_name == from_decorator:
48
+ # Get the function name and decorator name
49
+ func_name = node.name
50
+
51
+ # Import the module to get the actual function
52
+ spec = importlib.util.spec_from_file_location(func_name, file_path)
53
+ module = importlib.util.module_from_spec(spec)
54
+ spec.loader.exec_module(module)
55
+ # Check if kit=True in the decorator arguments
56
+ is_kit = False
57
+ if isinstance(decorator, ast.Call):
58
+ for keyword in decorator.keywords:
59
+ if keyword.arg == "kit" and isinstance(keyword.value, ast.Constant):
60
+ is_kit = keyword.value.value
61
+ if is_kit:
62
+ kit_functions = get_functions(
63
+ dir=os.path.join(root),
64
+ from_decorator="kit",
65
+ )
66
+ functions.extend(kit_functions)
67
+
68
+ # Get the decorated function
69
+ if not is_kit and hasattr(module, func_name):
70
+ func = getattr(module, func_name)
71
+ functions.append(func)
72
+ except Exception as e:
73
+ logger.warning(f"Error processing {file_path}: {e!s}")
74
+ return functions
75
+
76
+
77
+ def agent(
78
+ bl_agent: AgentDeployment = None,
79
+ chat_model=None,
80
+ agent=None,
81
+ ):
82
+ settings = init()
83
+ logger = getLogger(__name__)
84
+
85
+ def wrapper(func):
86
+ settings = get_settings()
87
+
88
+ def wrapped(*args, **kwargs):
89
+ return func(
90
+ settings.agent,
91
+ settings.agent_chat_model,
92
+ settings.agent_functions,
93
+ *args,
94
+ **kwargs,
95
+ )
96
+
97
+ return wrapped
98
+
99
+ # Initialize functions array to store decorated functions
100
+ functions = get_functions()
101
+ settings.agent_functions = functions
102
+
103
+ if bl_agent.model and chat_model is None:
104
+ client = new_client()
105
+ try:
106
+ response = get_model_deployment.sync_detailed(bl_agent.model, settings.environment, client=client)
107
+ settings.agent_model = response.parsed
108
+ except UnexpectedStatus as e:
109
+ if e.status_code == 404 and settings.environment != "production":
110
+ try:
111
+ response = get_model_deployment.sync_detailed(bl_agent.model, "production", client=client)
112
+ settings.agent_model = response.parsed
113
+ except UnexpectedStatus as e:
114
+ if e.status_code == 404:
115
+ raise ValueError(f"Model {bl_agent.model} not found")
116
+ else:
117
+ raise e
118
+
119
+ chat_model = get_chat_model(settings.agent_model)
120
+ settings.agent_chat_model = chat_model
121
+ runtime = settings.agent_model.runtime
122
+ logger.info(f"Chat model configured, using: {runtime.type}:{runtime.model}")
123
+
124
+ if agent is None and chat_model is not None:
125
+ memory = MemorySaver()
126
+ agent = create_react_agent(chat_model, functions, checkpointer=memory)
127
+ settings.agent = agent
128
+
129
+ return wrapper
@@ -21,7 +21,9 @@ def _get_kwargs(
21
21
  return _kwargs
22
22
 
23
23
 
24
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AgentHistory]:
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[AgentHistory]:
25
27
  if response.status_code == 200:
26
28
  response_200 = AgentHistory.from_dict(response.json())
27
29
 
@@ -32,7 +34,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
32
34
  return None
33
35
 
34
36
 
35
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AgentHistory]:
37
+ def _build_response(
38
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
+ ) -> Response[AgentHistory]:
36
40
  return Response(
37
41
  status_code=HTTPStatus(response.status_code),
38
42
  content=response.content,
@@ -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
 
@@ -23,7 +23,7 @@ def _get_kwargs(
23
23
 
24
24
  def _parse_response(
25
25
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[List["ResourceDeploymentLog"]]:
26
+ ) -> Optional[list["ResourceDeploymentLog"]]:
27
27
  if response.status_code == 200:
28
28
  response_200 = []
29
29
  _response_200 = response.json()
@@ -41,7 +41,7 @@ def _parse_response(
41
41
 
42
42
  def _build_response(
43
43
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
- ) -> Response[List["ResourceDeploymentLog"]]:
44
+ ) -> Response[list["ResourceDeploymentLog"]]:
45
45
  return Response(
46
46
  status_code=HTTPStatus(response.status_code),
47
47
  content=response.content,
@@ -55,7 +55,7 @@ def sync_detailed(
55
55
  environment_name: str,
56
56
  *,
57
57
  client: AuthenticatedClient,
58
- ) -> Response[List["ResourceDeploymentLog"]]:
58
+ ) -> Response[list["ResourceDeploymentLog"]]:
59
59
  """
60
60
  Args:
61
61
  agent_name (str):
@@ -66,7 +66,7 @@ def sync_detailed(
66
66
  httpx.TimeoutException: If the request takes longer than Client.timeout.
67
67
 
68
68
  Returns:
69
- Response[List['ResourceDeploymentLog']]
69
+ Response[list['ResourceDeploymentLog']]
70
70
  """
71
71
 
72
72
  kwargs = _get_kwargs(
@@ -86,7 +86,7 @@ def sync(
86
86
  environment_name: str,
87
87
  *,
88
88
  client: AuthenticatedClient,
89
- ) -> Optional[List["ResourceDeploymentLog"]]:
89
+ ) -> Optional[list["ResourceDeploymentLog"]]:
90
90
  """
91
91
  Args:
92
92
  agent_name (str):
@@ -97,7 +97,7 @@ def sync(
97
97
  httpx.TimeoutException: If the request takes longer than Client.timeout.
98
98
 
99
99
  Returns:
100
- List['ResourceDeploymentLog']
100
+ list['ResourceDeploymentLog']
101
101
  """
102
102
 
103
103
  return sync_detailed(
@@ -112,7 +112,7 @@ async def asyncio_detailed(
112
112
  environment_name: str,
113
113
  *,
114
114
  client: AuthenticatedClient,
115
- ) -> Response[List["ResourceDeploymentLog"]]:
115
+ ) -> Response[list["ResourceDeploymentLog"]]:
116
116
  """
117
117
  Args:
118
118
  agent_name (str):
@@ -123,7 +123,7 @@ async def asyncio_detailed(
123
123
  httpx.TimeoutException: If the request takes longer than Client.timeout.
124
124
 
125
125
  Returns:
126
- Response[List['ResourceDeploymentLog']]
126
+ Response[list['ResourceDeploymentLog']]
127
127
  """
128
128
 
129
129
  kwargs = _get_kwargs(
@@ -141,7 +141,7 @@ async def asyncio(
141
141
  environment_name: str,
142
142
  *,
143
143
  client: AuthenticatedClient,
144
- ) -> Optional[List["ResourceDeploymentLog"]]:
144
+ ) -> Optional[list["ResourceDeploymentLog"]]:
145
145
  """
146
146
  Args:
147
147
  agent_name (str):
@@ -152,7 +152,7 @@ async def asyncio(
152
152
  httpx.TimeoutException: If the request takes longer than Client.timeout.
153
153
 
154
154
  Returns:
155
- List['ResourceDeploymentLog']
155
+ list['ResourceDeploymentLog']
156
156
  """
157
157
 
158
158
  return (
@@ -21,7 +21,9 @@ def _get_kwargs(
21
21
  return _kwargs
22
22
 
23
23
 
24
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AgentHistory]:
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[AgentHistory]:
25
27
  if response.status_code == 200:
26
28
  response_200 = AgentHistory.from_dict(response.json())
27
29
 
@@ -32,7 +34,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
32
34
  return None
33
35
 
34
36
 
35
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AgentHistory]:
37
+ def _build_response(
38
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
39
+ ) -> Response[AgentHistory]:
36
40
  return Response(
37
41
  status_code=HTTPStatus(response.status_code),
38
42
  content=response.content,
@@ -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
 
@@ -23,7 +23,7 @@ def _get_kwargs(
23
23
 
24
24
  def _parse_response(
25
25
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
- ) -> Optional[List["AgentDeploymentHistory"]]:
26
+ ) -> Optional[list["AgentDeploymentHistory"]]:
27
27
  if response.status_code == 200:
28
28
  response_200 = []
29
29
  _response_200 = response.json()
@@ -41,7 +41,7 @@ def _parse_response(
41
41
 
42
42
  def _build_response(
43
43
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
- ) -> Response[List["AgentDeploymentHistory"]]:
44
+ ) -> Response[list["AgentDeploymentHistory"]]:
45
45
  return Response(
46
46
  status_code=HTTPStatus(response.status_code),
47
47
  content=response.content,
@@ -55,7 +55,7 @@ def sync_detailed(
55
55
  environment_name: str,
56
56
  *,
57
57
  client: AuthenticatedClient,
58
- ) -> Response[List["AgentDeploymentHistory"]]:
58
+ ) -> Response[list["AgentDeploymentHistory"]]:
59
59
  """
60
60
  Args:
61
61
  agent_name (str):
@@ -66,7 +66,7 @@ def sync_detailed(
66
66
  httpx.TimeoutException: If the request takes longer than Client.timeout.
67
67
 
68
68
  Returns:
69
- Response[List['AgentDeploymentHistory']]
69
+ Response[list['AgentDeploymentHistory']]
70
70
  """
71
71
 
72
72
  kwargs = _get_kwargs(
@@ -86,7 +86,7 @@ def sync(
86
86
  environment_name: str,
87
87
  *,
88
88
  client: AuthenticatedClient,
89
- ) -> Optional[List["AgentDeploymentHistory"]]:
89
+ ) -> Optional[list["AgentDeploymentHistory"]]:
90
90
  """
91
91
  Args:
92
92
  agent_name (str):
@@ -97,7 +97,7 @@ def sync(
97
97
  httpx.TimeoutException: If the request takes longer than Client.timeout.
98
98
 
99
99
  Returns:
100
- List['AgentDeploymentHistory']
100
+ list['AgentDeploymentHistory']
101
101
  """
102
102
 
103
103
  return sync_detailed(
@@ -112,7 +112,7 @@ async def asyncio_detailed(
112
112
  environment_name: str,
113
113
  *,
114
114
  client: AuthenticatedClient,
115
- ) -> Response[List["AgentDeploymentHistory"]]:
115
+ ) -> Response[list["AgentDeploymentHistory"]]:
116
116
  """
117
117
  Args:
118
118
  agent_name (str):
@@ -123,7 +123,7 @@ async def asyncio_detailed(
123
123
  httpx.TimeoutException: If the request takes longer than Client.timeout.
124
124
 
125
125
  Returns:
126
- Response[List['AgentDeploymentHistory']]
126
+ Response[list['AgentDeploymentHistory']]
127
127
  """
128
128
 
129
129
  kwargs = _get_kwargs(
@@ -141,7 +141,7 @@ async def asyncio(
141
141
  environment_name: str,
142
142
  *,
143
143
  client: AuthenticatedClient,
144
- ) -> Optional[List["AgentDeploymentHistory"]]:
144
+ ) -> Optional[list["AgentDeploymentHistory"]]:
145
145
  """
146
146
  Args:
147
147
  agent_name (str):
@@ -152,7 +152,7 @@ async def asyncio(
152
152
  httpx.TimeoutException: If the request takes longer than Client.timeout.
153
153
 
154
154
  Returns:
155
- List['AgentDeploymentHistory']
155
+ list['AgentDeploymentHistory']
156
156
  """
157
157
 
158
158
  return (
@@ -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["AgentDeployment"]]:
25
+ ) -> Optional[list["AgentDeployment"]]:
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["AgentDeployment"]]:
43
+ ) -> Response[list["AgentDeployment"]]:
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
  agent_name: str,
54
54
  *,
55
55
  client: AuthenticatedClient,
56
- ) -> Response[List["AgentDeployment"]]:
56
+ ) -> Response[list["AgentDeployment"]]:
57
57
  """List all agent deployments
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['AgentDeployment']]
67
+ Response[list['AgentDeployment']]
68
68
  """
69
69
 
70
70
  kwargs = _get_kwargs(
@@ -82,7 +82,7 @@ def sync(
82
82
  agent_name: str,
83
83
  *,
84
84
  client: AuthenticatedClient,
85
- ) -> Optional[List["AgentDeployment"]]:
85
+ ) -> Optional[list["AgentDeployment"]]:
86
86
  """List all agent deployments
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['AgentDeployment']
96
+ list['AgentDeployment']
97
97
  """
98
98
 
99
99
  return sync_detailed(
@@ -106,7 +106,7 @@ async def asyncio_detailed(
106
106
  agent_name: str,
107
107
  *,
108
108
  client: AuthenticatedClient,
109
- ) -> Response[List["AgentDeployment"]]:
109
+ ) -> Response[list["AgentDeployment"]]:
110
110
  """List all agent deployments
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['AgentDeployment']]
120
+ Response[list['AgentDeployment']]
121
121
  """
122
122
 
123
123
  kwargs = _get_kwargs(
@@ -133,7 +133,7 @@ async def asyncio(
133
133
  agent_name: str,
134
134
  *,
135
135
  client: AuthenticatedClient,
136
- ) -> Optional[List["AgentDeployment"]]:
136
+ ) -> Optional[list["AgentDeployment"]]:
137
137
  """List all agent deployments
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['AgentDeployment']
147
+ list['AgentDeployment']
148
148
  """
149
149
 
150
150
  return (
@@ -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
 
@@ -18,7 +18,7 @@ def _get_kwargs() -> dict[str, Any]:
18
18
  return _kwargs
19
19
 
20
20
 
21
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[List["Agent"]]:
21
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[list["Agent"]]:
22
22
  if response.status_code == 200:
23
23
  response_200 = []
24
24
  _response_200 = response.json()
@@ -34,7 +34,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
34
34
  return None
35
35
 
36
36
 
37
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[List["Agent"]]:
37
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[list["Agent"]]:
38
38
  return Response(
39
39
  status_code=HTTPStatus(response.status_code),
40
40
  content=response.content,
@@ -46,7 +46,7 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt
46
46
  def sync_detailed(
47
47
  *,
48
48
  client: AuthenticatedClient,
49
- ) -> Response[List["Agent"]]:
49
+ ) -> Response[list["Agent"]]:
50
50
  """List all agents
51
51
 
52
52
  Raises:
@@ -54,7 +54,7 @@ def sync_detailed(
54
54
  httpx.TimeoutException: If the request takes longer than Client.timeout.
55
55
 
56
56
  Returns:
57
- Response[List['Agent']]
57
+ Response[list['Agent']]
58
58
  """
59
59
 
60
60
  kwargs = _get_kwargs()
@@ -69,7 +69,7 @@ def sync_detailed(
69
69
  def sync(
70
70
  *,
71
71
  client: AuthenticatedClient,
72
- ) -> Optional[List["Agent"]]:
72
+ ) -> Optional[list["Agent"]]:
73
73
  """List all agents
74
74
 
75
75
  Raises:
@@ -77,7 +77,7 @@ def sync(
77
77
  httpx.TimeoutException: If the request takes longer than Client.timeout.
78
78
 
79
79
  Returns:
80
- List['Agent']
80
+ list['Agent']
81
81
  """
82
82
 
83
83
  return sync_detailed(
@@ -88,7 +88,7 @@ def sync(
88
88
  async def asyncio_detailed(
89
89
  *,
90
90
  client: AuthenticatedClient,
91
- ) -> Response[List["Agent"]]:
91
+ ) -> Response[list["Agent"]]:
92
92
  """List all agents
93
93
 
94
94
  Raises:
@@ -96,7 +96,7 @@ async def asyncio_detailed(
96
96
  httpx.TimeoutException: If the request takes longer than Client.timeout.
97
97
 
98
98
  Returns:
99
- Response[List['Agent']]
99
+ Response[list['Agent']]
100
100
  """
101
101
 
102
102
  kwargs = _get_kwargs()
@@ -109,7 +109,7 @@ async def asyncio_detailed(
109
109
  async def asyncio(
110
110
  *,
111
111
  client: AuthenticatedClient,
112
- ) -> Optional[List["Agent"]]:
112
+ ) -> Optional[list["Agent"]]:
113
113
  """List all agents
114
114
 
115
115
  Raises:
@@ -117,7 +117,7 @@ async def asyncio(
117
117
  httpx.TimeoutException: If the request takes longer than Client.timeout.
118
118
 
119
119
  Returns:
120
- List['Agent']
120
+ list['Agent']
121
121
  """
122
122
 
123
123
  return (
@@ -31,7 +31,9 @@ def _get_kwargs(
31
31
  return _kwargs
32
32
 
33
33
 
34
- def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[AgentHistory]:
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> Optional[AgentHistory]:
35
37
  if response.status_code == 200:
36
38
  response_200 = AgentHistory.from_dict(response.json())
37
39
 
@@ -42,7 +44,9 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt
42
44
  return None
43
45
 
44
46
 
45
- def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[AgentHistory]:
47
+ def _build_response(
48
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
49
+ ) -> Response[AgentHistory]:
46
50
  return Response(
47
51
  status_code=HTTPStatus(response.status_code),
48
52
  content=response.content,