beamlit 0.0.56rc107__py3-none-any.whl → 0.0.57__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 (92) hide show
  1. beamlit/agents/chain.py +0 -2
  2. beamlit/agents/chat.py +20 -8
  3. beamlit/agents/decorator.py +112 -99
  4. beamlit/agents/thread.py +5 -9
  5. beamlit/api/agents/delete_agent.py +1 -22
  6. beamlit/api/agents/get_agent.py +1 -22
  7. beamlit/api/agents/get_agent_metrics.py +13 -34
  8. beamlit/api/agents/get_agent_trace_ids.py +44 -14
  9. beamlit/api/agents/{list_agent_history.py → list_agent_revisions.py} +21 -17
  10. beamlit/api/agents/list_agents.py +4 -36
  11. beamlit/api/default/get_trace_ids.py +0 -15
  12. beamlit/api/default/list_mcp_hub_definitions.py +12 -12
  13. beamlit/api/functions/delete_function.py +1 -22
  14. beamlit/api/functions/get_function.py +1 -22
  15. beamlit/api/functions/get_function_metrics.py +13 -34
  16. beamlit/api/functions/get_function_trace_ids.py +44 -14
  17. beamlit/api/functions/{create_function_release.py → list_function_revisions.py} +26 -18
  18. beamlit/api/functions/list_functions.py +4 -36
  19. beamlit/api/knowledgebases/create_knowledgebase.py +4 -4
  20. beamlit/api/knowledgebases/delete_knowledgebase.py +5 -26
  21. beamlit/api/knowledgebases/get_knowledgebase.py +1 -22
  22. beamlit/api/{environments/get_environment_metrics.py → knowledgebases/list_knowledgebase_revisions.py} +34 -34
  23. beamlit/api/knowledgebases/list_knowledgebases.py +4 -36
  24. beamlit/api/models/create_model.py +4 -8
  25. beamlit/api/models/delete_model.py +1 -22
  26. beamlit/api/models/get_model.py +1 -22
  27. beamlit/api/models/get_model_metrics.py +13 -34
  28. beamlit/api/models/get_model_trace_ids.py +44 -14
  29. beamlit/api/models/{release_model.py → list_model_revisions.py} +26 -22
  30. beamlit/api/models/list_models.py +4 -36
  31. beamlit/api/models/update_model.py +4 -8
  32. beamlit/authentication/authentication.py +11 -8
  33. beamlit/authentication/clientcredentials.py +15 -28
  34. beamlit/authentication/credentials.py +2 -7
  35. beamlit/common/settings.py +1 -4
  36. beamlit/deploy/deploy.py +15 -9
  37. beamlit/functions/common.py +16 -16
  38. beamlit/functions/local/local.py +4 -5
  39. beamlit/functions/mcp/client.py +96 -0
  40. beamlit/functions/mcp/mcp.py +56 -46
  41. beamlit/functions/remote/remote.py +9 -11
  42. beamlit/models/__init__.py +8 -38
  43. beamlit/models/agent.py +6 -6
  44. beamlit/models/function.py +6 -6
  45. beamlit/models/knowledgebase.py +6 -6
  46. beamlit/models/last_n_requests_metric.py +0 -9
  47. beamlit/models/model.py +7 -7
  48. beamlit/models/{resource_environment_metrics.py → resource_metrics.py} +20 -26
  49. beamlit/models/{resource_environment_metrics_request_total_per_code.py → resource_metrics_request_total_per_code.py} +5 -5
  50. beamlit/models/{resource_environment_metrics_rps_per_code.py → resource_metrics_rps_per_code.py} +5 -5
  51. beamlit/models/{model_release.py → revision_metadata.py} +20 -20
  52. beamlit/models/runtime.py +2 -2
  53. beamlit/models/workspace.py +0 -9
  54. beamlit/run.py +3 -7
  55. beamlit/serve/app.py +4 -8
  56. {beamlit-0.0.56rc107.dist-info → beamlit-0.0.57.dist-info}/METADATA +2 -1
  57. {beamlit-0.0.56rc107.dist-info → beamlit-0.0.57.dist-info}/RECORD +63 -91
  58. beamlit/api/agents/create_agent_release.py +0 -146
  59. beamlit/api/agents/delete_agent_history.py +0 -155
  60. beamlit/api/agents/get_agent_history.py +0 -155
  61. beamlit/api/agents/put_agent_history.py +0 -181
  62. beamlit/api/environments/__init__.py +0 -0
  63. beamlit/api/environments/create_environment.py +0 -167
  64. beamlit/api/environments/delete_environment.py +0 -154
  65. beamlit/api/environments/get_environment.py +0 -154
  66. beamlit/api/environments/list_environments.py +0 -139
  67. beamlit/api/environments/update_environment.py +0 -180
  68. beamlit/api/generation/__init__.py +0 -0
  69. beamlit/api/generation/run_information_generation_agent.py +0 -168
  70. beamlit/api/history/__init__.py +0 -0
  71. beamlit/api/history/get_agents_history.py +0 -155
  72. beamlit/api/history/list_agents_history.py +0 -131
  73. beamlit/models/agent_history.py +0 -167
  74. beamlit/models/agent_history_event.py +0 -133
  75. beamlit/models/agent_information_request.py +0 -63
  76. beamlit/models/agent_information_response.py +0 -79
  77. beamlit/models/agent_release.py +0 -70
  78. beamlit/models/environment.py +0 -96
  79. beamlit/models/environment_metadata.py +0 -148
  80. beamlit/models/environment_metrics.py +0 -77
  81. beamlit/models/environment_spec.py +0 -63
  82. beamlit/models/function_release.py +0 -70
  83. beamlit/models/knowledgebase_release.py +0 -70
  84. beamlit/models/mcp_hub_artifact.py +0 -188
  85. beamlit/models/mcp_hub_artifact_entrypoint.py +0 -45
  86. beamlit/models/mcp_hub_artifact_form.py +0 -45
  87. /beamlit/api/agents/{get_agent_environment_logs.py → get_agent_logs.py} +0 -0
  88. /beamlit/api/functions/{get_function_environment_logs.py → get_function_logs.py} +0 -0
  89. /beamlit/api/models/{get_model_environment_logs.py → get_model_logs.py} +0 -0
  90. {beamlit-0.0.56rc107.dist-info → beamlit-0.0.57.dist-info}/WHEEL +0 -0
  91. {beamlit-0.0.56rc107.dist-info → beamlit-0.0.57.dist-info}/entry_points.txt +0 -0
  92. {beamlit-0.0.56rc107.dist-info → beamlit-0.0.57.dist-info}/licenses/LICENSE +0 -0
beamlit/agents/chain.py CHANGED
@@ -55,11 +55,9 @@ class ChainTool(BaseTool):
55
55
  Returns:
56
56
  Any: The result of the asynchronous tool execution.
57
57
  """
58
- settings = get_settings()
59
58
  result = self.client.run(
60
59
  "agent",
61
60
  self.name,
62
- settings.environment,
63
61
  "POST",
64
62
  cloud=self._cloud,
65
63
  service_name=self._service_name,
beamlit/agents/chat.py CHANGED
@@ -120,6 +120,13 @@ def get_azure_marketplace_chat_model(**kwargs):
120
120
  **kwargs
121
121
  ) # It seems to use a compatible endpoint, so we can use the classic OpenAI interface
122
122
 
123
+ def get_gemini_chat_model(**kwargs):
124
+ from langchain_google_genai import ChatGoogleGenerativeAI # type: ignore
125
+
126
+ return ChatGoogleGenerativeAI(
127
+ **kwargs,
128
+ )
129
+
123
130
  def get_chat_model(name: str, agent_model: Union[Model, None] = None) -> BaseChatModel:
124
131
  """
125
132
  Gets a chat model instance for the specified model name.
@@ -155,19 +162,13 @@ def get_chat_model_full(name: str, agent_model: Union[Model, None] = None) -> Tu
155
162
 
156
163
  if agent_model is None:
157
164
  try:
158
- agent_model = get_model.sync(name, client=client, environment=settings.environment)
165
+ agent_model = get_model.sync(name, client=client)
159
166
  except Exception:
160
167
  logger.warning(f"Model {name} not found, defaulting to gpt-4o-mini")
161
168
 
162
- environment = (
163
- (agent_model and agent_model.metadata and agent_model.metadata.environment)
164
- or settings.environment
165
- )
166
169
  headers = get_authentication_headers(settings)
167
- headers["X-Beamlit-Environment"] = environment
168
170
 
169
171
  jwt = headers.get("X-Beamlit-Authorization", "").replace("Bearer ", "")
170
- params = {"environment": environment}
171
172
  chat_classes = {
172
173
  "openai": {
173
174
  "func": get_openai_chat_model,
@@ -221,6 +222,18 @@ def get_chat_model_full(name: str, agent_model: Union[Model, None] = None) -> Tu
221
222
  "func": get_azure_marketplace_chat_model,
222
223
  "kwargs": {},
223
224
  },
225
+ "gemini": {
226
+ "func": get_gemini_chat_model,
227
+ "kwargs": {
228
+ "api_key": "fake_api_key",
229
+ "client_options": {
230
+ "api_endpoint": get_base_url(name).replace("/v1", "")
231
+ },
232
+ "transport": "rest",
233
+ "additional_headers": {"X-Beamlit-Authorization": f"Bearer {jwt}"},
234
+ },
235
+ "remove_kwargs": ["api_key", "default_headers"]
236
+ },
224
237
  }
225
238
 
226
239
  provider = (
@@ -257,7 +270,6 @@ def get_chat_model_full(name: str, agent_model: Union[Model, None] = None) -> Tu
257
270
  kwargs = {
258
271
  "model": model,
259
272
  "base_url": get_base_url(name),
260
- "default_query": params,
261
273
  "default_headers": headers,
262
274
  "api_key": "fake_api_key",
263
275
  "temperature": 0,
@@ -4,6 +4,7 @@ Defines decorators for agent functionalities.
4
4
  """
5
5
 
6
6
  # Import necessary modules
7
+ import asyncio
7
8
  import functools
8
9
  import inspect
9
10
  from logging import getLogger
@@ -14,15 +15,113 @@ from langgraph.prebuilt import create_react_agent
14
15
 
15
16
  from beamlit.api.models import get_model, list_models
16
17
  from beamlit.authentication import new_client
17
- from beamlit.common.settings import init
18
+ from beamlit.common.settings import Settings, init
18
19
  from beamlit.errors import UnexpectedStatus
19
20
  from beamlit.functions import get_functions
20
- from beamlit.models import Agent, AgentSpec, EnvironmentMetadata
21
+ from beamlit.models import Agent, AgentSpec, Metadata
21
22
 
22
23
  from .chat import get_chat_model_full
23
24
  from .voice.openai import OpenAIVoiceReactAgent
24
25
 
25
26
 
27
+ async def initialize_agent(
28
+ settings: Settings,
29
+ agent: Agent | dict = None,
30
+ override_model=None,
31
+ override_agent=None,
32
+ override_functions=None,
33
+ remote_functions=None,
34
+ local_functions=None,
35
+ ):
36
+ logger = getLogger(__name__)
37
+ client = new_client()
38
+ chat_model = override_model or None
39
+
40
+ if agent is not None:
41
+ metadata = Metadata(**agent.get("metadata", {}))
42
+ spec = AgentSpec(**agent.get("spec", {}))
43
+ agent = Agent(metadata=metadata, spec=spec)
44
+ if agent.spec.model and chat_model is None:
45
+ try:
46
+ response = get_model.sync_detailed(
47
+ agent.spec.model, client=client
48
+ )
49
+ settings.agent.model = response.parsed
50
+ except UnexpectedStatus as e:
51
+ if e.status_code == 404:
52
+ if e.status_code == 404:
53
+ raise ValueError(f"Model {agent.spec.model} not found")
54
+ raise e
55
+ except Exception as e:
56
+ raise e
57
+
58
+ if settings.agent.model:
59
+ chat_model, provider, model = get_chat_model_full(agent.spec.model, settings.agent.model)
60
+ settings.agent.chat_model = chat_model
61
+ logger.info(f"Chat model configured, using: {provider}:{model}")
62
+
63
+ if override_functions is not None:
64
+ functions = override_functions
65
+ else:
66
+ functions = await get_functions(
67
+ client=client,
68
+ dir=settings.agent.functions_directory,
69
+ remote_functions=remote_functions,
70
+ chain=agent.spec.agent_chain,
71
+ local_functions=local_functions,
72
+ remote_functions_empty=not remote_functions,
73
+ warning=chat_model is not None,
74
+ )
75
+ settings.agent.functions = functions
76
+
77
+ if override_agent is None:
78
+ if chat_model is None:
79
+ models_select = ""
80
+ try:
81
+ models = list_models.sync_detailed(
82
+ client=client
83
+ )
84
+ models = ", ".join([model.metadata.name for model in models.parsed])
85
+ models_select = f"You can select one from your models: {models}"
86
+ except Exception:
87
+ pass
88
+
89
+ raise ValueError(
90
+ f"You must provide a model.\n"
91
+ f"{models_select}\n"
92
+ f"You can create one at {settings.app_url}/{settings.workspace}/global-inference-network/models/create\n"
93
+ "Add it to your agent spec\n"
94
+ "agent={\n"
95
+ ' "metadata": {\n'
96
+ f' "name": "{agent.metadata.name}",\n'
97
+ " },\n"
98
+ ' "spec": {\n'
99
+ ' "model": "MODEL_NAME",\n'
100
+ f' "description": "{agent.spec.description}",\n'
101
+ f' "prompt": "{agent.spec.prompt}",\n'
102
+ " },\n"
103
+ "}")
104
+ if isinstance(chat_model, OpenAIVoiceReactAgent):
105
+ _agent = chat_model
106
+ else:
107
+ memory = MemorySaver()
108
+ if len(functions) == 0:
109
+ raise ValueError("You can define this function in directory "
110
+ f'"{settings.agent.functions_directory}". Here is a sample function you can use:\n\n'
111
+ "from beamlit.functions import function\n\n"
112
+ "@function()\n"
113
+ "def hello_world(query: str):\n"
114
+ " return 'Hello, world!'\n")
115
+ try:
116
+ _agent = create_react_agent(chat_model, functions, checkpointer=memory, state_modifier=agent.spec.prompt or "")
117
+ except AttributeError: # special case for azure-marketplace where it uses the old OpenAI interface (no tools)
118
+ logger.warning("Using the old OpenAI interface for Azure Marketplace, no tools available")
119
+ _agent = create_react_agent(chat_model, [], checkpointer=memory, state_modifier=(agent and agent.spec and agent.spec.prompt) or "")
120
+
121
+ settings.agent.agent = _agent
122
+ else:
123
+ settings.agent.agent = override_agent
124
+
26
125
  def agent(
27
126
  agent: Agent | dict = None,
28
127
  override_model=None,
@@ -58,17 +157,17 @@ def agent(
58
157
  Re-raises exceptions encountered during model retrieval and agent setup.
59
158
  """
60
159
  logger = getLogger(__name__)
160
+ settings = init()
161
+ _is_initialized = False
61
162
  try:
62
163
  if agent is not None and not isinstance(agent, dict):
63
164
  raise Exception(
64
165
  'agent must be a dictionary, example: @agent(agent={"metadata": {"name": "my_agent"}})'
65
166
  )
66
167
 
67
- client = new_client()
68
- chat_model = override_model or None
69
- settings = init()
70
168
 
71
169
  def wrapper(func):
170
+
72
171
  agent_kwargs = any(
73
172
  param.name == "agent"
74
173
  for param in inspect.signature(func).parameters.values()
@@ -83,109 +182,23 @@ def agent(
83
182
  )
84
183
 
85
184
  @functools.wraps(func)
86
- def wrapped(*args, **kwargs):
185
+ async def wrapped(*args, **kwargs):
186
+ nonlocal _is_initialized
187
+ if not _is_initialized:
188
+ async with asyncio.Lock():
189
+ if not _is_initialized:
190
+ await initialize_agent(settings, agent, override_model, override_agent, override_functions, remote_functions, local_functions)
191
+ _is_initialized = True
87
192
  if agent_kwargs:
88
193
  kwargs["agent"] = settings.agent.agent
89
194
  if model_kwargs:
90
195
  kwargs["model"] = settings.agent.chat_model
91
196
  if functions_kwargs:
92
197
  kwargs["functions"] = settings.agent.functions
93
- return func(*args, **kwargs)
198
+ return await func(*args, **kwargs)
94
199
 
95
200
  return wrapped
96
201
 
97
- if agent is not None:
98
- metadata = EnvironmentMetadata(**agent.get("metadata", {}))
99
- spec = AgentSpec(**agent.get("spec", {}))
100
- agent = Agent(metadata=metadata, spec=spec)
101
- if agent.spec.model and chat_model is None:
102
- try:
103
- response = get_model.sync_detailed(
104
- agent.spec.model, environment=settings.environment, client=client
105
- )
106
- settings.agent.model = response.parsed
107
- except UnexpectedStatus as e:
108
- if e.status_code == 404 and settings.environment != "production":
109
- try:
110
- response = get_model.sync_detailed(
111
- agent.spec.model, environment="production", client=client
112
- )
113
- settings.agent.model = response.parsed
114
- except UnexpectedStatus as e:
115
- if e.status_code == 404:
116
- raise ValueError(f"Model {agent.spec.model} not found")
117
- else:
118
- raise e
119
- except Exception as e:
120
- raise e
121
-
122
- if settings.agent.model:
123
- chat_model, provider, model = get_chat_model_full(agent.spec.model, settings.agent.model)
124
- settings.agent.chat_model = chat_model
125
- logger.info(f"Chat model configured, using: {provider}:{model}")
126
-
127
- if override_functions is not None:
128
- functions = override_functions
129
- else:
130
- functions = get_functions(
131
- client=client,
132
- dir=settings.agent.functions_directory,
133
- remote_functions=remote_functions,
134
- chain=agent.spec.agent_chain,
135
- local_functions=local_functions,
136
- remote_functions_empty=not remote_functions,
137
- warning=chat_model is not None,
138
- )
139
-
140
- settings.agent.functions = functions
141
-
142
- if override_agent is None:
143
- if chat_model is None:
144
- models_select = ""
145
- try:
146
- models = list_models.sync_detailed(
147
- environment=settings.environment, client=client
148
- )
149
- models = ", ".join([model.metadata.name for model in models.parsed])
150
- models_select = f"You can select one from your models: {models}"
151
- except Exception:
152
- pass
153
-
154
- raise ValueError(
155
- f"You must provide a model.\n"
156
- f"{models_select}\n"
157
- f"You can create one at {settings.app_url}/{settings.workspace}/global-inference-network/models/create\n"
158
- "Add it to your agent spec\n"
159
- "agent={\n"
160
- ' "metadata": {\n'
161
- f' "name": "{agent.metadata.name}",\n'
162
- " },\n"
163
- ' "spec": {\n'
164
- ' "model": "MODEL_NAME",\n'
165
- f' "description": "{agent.spec.description}",\n'
166
- f' "prompt": "{agent.spec.prompt}",\n'
167
- " },\n"
168
- "}")
169
- if isinstance(chat_model, OpenAIVoiceReactAgent):
170
- _agent = chat_model
171
- else:
172
- memory = MemorySaver()
173
- if len(functions) == 0:
174
- raise ValueError("You can define this function in directory "
175
- f'"{settings.agent.functions_directory}". Here is a sample function you can use:\n\n'
176
- "from beamlit.functions import function\n\n"
177
- "@function()\n"
178
- "def hello_world(query: str):\n"
179
- " return 'Hello, world!'\n")
180
- try:
181
- _agent = create_react_agent(chat_model, functions, checkpointer=memory, state_modifier=agent.spec.prompt or "")
182
- except AttributeError: # special case for azure-marketplace where it uses the old OpenAI interface (no tools)
183
- logger.warning("Using the old OpenAI interface for Azure Marketplace, no tools available")
184
- _agent = create_react_agent(chat_model, [], checkpointer=memory, state_modifier=agent.spec.prompt or "")
185
-
186
- settings.agent.agent = _agent
187
- else:
188
- settings.agent.agent = override_agent
189
202
  return wrapper
190
203
  except Exception as e:
191
204
  logger.error(f"Error in agent decorator: {e!s} at line {e.__traceback__.tb_lineno}")
beamlit/agents/thread.py CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Defines threading capabilities for agents.
4
4
  """
5
- import jwt
6
5
  from fastapi import Request
7
6
 
8
7
 
@@ -18,11 +17,8 @@ def get_default_thread(request: Request) -> str:
18
17
  Returns:
19
18
  str: The extracted thread identifier. Returns an empty string if no valid identifier is found.
20
19
  """
21
- if request.headers.get("X-Beamlit-Sub"):
22
- return request.headers.get("X-Beamlit-Sub")
23
- authorization = request.headers.get("Authorization", request.headers.get("X-Beamlit-Authorization"))
24
- if authorization and len(authorization.split("Bearer ")) > 1:
25
- token = authorization.split(" ")[1]
26
- decoded = jwt.decode(token, options={"verify_signature": False})
27
- return decoded["sub"]
28
- return ""
20
+ if request.headers.get("X-Beamlit-Thread-Id"):
21
+ return request.headers.get("X-Beamlit-Thread-Id")
22
+ if request.headers.get("Thread-Id"):
23
+ return request.headers.get("Thread-Id")
24
+ return ""
@@ -6,24 +6,15 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.agent import Agent
9
- from ...types import UNSET, Response
9
+ from ...types import Response
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
13
  agent_name: str,
14
- *,
15
- environment: str,
16
14
  ) -> 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
-
23
15
  _kwargs: dict[str, Any] = {
24
16
  "method": "delete",
25
17
  "url": f"/agents/{agent_name}",
26
- "params": params,
27
18
  }
28
19
 
29
20
  return _kwargs
@@ -53,13 +44,11 @@ def sync_detailed(
53
44
  agent_name: str,
54
45
  *,
55
46
  client: AuthenticatedClient,
56
- environment: str,
57
47
  ) -> Response[Agent]:
58
48
  """Delete agent by name
59
49
 
60
50
  Args:
61
51
  agent_name (str):
62
- environment (str):
63
52
 
64
53
  Raises:
65
54
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -71,7 +60,6 @@ def sync_detailed(
71
60
 
72
61
  kwargs = _get_kwargs(
73
62
  agent_name=agent_name,
74
- environment=environment,
75
63
  )
76
64
 
77
65
  response = client.get_httpx_client().request(
@@ -85,13 +73,11 @@ def sync(
85
73
  agent_name: str,
86
74
  *,
87
75
  client: AuthenticatedClient,
88
- environment: str,
89
76
  ) -> Optional[Agent]:
90
77
  """Delete agent by name
91
78
 
92
79
  Args:
93
80
  agent_name (str):
94
- environment (str):
95
81
 
96
82
  Raises:
97
83
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -104,7 +90,6 @@ def sync(
104
90
  return sync_detailed(
105
91
  agent_name=agent_name,
106
92
  client=client,
107
- environment=environment,
108
93
  ).parsed
109
94
 
110
95
 
@@ -112,13 +97,11 @@ async def asyncio_detailed(
112
97
  agent_name: str,
113
98
  *,
114
99
  client: AuthenticatedClient,
115
- environment: str,
116
100
  ) -> Response[Agent]:
117
101
  """Delete agent by name
118
102
 
119
103
  Args:
120
104
  agent_name (str):
121
- environment (str):
122
105
 
123
106
  Raises:
124
107
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -130,7 +113,6 @@ async def asyncio_detailed(
130
113
 
131
114
  kwargs = _get_kwargs(
132
115
  agent_name=agent_name,
133
- environment=environment,
134
116
  )
135
117
 
136
118
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -142,13 +124,11 @@ async def asyncio(
142
124
  agent_name: str,
143
125
  *,
144
126
  client: AuthenticatedClient,
145
- environment: str,
146
127
  ) -> Optional[Agent]:
147
128
  """Delete agent by name
148
129
 
149
130
  Args:
150
131
  agent_name (str):
151
- environment (str):
152
132
 
153
133
  Raises:
154
134
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -162,6 +142,5 @@ async def asyncio(
162
142
  await asyncio_detailed(
163
143
  agent_name=agent_name,
164
144
  client=client,
165
- environment=environment,
166
145
  )
167
146
  ).parsed
@@ -6,24 +6,15 @@ import httpx
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
8
  from ...models.agent import Agent
9
- from ...types import UNSET, Response, Unset
9
+ from ...types import Response
10
10
 
11
11
 
12
12
  def _get_kwargs(
13
13
  agent_name: str,
14
- *,
15
- environment: Union[Unset, str] = UNSET,
16
14
  ) -> 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
-
23
15
  _kwargs: dict[str, Any] = {
24
16
  "method": "get",
25
17
  "url": f"/agents/{agent_name}",
26
- "params": params,
27
18
  }
28
19
 
29
20
  return _kwargs
@@ -53,13 +44,11 @@ def sync_detailed(
53
44
  agent_name: str,
54
45
  *,
55
46
  client: AuthenticatedClient,
56
- environment: Union[Unset, str] = UNSET,
57
47
  ) -> Response[Agent]:
58
48
  """Get agent by name
59
49
 
60
50
  Args:
61
51
  agent_name (str):
62
- environment (Union[Unset, str]):
63
52
 
64
53
  Raises:
65
54
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -71,7 +60,6 @@ def sync_detailed(
71
60
 
72
61
  kwargs = _get_kwargs(
73
62
  agent_name=agent_name,
74
- environment=environment,
75
63
  )
76
64
 
77
65
  response = client.get_httpx_client().request(
@@ -85,13 +73,11 @@ def sync(
85
73
  agent_name: str,
86
74
  *,
87
75
  client: AuthenticatedClient,
88
- environment: Union[Unset, str] = UNSET,
89
76
  ) -> Optional[Agent]:
90
77
  """Get agent by name
91
78
 
92
79
  Args:
93
80
  agent_name (str):
94
- environment (Union[Unset, str]):
95
81
 
96
82
  Raises:
97
83
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -104,7 +90,6 @@ def sync(
104
90
  return sync_detailed(
105
91
  agent_name=agent_name,
106
92
  client=client,
107
- environment=environment,
108
93
  ).parsed
109
94
 
110
95
 
@@ -112,13 +97,11 @@ async def asyncio_detailed(
112
97
  agent_name: str,
113
98
  *,
114
99
  client: AuthenticatedClient,
115
- environment: Union[Unset, str] = UNSET,
116
100
  ) -> Response[Agent]:
117
101
  """Get agent by name
118
102
 
119
103
  Args:
120
104
  agent_name (str):
121
- environment (Union[Unset, str]):
122
105
 
123
106
  Raises:
124
107
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -130,7 +113,6 @@ async def asyncio_detailed(
130
113
 
131
114
  kwargs = _get_kwargs(
132
115
  agent_name=agent_name,
133
- environment=environment,
134
116
  )
135
117
 
136
118
  response = await client.get_async_httpx_client().request(**kwargs)
@@ -142,13 +124,11 @@ async def asyncio(
142
124
  agent_name: str,
143
125
  *,
144
126
  client: AuthenticatedClient,
145
- environment: Union[Unset, str] = UNSET,
146
127
  ) -> Optional[Agent]:
147
128
  """Get agent by name
148
129
 
149
130
  Args:
150
131
  agent_name (str):
151
- environment (Union[Unset, str]):
152
132
 
153
133
  Raises:
154
134
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
@@ -162,6 +142,5 @@ async def asyncio(
162
142
  await asyncio_detailed(
163
143
  agent_name=agent_name,
164
144
  client=client,
165
- environment=environment,
166
145
  )
167
146
  ).parsed