beamlit 0.0.56rc106__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.
- beamlit/agents/chain.py +0 -2
- beamlit/agents/chat.py +20 -8
- beamlit/agents/decorator.py +112 -99
- beamlit/agents/thread.py +5 -9
- beamlit/api/agents/delete_agent.py +1 -22
- beamlit/api/agents/get_agent.py +1 -22
- beamlit/api/agents/get_agent_metrics.py +13 -34
- beamlit/api/agents/get_agent_trace_ids.py +44 -14
- beamlit/api/agents/{list_agent_history.py → list_agent_revisions.py} +21 -17
- beamlit/api/agents/list_agents.py +4 -36
- beamlit/api/default/get_trace_ids.py +0 -15
- beamlit/api/default/list_mcp_hub_definitions.py +12 -12
- beamlit/api/functions/delete_function.py +1 -22
- beamlit/api/functions/get_function.py +1 -22
- beamlit/api/functions/get_function_metrics.py +13 -34
- beamlit/api/functions/get_function_trace_ids.py +44 -14
- beamlit/api/functions/{create_function_release.py → list_function_revisions.py} +26 -18
- beamlit/api/functions/list_functions.py +4 -36
- beamlit/api/knowledgebases/create_knowledgebase.py +4 -4
- beamlit/api/knowledgebases/delete_knowledgebase.py +5 -26
- beamlit/api/knowledgebases/get_knowledgebase.py +1 -22
- beamlit/api/{environments/get_environment_metrics.py → knowledgebases/list_knowledgebase_revisions.py} +34 -34
- beamlit/api/knowledgebases/list_knowledgebases.py +4 -36
- beamlit/api/models/create_model.py +4 -8
- beamlit/api/models/delete_model.py +1 -22
- beamlit/api/models/get_model.py +1 -22
- beamlit/api/models/get_model_metrics.py +13 -34
- beamlit/api/models/get_model_trace_ids.py +44 -14
- beamlit/api/models/{release_model.py → list_model_revisions.py} +26 -22
- beamlit/api/models/list_models.py +4 -36
- beamlit/api/models/update_model.py +4 -8
- beamlit/authentication/authentication.py +11 -8
- beamlit/authentication/clientcredentials.py +15 -28
- beamlit/authentication/credentials.py +2 -7
- beamlit/common/settings.py +1 -4
- beamlit/deploy/deploy.py +15 -9
- beamlit/functions/common.py +16 -16
- beamlit/functions/local/local.py +4 -5
- beamlit/functions/mcp/client.py +96 -0
- beamlit/functions/mcp/mcp.py +56 -43
- beamlit/functions/remote/remote.py +9 -11
- beamlit/models/__init__.py +8 -38
- beamlit/models/agent.py +6 -6
- beamlit/models/function.py +6 -6
- beamlit/models/knowledgebase.py +6 -6
- beamlit/models/last_n_requests_metric.py +0 -9
- beamlit/models/model.py +7 -7
- beamlit/models/{resource_environment_metrics.py → resource_metrics.py} +20 -26
- beamlit/models/{resource_environment_metrics_request_total_per_code.py → resource_metrics_request_total_per_code.py} +5 -5
- beamlit/models/{resource_environment_metrics_rps_per_code.py → resource_metrics_rps_per_code.py} +5 -5
- beamlit/models/{model_release.py → revision_metadata.py} +20 -20
- beamlit/models/runtime.py +2 -2
- beamlit/models/workspace.py +0 -9
- beamlit/run.py +3 -7
- beamlit/serve/app.py +4 -8
- {beamlit-0.0.56rc106.dist-info → beamlit-0.0.57.dist-info}/METADATA +2 -1
- {beamlit-0.0.56rc106.dist-info → beamlit-0.0.57.dist-info}/RECORD +63 -91
- beamlit/api/agents/create_agent_release.py +0 -146
- beamlit/api/agents/delete_agent_history.py +0 -155
- beamlit/api/agents/get_agent_history.py +0 -155
- beamlit/api/agents/put_agent_history.py +0 -181
- beamlit/api/environments/__init__.py +0 -0
- beamlit/api/environments/create_environment.py +0 -167
- beamlit/api/environments/delete_environment.py +0 -154
- beamlit/api/environments/get_environment.py +0 -154
- beamlit/api/environments/list_environments.py +0 -139
- beamlit/api/environments/update_environment.py +0 -180
- beamlit/api/generation/__init__.py +0 -0
- beamlit/api/generation/run_information_generation_agent.py +0 -168
- beamlit/api/history/__init__.py +0 -0
- beamlit/api/history/get_agents_history.py +0 -155
- beamlit/api/history/list_agents_history.py +0 -131
- beamlit/models/agent_history.py +0 -167
- beamlit/models/agent_history_event.py +0 -133
- beamlit/models/agent_information_request.py +0 -63
- beamlit/models/agent_information_response.py +0 -79
- beamlit/models/agent_release.py +0 -70
- beamlit/models/environment.py +0 -96
- beamlit/models/environment_metadata.py +0 -148
- beamlit/models/environment_metrics.py +0 -77
- beamlit/models/environment_spec.py +0 -63
- beamlit/models/function_release.py +0 -70
- beamlit/models/knowledgebase_release.py +0 -70
- beamlit/models/mcp_hub_artifact.py +0 -188
- beamlit/models/mcp_hub_artifact_entrypoint.py +0 -45
- beamlit/models/mcp_hub_artifact_form.py +0 -45
- /beamlit/api/agents/{get_agent_environment_logs.py → get_agent_logs.py} +0 -0
- /beamlit/api/functions/{get_function_environment_logs.py → get_function_logs.py} +0 -0
- /beamlit/api/models/{get_model_environment_logs.py → get_model_logs.py} +0 -0
- {beamlit-0.0.56rc106.dist-info → beamlit-0.0.57.dist-info}/WHEEL +0 -0
- {beamlit-0.0.56rc106.dist-info → beamlit-0.0.57.dist-info}/entry_points.txt +0 -0
- {beamlit-0.0.56rc106.dist-info → beamlit-0.0.57.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,96 @@
|
|
1
|
+
import logging
|
2
|
+
from contextlib import asynccontextmanager
|
3
|
+
from typing import Any
|
4
|
+
from urllib.parse import urljoin, urlparse
|
5
|
+
|
6
|
+
import anyio
|
7
|
+
import mcp.types as types
|
8
|
+
from anyio.abc import TaskStatus
|
9
|
+
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
|
10
|
+
from websockets.client import WebSocketClientProtocol
|
11
|
+
from websockets.client import connect as ws_connect
|
12
|
+
|
13
|
+
logger = logging.getLogger(__name__)
|
14
|
+
|
15
|
+
|
16
|
+
def remove_request_params(url: str) -> str:
|
17
|
+
return urljoin(url, urlparse(url).path)
|
18
|
+
|
19
|
+
|
20
|
+
@asynccontextmanager
|
21
|
+
async def websocket_client(
|
22
|
+
url: str,
|
23
|
+
headers: dict[str, Any] | None = None,
|
24
|
+
timeout: float = 5,
|
25
|
+
):
|
26
|
+
"""
|
27
|
+
Client transport for WebSocket.
|
28
|
+
|
29
|
+
The `timeout` parameter controls connection timeout.
|
30
|
+
"""
|
31
|
+
read_stream: MemoryObjectReceiveStream[types.JSONRPCMessage | Exception]
|
32
|
+
read_stream_writer: MemoryObjectSendStream[types.JSONRPCMessage | Exception]
|
33
|
+
|
34
|
+
write_stream: MemoryObjectSendStream[types.JSONRPCMessage]
|
35
|
+
write_stream_reader: MemoryObjectReceiveStream[types.JSONRPCMessage]
|
36
|
+
|
37
|
+
read_stream_writer, read_stream = anyio.create_memory_object_stream(0)
|
38
|
+
write_stream, write_stream_reader = anyio.create_memory_object_stream(0)
|
39
|
+
|
40
|
+
async with anyio.create_task_group() as tg:
|
41
|
+
try:
|
42
|
+
# Convert http(s):// to ws(s)://
|
43
|
+
ws_url = url.replace("http://", "ws://").replace("https://", "wss://")
|
44
|
+
logger.debug(f"Connecting to WebSocket endpoint: {remove_request_params(ws_url)}")
|
45
|
+
|
46
|
+
async with ws_connect(ws_url, extra_headers=headers, open_timeout=timeout) as websocket:
|
47
|
+
logger.debug("WebSocket connection established")
|
48
|
+
|
49
|
+
async def ws_reader(
|
50
|
+
websocket: WebSocketClientProtocol,
|
51
|
+
task_status: TaskStatus[None] = anyio.TASK_STATUS_IGNORED,
|
52
|
+
):
|
53
|
+
try:
|
54
|
+
task_status.started()
|
55
|
+
async for message in websocket:
|
56
|
+
logger.debug(f"Received WebSocket message: {message}")
|
57
|
+
try:
|
58
|
+
parsed_message = types.JSONRPCMessage.model_validate_json(message)
|
59
|
+
logger.debug(f"Received server message: {parsed_message}")
|
60
|
+
await read_stream_writer.send(parsed_message)
|
61
|
+
except Exception as exc:
|
62
|
+
logger.error(f"Error parsing server message: {exc}")
|
63
|
+
await read_stream_writer.send(exc)
|
64
|
+
except Exception as exc:
|
65
|
+
logger.error(f"Error in ws_reader: {exc}")
|
66
|
+
await read_stream_writer.send(exc)
|
67
|
+
finally:
|
68
|
+
await read_stream_writer.aclose()
|
69
|
+
|
70
|
+
async def ws_writer(websocket: WebSocketClientProtocol):
|
71
|
+
try:
|
72
|
+
async with write_stream_reader:
|
73
|
+
async for message in write_stream_reader:
|
74
|
+
logger.debug(f"Sending client message: {message}")
|
75
|
+
await websocket.send(
|
76
|
+
message.model_dump_json(
|
77
|
+
by_alias=True,
|
78
|
+
exclude_none=True,
|
79
|
+
)
|
80
|
+
)
|
81
|
+
logger.debug("Client message sent successfully")
|
82
|
+
except Exception as exc:
|
83
|
+
logger.error(f"Error in ws_writer: {exc}")
|
84
|
+
finally:
|
85
|
+
await write_stream.aclose()
|
86
|
+
|
87
|
+
await tg.start(ws_reader, websocket)
|
88
|
+
tg.start_soon(ws_writer, websocket)
|
89
|
+
|
90
|
+
try:
|
91
|
+
yield read_stream, write_stream
|
92
|
+
finally:
|
93
|
+
tg.cancel_scope.cancel()
|
94
|
+
finally:
|
95
|
+
await read_stream_writer.aclose()
|
96
|
+
await write_stream.aclose()
|
beamlit/functions/mcp/mcp.py
CHANGED
@@ -14,11 +14,12 @@ import requests
|
|
14
14
|
import typing_extensions as t
|
15
15
|
from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
|
16
16
|
from mcp import ClientSession
|
17
|
-
from mcp.client.sse import sse_client
|
18
17
|
from mcp.types import CallToolResult, ListToolsResult
|
19
18
|
|
19
|
+
from beamlit.authentication import get_authentication_headers
|
20
20
|
from beamlit.authentication.authentication import AuthenticatedClient
|
21
21
|
from beamlit.common.settings import get_settings
|
22
|
+
from beamlit.functions.mcp.client import websocket_client
|
22
23
|
|
23
24
|
from .utils import create_schema_model
|
24
25
|
|
@@ -28,63 +29,67 @@ logger = logging.getLogger(__name__)
|
|
28
29
|
|
29
30
|
|
30
31
|
class MCPClient:
|
31
|
-
def __init__(self, client: AuthenticatedClient, url: str):
|
32
|
+
def __init__(self, client: AuthenticatedClient, url: str, fallback_url: str | None = None):
|
32
33
|
self.client = client
|
33
34
|
self.url = url
|
34
|
-
self.
|
35
|
+
self.fallback_url = fallback_url
|
35
36
|
|
36
|
-
async def
|
37
|
-
|
37
|
+
async def list_ws_tools(self, is_fallback: bool = False) -> ListToolsResult:
|
38
|
+
if is_fallback:
|
39
|
+
url = self.fallback_url
|
40
|
+
else:
|
41
|
+
url = self.url
|
38
42
|
try:
|
39
|
-
async with
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
+
async with websocket_client(url, headers=get_authentication_headers(settings)) as (read_stream, write_stream):
|
44
|
+
logger.debug("WebSocket connection established")
|
45
|
+
async with ClientSession(read_stream, write_stream) as client:
|
46
|
+
await client.initialize()
|
47
|
+
response = await client.list_tools()
|
48
|
+
logger.debug(f"WebSocket tools: {response}")
|
43
49
|
return response
|
44
|
-
except Exception:
|
45
|
-
|
46
|
-
logger.
|
50
|
+
except Exception as e:
|
51
|
+
logger.error(f"Error listing tools: {e}")
|
52
|
+
logger.debug("WebSocket not available, trying HTTP")
|
47
53
|
return None # Signal to list_tools() to try HTTP instead
|
48
54
|
|
49
|
-
def list_tools(self) -> ListToolsResult:
|
55
|
+
async def list_tools(self) -> ListToolsResult:
|
56
|
+
logger.debug(f"Listing tools for {self.url}")
|
50
57
|
try:
|
51
|
-
|
52
|
-
result = loop.run_until_complete(self.list_sse_tools())
|
53
|
-
if result is None: # SSE failed, try HTTP
|
54
|
-
raise Exception("SSE failed")
|
55
|
-
self._sse = True
|
58
|
+
result = await self.list_ws_tools(is_fallback=False)
|
56
59
|
return result
|
57
|
-
except Exception:
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
60
|
+
except Exception as e: # Fallback to Public endpoint
|
61
|
+
if self.fallback_url:
|
62
|
+
try:
|
63
|
+
result = await self.list_ws_tools(is_fallback=True)
|
64
|
+
return result
|
65
|
+
except Exception as e:
|
66
|
+
raise e
|
67
|
+
else:
|
68
|
+
raise e
|
69
|
+
|
62
70
|
|
63
71
|
async def call_tool(
|
64
72
|
self,
|
65
73
|
tool_name: str,
|
66
74
|
arguments: dict[str, Any] = None,
|
75
|
+
is_fallback: bool = False,
|
67
76
|
) -> requests.Response | AsyncIterator[CallToolResult]:
|
68
|
-
if
|
69
|
-
|
77
|
+
if is_fallback:
|
78
|
+
url = self.fallback_url
|
79
|
+
else:
|
80
|
+
url = self.url
|
81
|
+
try:
|
82
|
+
async with websocket_client(url, headers=get_authentication_headers(settings)) as (read_stream, write_stream):
|
70
83
|
async with ClientSession(read_stream, write_stream) as session:
|
71
84
|
await session.initialize()
|
72
85
|
response = await session.call_tool(tool_name, arguments or {})
|
73
86
|
content = pydantic_core.to_json(response).decode()
|
87
|
+
if response.isError:
|
88
|
+
raise ToolException(content)
|
74
89
|
return content
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
"POST",
|
79
|
-
f"{self.url}/tools/call",
|
80
|
-
json={"name": tool_name, "arguments": arguments},
|
81
|
-
)
|
82
|
-
response.raise_for_status()
|
83
|
-
result = CallToolResult(response.json())
|
84
|
-
if result.isError:
|
85
|
-
raise ToolException(result.content)
|
86
|
-
content = pydantic_core.to_json(result.content).decode()
|
87
|
-
return content
|
90
|
+
except Exception as e:
|
91
|
+
raise e
|
92
|
+
|
88
93
|
|
89
94
|
class MCPTool(BaseTool):
|
90
95
|
"""
|
@@ -93,7 +98,6 @@ class MCPTool(BaseTool):
|
|
93
98
|
Attributes:
|
94
99
|
client (MCPClient): The MCP client instance.
|
95
100
|
handle_tool_error (bool | str | Callable[[ToolException], str] | None): Error handling strategy.
|
96
|
-
sse (bool): Whether to use SSE streaming for responses.
|
97
101
|
"""
|
98
102
|
|
99
103
|
client: MCPClient
|
@@ -109,7 +113,16 @@ class MCPTool(BaseTool):
|
|
109
113
|
|
110
114
|
@t.override
|
111
115
|
async def _arun(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
|
112
|
-
|
116
|
+
try:
|
117
|
+
return await self.client.call_tool(self.name, arguments=kwargs)
|
118
|
+
except Exception as e:
|
119
|
+
if self.client.fallback_url:
|
120
|
+
try:
|
121
|
+
return await self.client.call_tool(self.name, arguments=kwargs, is_fallback=True) # Fallback to Public endpoint
|
122
|
+
except Exception as e:
|
123
|
+
raise e
|
124
|
+
else:
|
125
|
+
raise e
|
113
126
|
|
114
127
|
@t.override
|
115
128
|
@property
|
@@ -132,14 +145,14 @@ class MCPToolkit(BaseToolkit):
|
|
132
145
|
_tools: ListToolsResult | None = None
|
133
146
|
model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)
|
134
147
|
|
135
|
-
def initialize(self) -> None:
|
148
|
+
async def initialize(self) -> None:
|
136
149
|
"""Initialize the session and retrieve tools list"""
|
137
150
|
if self._tools is None:
|
138
|
-
response = self.client.list_tools()
|
151
|
+
response = await self.client.list_tools()
|
139
152
|
self._tools = response
|
140
153
|
|
141
154
|
@t.override
|
142
|
-
def get_tools(self) -> list[BaseTool]:
|
155
|
+
async def get_tools(self) -> list[BaseTool]:
|
143
156
|
if self._tools is None:
|
144
157
|
raise RuntimeError("Must initialize the toolkit first")
|
145
158
|
|
@@ -80,14 +80,12 @@ class RemoteTool(BaseTool):
|
|
80
80
|
|
81
81
|
@t.override
|
82
82
|
async def _arun(self, *args: t.Any, **kwargs: t.Any) -> t.Any:
|
83
|
-
settings = get_settings()
|
84
83
|
body = {**kwargs}
|
85
84
|
if self.kit:
|
86
85
|
body["name"] = self.name
|
87
86
|
result = self.client.run(
|
88
87
|
"function",
|
89
88
|
self.resource_name,
|
90
|
-
settings.environment,
|
91
89
|
"POST",
|
92
90
|
cloud=self.cloud,
|
93
91
|
service_name=self.service_name,
|
@@ -117,12 +115,11 @@ class RemoteToolkit:
|
|
117
115
|
_service_name: str | None = None
|
118
116
|
model_config = pydantic.ConfigDict(arbitrary_types_allowed=True)
|
119
117
|
|
120
|
-
def initialize(self) -> None:
|
118
|
+
async def initialize(self) -> None:
|
121
119
|
"""Initialize the session and retrieve the remote function details."""
|
122
|
-
settings = get_settings()
|
123
120
|
if self._function is None:
|
124
121
|
try:
|
125
|
-
response = get_function.sync_detailed(self.function, client=self.client
|
122
|
+
response = get_function.sync_detailed(self.function, client=self.client)
|
126
123
|
function_name = self.function.upper().replace("-", "_")
|
127
124
|
if os.getenv(f"BL_FUNCTION_{function_name}_SERVICE_NAME"):
|
128
125
|
self._service_name = os.getenv(f"BL_FUNCTION_{function_name}_SERVICE_NAME")
|
@@ -130,7 +127,6 @@ class RemoteToolkit:
|
|
130
127
|
except UnexpectedStatus as e:
|
131
128
|
functions = list_functions.sync_detailed(
|
132
129
|
client=self.client,
|
133
|
-
environment=settings.environment,
|
134
130
|
).parsed
|
135
131
|
names = [
|
136
132
|
f.metadata.name
|
@@ -140,19 +136,21 @@ class RemoteToolkit:
|
|
140
136
|
f"error: {e.status_code}. Available functions: {', '.join(names)}"
|
141
137
|
)
|
142
138
|
|
143
|
-
def get_tools(self) -> list[BaseTool]:
|
139
|
+
async def get_tools(self) -> list[BaseTool]:
|
144
140
|
settings = get_settings()
|
145
141
|
if self._function is None:
|
146
142
|
raise RuntimeError("Must initialize the toolkit first")
|
147
143
|
|
148
144
|
if self._function.spec.integration_connections:
|
145
|
+
fallback_url = None
|
149
146
|
url = f"{settings.run_url}/{settings.workspace}/functions/{self._function.metadata.name}"
|
150
147
|
if self._service_name:
|
148
|
+
fallback_url = f"https://{self._service_name}.{settings.run_internal_hostname}"
|
151
149
|
url = f"https://{self._service_name}.{settings.run_internal_hostname}"
|
152
|
-
mcp_client = MCPClient(self.client, url)
|
153
|
-
mcp_toolkit = MCPToolkit(client=mcp_client)
|
154
|
-
mcp_toolkit.initialize()
|
155
|
-
return mcp_toolkit.get_tools()
|
150
|
+
mcp_client = MCPClient(self.client, url, fallback_url)
|
151
|
+
mcp_toolkit = MCPToolkit(client=mcp_client, url=url)
|
152
|
+
await mcp_toolkit.initialize()
|
153
|
+
return await mcp_toolkit.get_tools()
|
156
154
|
|
157
155
|
if self._function.spec.kit:
|
158
156
|
return [
|
beamlit/models/__init__.py
CHANGED
@@ -3,11 +3,6 @@
|
|
3
3
|
from .acl import ACL
|
4
4
|
from .agent import Agent
|
5
5
|
from .agent_chain import AgentChain
|
6
|
-
from .agent_history import AgentHistory
|
7
|
-
from .agent_history_event import AgentHistoryEvent
|
8
|
-
from .agent_information_request import AgentInformationRequest
|
9
|
-
from .agent_information_response import AgentInformationResponse
|
10
|
-
from .agent_release import AgentRelease
|
11
6
|
from .agent_spec import AgentSpec
|
12
7
|
from .api_key import ApiKey
|
13
8
|
from .configuration import Configuration
|
@@ -22,10 +17,6 @@ from .create_workspace_service_account_response_200 import CreateWorkspaceServic
|
|
22
17
|
from .delete_workspace_service_account_response_200 import DeleteWorkspaceServiceAccountResponse200
|
23
18
|
from .entrypoint import Entrypoint
|
24
19
|
from .entrypoint_env import EntrypointEnv
|
25
|
-
from .environment import Environment
|
26
|
-
from .environment_metadata import EnvironmentMetadata
|
27
|
-
from .environment_metrics import EnvironmentMetrics
|
28
|
-
from .environment_spec import EnvironmentSpec
|
29
20
|
from .flavor import Flavor
|
30
21
|
from .form import Form
|
31
22
|
from .form_config import FormConfig
|
@@ -33,7 +24,6 @@ from .form_oauthomitempty import FormOauthomitempty
|
|
33
24
|
from .form_secrets import FormSecrets
|
34
25
|
from .function import Function
|
35
26
|
from .function_kit import FunctionKit
|
36
|
-
from .function_release import FunctionRelease
|
37
27
|
from .function_spec import FunctionSpec
|
38
28
|
from .get_trace_ids_response_200 import GetTraceIdsResponse200
|
39
29
|
from .get_trace_logs_response_200 import GetTraceLogsResponse200
|
@@ -51,7 +41,6 @@ from .integration_model import IntegrationModel
|
|
51
41
|
from .integration_repository import IntegrationRepository
|
52
42
|
from .invite_workspace_user_body import InviteWorkspaceUserBody
|
53
43
|
from .knowledgebase import Knowledgebase
|
54
|
-
from .knowledgebase_release import KnowledgebaseRelease
|
55
44
|
from .knowledgebase_spec import KnowledgebaseSpec
|
56
45
|
from .knowledgebase_spec_options import KnowledgebaseSpecOptions
|
57
46
|
from .last_n_requests_metric import LastNRequestsMetric
|
@@ -60,9 +49,6 @@ from .location_response import LocationResponse
|
|
60
49
|
from .mcp_definition import MCPDefinition
|
61
50
|
from .mcp_definition_entrypoint import MCPDefinitionEntrypoint
|
62
51
|
from .mcp_definition_form import MCPDefinitionForm
|
63
|
-
from .mcp_hub_artifact import MCPHubArtifact
|
64
|
-
from .mcp_hub_artifact_entrypoint import MCPHubArtifactEntrypoint
|
65
|
-
from .mcp_hub_artifact_form import MCPHubArtifactForm
|
66
52
|
from .metadata import Metadata
|
67
53
|
from .metadata_labels import MetadataLabels
|
68
54
|
from .metric import Metric
|
@@ -72,7 +58,6 @@ from .metrics_request_total_per_code import MetricsRequestTotalPerCode
|
|
72
58
|
from .metrics_rps_per_code import MetricsRpsPerCode
|
73
59
|
from .model import Model
|
74
60
|
from .model_private_cluster import ModelPrivateCluster
|
75
|
-
from .model_release import ModelRelease
|
76
61
|
from .model_spec import ModelSpec
|
77
62
|
from .o_auth import OAuth
|
78
63
|
from .owner_fields import OwnerFields
|
@@ -102,12 +87,11 @@ from .request_total_by_origin_metric_request_total_by_origin_and_code import (
|
|
102
87
|
from .request_total_metric import RequestTotalMetric
|
103
88
|
from .request_total_metric_request_total_per_code import RequestTotalMetricRequestTotalPerCode
|
104
89
|
from .request_total_metric_rps_per_code import RequestTotalMetricRpsPerCode
|
105
|
-
from .resource_environment_metrics import ResourceEnvironmentMetrics
|
106
|
-
from .resource_environment_metrics_request_total_per_code import (
|
107
|
-
ResourceEnvironmentMetricsRequestTotalPerCode,
|
108
|
-
)
|
109
|
-
from .resource_environment_metrics_rps_per_code import ResourceEnvironmentMetricsRpsPerCode
|
110
90
|
from .resource_log import ResourceLog
|
91
|
+
from .resource_metrics import ResourceMetrics
|
92
|
+
from .resource_metrics_request_total_per_code import ResourceMetricsRequestTotalPerCode
|
93
|
+
from .resource_metrics_rps_per_code import ResourceMetricsRpsPerCode
|
94
|
+
from .revision_metadata import RevisionMetadata
|
111
95
|
from .runtime import Runtime
|
112
96
|
from .runtime_readiness_probe import RuntimeReadinessProbe
|
113
97
|
from .runtime_resources import RuntimeResources
|
@@ -138,11 +122,6 @@ __all__ = (
|
|
138
122
|
"ACL",
|
139
123
|
"Agent",
|
140
124
|
"AgentChain",
|
141
|
-
"AgentHistory",
|
142
|
-
"AgentHistoryEvent",
|
143
|
-
"AgentInformationRequest",
|
144
|
-
"AgentInformationResponse",
|
145
|
-
"AgentRelease",
|
146
125
|
"AgentSpec",
|
147
126
|
"ApiKey",
|
148
127
|
"Configuration",
|
@@ -157,10 +136,6 @@ __all__ = (
|
|
157
136
|
"DeleteWorkspaceServiceAccountResponse200",
|
158
137
|
"Entrypoint",
|
159
138
|
"EntrypointEnv",
|
160
|
-
"Environment",
|
161
|
-
"EnvironmentMetadata",
|
162
|
-
"EnvironmentMetrics",
|
163
|
-
"EnvironmentSpec",
|
164
139
|
"Flavor",
|
165
140
|
"Form",
|
166
141
|
"FormConfig",
|
@@ -168,7 +143,6 @@ __all__ = (
|
|
168
143
|
"FormSecrets",
|
169
144
|
"Function",
|
170
145
|
"FunctionKit",
|
171
|
-
"FunctionRelease",
|
172
146
|
"FunctionSpec",
|
173
147
|
"GetTraceIdsResponse200",
|
174
148
|
"GetTraceLogsResponse200",
|
@@ -184,7 +158,6 @@ __all__ = (
|
|
184
158
|
"IntegrationRepository",
|
185
159
|
"InviteWorkspaceUserBody",
|
186
160
|
"Knowledgebase",
|
187
|
-
"KnowledgebaseRelease",
|
188
161
|
"KnowledgebaseSpec",
|
189
162
|
"KnowledgebaseSpecOptions",
|
190
163
|
"LastNRequestsMetric",
|
@@ -193,9 +166,6 @@ __all__ = (
|
|
193
166
|
"MCPDefinition",
|
194
167
|
"MCPDefinitionEntrypoint",
|
195
168
|
"MCPDefinitionForm",
|
196
|
-
"MCPHubArtifact",
|
197
|
-
"MCPHubArtifactEntrypoint",
|
198
|
-
"MCPHubArtifactForm",
|
199
169
|
"Metadata",
|
200
170
|
"MetadataLabels",
|
201
171
|
"Metric",
|
@@ -205,7 +175,6 @@ __all__ = (
|
|
205
175
|
"MetricsRpsPerCode",
|
206
176
|
"Model",
|
207
177
|
"ModelPrivateCluster",
|
208
|
-
"ModelRelease",
|
209
178
|
"ModelSpec",
|
210
179
|
"OAuth",
|
211
180
|
"OwnerFields",
|
@@ -231,10 +200,11 @@ __all__ = (
|
|
231
200
|
"RequestTotalMetric",
|
232
201
|
"RequestTotalMetricRequestTotalPerCode",
|
233
202
|
"RequestTotalMetricRpsPerCode",
|
234
|
-
"ResourceEnvironmentMetrics",
|
235
|
-
"ResourceEnvironmentMetricsRequestTotalPerCode",
|
236
|
-
"ResourceEnvironmentMetricsRpsPerCode",
|
237
203
|
"ResourceLog",
|
204
|
+
"ResourceMetrics",
|
205
|
+
"ResourceMetricsRequestTotalPerCode",
|
206
|
+
"ResourceMetricsRpsPerCode",
|
207
|
+
"RevisionMetadata",
|
238
208
|
"Runtime",
|
239
209
|
"RuntimeReadinessProbe",
|
240
210
|
"RuntimeResources",
|
beamlit/models/agent.py
CHANGED
@@ -8,7 +8,7 @@ from ..types import UNSET, Unset
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.agent_spec import AgentSpec
|
10
10
|
from ..models.core_event import CoreEvent
|
11
|
-
from ..models.
|
11
|
+
from ..models.metadata import Metadata
|
12
12
|
|
13
13
|
|
14
14
|
T = TypeVar("T", bound="Agent")
|
@@ -20,13 +20,13 @@ class Agent:
|
|
20
20
|
|
21
21
|
Attributes:
|
22
22
|
events (Union[Unset, list['CoreEvent']]): Core events
|
23
|
-
metadata (Union[Unset,
|
23
|
+
metadata (Union[Unset, Metadata]): Metadata
|
24
24
|
spec (Union[Unset, AgentSpec]): Agent specification
|
25
25
|
status (Union[Unset, str]): Agent status
|
26
26
|
"""
|
27
27
|
|
28
28
|
events: Union[Unset, list["CoreEvent"]] = UNSET
|
29
|
-
metadata: Union[Unset, "
|
29
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
30
30
|
spec: Union[Unset, "AgentSpec"] = UNSET
|
31
31
|
status: Union[Unset, str] = UNSET
|
32
32
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -71,7 +71,7 @@ class Agent:
|
|
71
71
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
72
72
|
from ..models.agent_spec import AgentSpec
|
73
73
|
from ..models.core_event import CoreEvent
|
74
|
-
from ..models.
|
74
|
+
from ..models.metadata import Metadata
|
75
75
|
|
76
76
|
if not src_dict:
|
77
77
|
return None
|
@@ -84,11 +84,11 @@ class Agent:
|
|
84
84
|
events.append(componentsschemas_core_events_item)
|
85
85
|
|
86
86
|
_metadata = d.pop("metadata", UNSET)
|
87
|
-
metadata: Union[Unset,
|
87
|
+
metadata: Union[Unset, Metadata]
|
88
88
|
if isinstance(_metadata, Unset):
|
89
89
|
metadata = UNSET
|
90
90
|
else:
|
91
|
-
metadata =
|
91
|
+
metadata = Metadata.from_dict(_metadata)
|
92
92
|
|
93
93
|
_spec = d.pop("spec", UNSET)
|
94
94
|
spec: Union[Unset, AgentSpec]
|
beamlit/models/function.py
CHANGED
@@ -7,8 +7,8 @@ from ..types import UNSET, Unset
|
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.core_event import CoreEvent
|
10
|
-
from ..models.environment_metadata import EnvironmentMetadata
|
11
10
|
from ..models.function_spec import FunctionSpec
|
11
|
+
from ..models.metadata import Metadata
|
12
12
|
|
13
13
|
|
14
14
|
T = TypeVar("T", bound="Function")
|
@@ -20,13 +20,13 @@ class Function:
|
|
20
20
|
|
21
21
|
Attributes:
|
22
22
|
events (Union[Unset, list['CoreEvent']]): Core events
|
23
|
-
metadata (Union[Unset,
|
23
|
+
metadata (Union[Unset, Metadata]): Metadata
|
24
24
|
spec (Union[Unset, FunctionSpec]): Function specification
|
25
25
|
status (Union[Unset, str]): Function status
|
26
26
|
"""
|
27
27
|
|
28
28
|
events: Union[Unset, list["CoreEvent"]] = UNSET
|
29
|
-
metadata: Union[Unset, "
|
29
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
30
30
|
spec: Union[Unset, "FunctionSpec"] = UNSET
|
31
31
|
status: Union[Unset, str] = UNSET
|
32
32
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -70,8 +70,8 @@ class Function:
|
|
70
70
|
@classmethod
|
71
71
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
72
72
|
from ..models.core_event import CoreEvent
|
73
|
-
from ..models.environment_metadata import EnvironmentMetadata
|
74
73
|
from ..models.function_spec import FunctionSpec
|
74
|
+
from ..models.metadata import Metadata
|
75
75
|
|
76
76
|
if not src_dict:
|
77
77
|
return None
|
@@ -84,11 +84,11 @@ class Function:
|
|
84
84
|
events.append(componentsschemas_core_events_item)
|
85
85
|
|
86
86
|
_metadata = d.pop("metadata", UNSET)
|
87
|
-
metadata: Union[Unset,
|
87
|
+
metadata: Union[Unset, Metadata]
|
88
88
|
if isinstance(_metadata, Unset):
|
89
89
|
metadata = UNSET
|
90
90
|
else:
|
91
|
-
metadata =
|
91
|
+
metadata = Metadata.from_dict(_metadata)
|
92
92
|
|
93
93
|
_spec = d.pop("spec", UNSET)
|
94
94
|
spec: Union[Unset, FunctionSpec]
|
beamlit/models/knowledgebase.py
CHANGED
@@ -7,8 +7,8 @@ from ..types import UNSET, Unset
|
|
7
7
|
|
8
8
|
if TYPE_CHECKING:
|
9
9
|
from ..models.core_event import CoreEvent
|
10
|
-
from ..models.environment_metadata import EnvironmentMetadata
|
11
10
|
from ..models.knowledgebase_spec import KnowledgebaseSpec
|
11
|
+
from ..models.metadata import Metadata
|
12
12
|
|
13
13
|
|
14
14
|
T = TypeVar("T", bound="Knowledgebase")
|
@@ -20,13 +20,13 @@ class Knowledgebase:
|
|
20
20
|
|
21
21
|
Attributes:
|
22
22
|
events (Union[Unset, list['CoreEvent']]): Core events
|
23
|
-
metadata (Union[Unset,
|
23
|
+
metadata (Union[Unset, Metadata]): Metadata
|
24
24
|
spec (Union[Unset, KnowledgebaseSpec]): Knowledgebase specification
|
25
25
|
status (Union[Unset, str]): Knowledgebase status
|
26
26
|
"""
|
27
27
|
|
28
28
|
events: Union[Unset, list["CoreEvent"]] = UNSET
|
29
|
-
metadata: Union[Unset, "
|
29
|
+
metadata: Union[Unset, "Metadata"] = UNSET
|
30
30
|
spec: Union[Unset, "KnowledgebaseSpec"] = UNSET
|
31
31
|
status: Union[Unset, str] = UNSET
|
32
32
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -70,8 +70,8 @@ class Knowledgebase:
|
|
70
70
|
@classmethod
|
71
71
|
def from_dict(cls: type[T], src_dict: dict[str, Any]) -> T:
|
72
72
|
from ..models.core_event import CoreEvent
|
73
|
-
from ..models.environment_metadata import EnvironmentMetadata
|
74
73
|
from ..models.knowledgebase_spec import KnowledgebaseSpec
|
74
|
+
from ..models.metadata import Metadata
|
75
75
|
|
76
76
|
if not src_dict:
|
77
77
|
return None
|
@@ -84,11 +84,11 @@ class Knowledgebase:
|
|
84
84
|
events.append(componentsschemas_core_events_item)
|
85
85
|
|
86
86
|
_metadata = d.pop("metadata", UNSET)
|
87
|
-
metadata: Union[Unset,
|
87
|
+
metadata: Union[Unset, Metadata]
|
88
88
|
if isinstance(_metadata, Unset):
|
89
89
|
metadata = UNSET
|
90
90
|
else:
|
91
|
-
metadata =
|
91
|
+
metadata = Metadata.from_dict(_metadata)
|
92
92
|
|
93
93
|
_spec = d.pop("spec", UNSET)
|
94
94
|
spec: Union[Unset, KnowledgebaseSpec]
|
@@ -14,13 +14,11 @@ class LastNRequestsMetric:
|
|
14
14
|
|
15
15
|
Attributes:
|
16
16
|
date (Union[Unset, str]): Timestamp
|
17
|
-
environment (Union[Unset, str]): Environment
|
18
17
|
workload_type (Union[Unset, str]): Workload type
|
19
18
|
workspace (Union[Unset, str]): Workspace
|
20
19
|
"""
|
21
20
|
|
22
21
|
date: Union[Unset, str] = UNSET
|
23
|
-
environment: Union[Unset, str] = UNSET
|
24
22
|
workload_type: Union[Unset, str] = UNSET
|
25
23
|
workspace: Union[Unset, str] = UNSET
|
26
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
@@ -28,8 +26,6 @@ class LastNRequestsMetric:
|
|
28
26
|
def to_dict(self) -> dict[str, Any]:
|
29
27
|
date = self.date
|
30
28
|
|
31
|
-
environment = self.environment
|
32
|
-
|
33
29
|
workload_type = self.workload_type
|
34
30
|
|
35
31
|
workspace = self.workspace
|
@@ -39,8 +35,6 @@ class LastNRequestsMetric:
|
|
39
35
|
field_dict.update({})
|
40
36
|
if date is not UNSET:
|
41
37
|
field_dict["date"] = date
|
42
|
-
if environment is not UNSET:
|
43
|
-
field_dict["environment"] = environment
|
44
38
|
if workload_type is not UNSET:
|
45
39
|
field_dict["workloadType"] = workload_type
|
46
40
|
if workspace is not UNSET:
|
@@ -55,15 +49,12 @@ class LastNRequestsMetric:
|
|
55
49
|
d = src_dict.copy()
|
56
50
|
date = d.pop("date", UNSET)
|
57
51
|
|
58
|
-
environment = d.pop("environment", UNSET)
|
59
|
-
|
60
52
|
workload_type = d.pop("workloadType", UNSET)
|
61
53
|
|
62
54
|
workspace = d.pop("workspace", UNSET)
|
63
55
|
|
64
56
|
last_n_requests_metric = cls(
|
65
57
|
date=date,
|
66
|
-
environment=environment,
|
67
58
|
workload_type=workload_type,
|
68
59
|
workspace=workspace,
|
69
60
|
)
|