beamlit 0.0.57rc113__py3-none-any.whl → 0.0.57rc115__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/thread.py +2 -0
- beamlit/deploy/deploy.py +12 -11
- beamlit/functions/mcp/mcp.py +4 -5
- {beamlit-0.0.57rc113.dist-info → beamlit-0.0.57rc115.dist-info}/METADATA +1 -1
- {beamlit-0.0.57rc113.dist-info → beamlit-0.0.57rc115.dist-info}/RECORD +8 -8
- {beamlit-0.0.57rc113.dist-info → beamlit-0.0.57rc115.dist-info}/WHEEL +0 -0
- {beamlit-0.0.57rc113.dist-info → beamlit-0.0.57rc115.dist-info}/entry_points.txt +0 -0
- {beamlit-0.0.57rc113.dist-info → beamlit-0.0.57rc115.dist-info}/licenses/LICENSE +0 -0
beamlit/agents/thread.py
CHANGED
@@ -18,6 +18,8 @@ def get_default_thread(request: Request) -> str:
|
|
18
18
|
Returns:
|
19
19
|
str: The extracted thread identifier. Returns an empty string if no valid identifier is found.
|
20
20
|
"""
|
21
|
+
if request.headers.get("X-Beamlit-Thread-Id"):
|
22
|
+
return request.headers.get("X-Beamlit-Thread-Id")
|
21
23
|
if request.headers.get("X-Beamlit-Sub"):
|
22
24
|
return request.headers.get("X-Beamlit-Sub")
|
23
25
|
authorization = request.headers.get("Authorization", request.headers.get("X-Beamlit-Authorization"))
|
beamlit/deploy/deploy.py
CHANGED
@@ -14,21 +14,13 @@ from pathlib import Path
|
|
14
14
|
from typing import Literal
|
15
15
|
|
16
16
|
import yaml
|
17
|
-
|
18
17
|
from beamlit.api.agents import get_agent
|
19
18
|
from beamlit.authentication import new_client
|
20
19
|
from beamlit.client import AuthenticatedClient
|
21
20
|
from beamlit.common import slugify
|
22
21
|
from beamlit.common.settings import Settings, get_settings, init
|
23
|
-
from beamlit.models import (
|
24
|
-
|
25
|
-
AgentSpec,
|
26
|
-
Flavor,
|
27
|
-
Function,
|
28
|
-
FunctionSpec,
|
29
|
-
Metadata,
|
30
|
-
MetadataLabels,
|
31
|
-
)
|
22
|
+
from beamlit.models import (Agent, AgentSpec, Flavor, Function, FunctionSpec,
|
23
|
+
Metadata, MetadataLabels)
|
32
24
|
|
33
25
|
from .format import arg_to_dict
|
34
26
|
from .parser import Resource, get_description, get_parameters, get_resources
|
@@ -55,6 +47,14 @@ def set_default_values(resource: Resource, deployment: Agent | Function):
|
|
55
47
|
deployment.metadata.display_name = deployment.metadata.name
|
56
48
|
if not deployment.spec.description:
|
57
49
|
deployment.spec.description = get_description(None, resource)
|
50
|
+
if isinstance(deployment, Agent):
|
51
|
+
deployment.spec.functions = []
|
52
|
+
for arg in resource.decorator.keywords:
|
53
|
+
if arg.arg == "remote_functions":
|
54
|
+
if isinstance(arg.value, ast.List):
|
55
|
+
for value in arg.value.elts:
|
56
|
+
if isinstance(value, ast.Constant):
|
57
|
+
deployment.spec.functions.append(slugify(value.value))
|
58
58
|
return deployment
|
59
59
|
|
60
60
|
def get_beamlit_deployment_from_resource(
|
@@ -131,7 +131,8 @@ def get_agent_yaml(
|
|
131
131
|
agent.spec.repository = agent_response.spec.repository
|
132
132
|
except Exception:
|
133
133
|
pass
|
134
|
-
agent.spec.functions =
|
134
|
+
agent.spec.functions = agent.spec.functions or []
|
135
|
+
agent.spec.functions = agent.spec.functions + [slugify(function.metadata.name) for (_, function) in functions]
|
135
136
|
agent.metadata.labels = agent.metadata.labels and MetadataLabels.from_dict(agent.metadata.labels) or MetadataLabels()
|
136
137
|
agent.metadata.labels["x-beamlit-auto-generated"] = "true"
|
137
138
|
agent_yaml = yaml.dump(agent.to_dict())
|
beamlit/functions/mcp/mcp.py
CHANGED
@@ -12,14 +12,13 @@ import pydantic
|
|
12
12
|
import pydantic_core
|
13
13
|
import requests
|
14
14
|
import typing_extensions as t
|
15
|
-
from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
|
16
|
-
from mcp import ClientSession
|
17
|
-
from mcp.types import CallToolResult, ListToolsResult
|
18
|
-
|
19
15
|
from beamlit.authentication import get_authentication_headers
|
20
16
|
from beamlit.authentication.authentication import AuthenticatedClient
|
21
17
|
from beamlit.common.settings import get_settings
|
22
18
|
from beamlit.functions.mcp.client import websocket_client
|
19
|
+
from langchain_core.tools.base import BaseTool, BaseToolkit, ToolException
|
20
|
+
from mcp import ClientSession
|
21
|
+
from mcp.types import CallToolResult, ListToolsResult
|
23
22
|
|
24
23
|
from .utils import create_schema_model
|
25
24
|
|
@@ -48,7 +47,7 @@ class MCPClient:
|
|
48
47
|
logger.debug(f"WebSocket tools: {response}")
|
49
48
|
return response
|
50
49
|
except Exception as e:
|
51
|
-
logger.error(f"Error listing
|
50
|
+
logger.error(f"Error listing tools: {e}")
|
52
51
|
logger.debug("WebSocket not available, trying HTTP")
|
53
52
|
return None # Signal to list_tools() to try HTTP instead
|
54
53
|
|
@@ -8,7 +8,7 @@ beamlit/agents/__init__.py,sha256=bWsFaXUbAps3IsL3Prti89m1s714vICXodbQi77h3vY,20
|
|
8
8
|
beamlit/agents/chain.py,sha256=JsinjAYBr3oaM4heouZaiaV2jMmi779LHAMtD_4P59s,4867
|
9
9
|
beamlit/agents/chat.py,sha256=ufuydptucLNe_Jyr7lQO1WfQ5pe0I5YKh-y0smwWABM,8301
|
10
10
|
beamlit/agents/decorator.py,sha256=yRxzrLOMhXW0S4ThRD7cm6UqUarw6gdB_ZP2jnZanvM,8311
|
11
|
-
beamlit/agents/thread.py,sha256=
|
11
|
+
beamlit/agents/thread.py,sha256=fbQUsnEOPqr-E-Gx-YhmP-c26XCpjqDeVdbNbqdGpDE,1196
|
12
12
|
beamlit/agents/voice/openai.py,sha256=-RDBwl16i4TbUhFo5-77Ci3zmI3Y8U2yf2MmvXR2haQ,9479
|
13
13
|
beamlit/agents/voice/utils.py,sha256=tQidyM40Ewuy12wKqpvJLvfJgneQ0sZf50dqnerPGHg,836
|
14
14
|
beamlit/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
|
@@ -127,7 +127,7 @@ beamlit/common/settings.py,sha256=9LshW8yVXmX9ZeNhfYH-nBnQV5nKSpi1RTZDNUOxe2s,52
|
|
127
127
|
beamlit/common/slugify.py,sha256=QPJqa1VrSjRle931RN37t24rUjAbyZEg1UFAp2fLgac,679
|
128
128
|
beamlit/common/utils.py,sha256=eG201z9gMRnhoHkaZGNtfFUbCzfg_Y59JR4ciMgidW8,1465
|
129
129
|
beamlit/deploy/__init__.py,sha256=uRsI_-gTbbki59LlvubeTfG6wfI3o2XqZODW0QXA-Ao,292
|
130
|
-
beamlit/deploy/deploy.py,sha256=
|
130
|
+
beamlit/deploy/deploy.py,sha256=xt6MY8J3jxMEEA9NCCZXYiy9eGQ5NxdPK0u_z3wW24w,11650
|
131
131
|
beamlit/deploy/format.py,sha256=W3ESUHyFv-iZDjVnHOf9YFDDXZSXYIFFbwCoL1GInE0,1162
|
132
132
|
beamlit/deploy/parser.py,sha256=gjRUhOVtfKnc1UNc_FhXsEfj9zrMNuq8W93pNsJBpo0,7586
|
133
133
|
beamlit/functions/__init__.py,sha256=Mnoqpa1dm7TXwjodBbF_40JyD78aXsOYWmqjDSnA1lU,317
|
@@ -135,7 +135,7 @@ beamlit/functions/common.py,sha256=v4nmLP9Wotpb5e6hV30XbItgZjr5lwXcF0EOotxRngI,1
|
|
135
135
|
beamlit/functions/decorator.py,sha256=iQbLwUo0K83DFJ3ub8O5jKtkbSINnku6GZcKJ9h7-5E,2292
|
136
136
|
beamlit/functions/local/local.py,sha256=F7b_xYDytJIZc0fM1sYMtJgfBCF1cLjquQm83VchTLs,1891
|
137
137
|
beamlit/functions/mcp/client.py,sha256=enLo0dzWMBHJEQf6as3UWM8tN3CjUN1YO3UPn67DLac,4072
|
138
|
-
beamlit/functions/mcp/mcp.py,sha256=
|
138
|
+
beamlit/functions/mcp/mcp.py,sha256=BXNq2i1R1eWQytfXDUR2TUmfUkvg14XJxD4XytXkM4g,5945
|
139
139
|
beamlit/functions/mcp/utils.py,sha256=V7bah6cymdtjJ_LJUrNcHDeApDHA6uXvaGVeFJGKj2U,1850
|
140
140
|
beamlit/functions/remote/remote.py,sha256=bkDUFiZI8YokqX8Fo76AnKLZF9PcjcDBr37hhxLevs8,6728
|
141
141
|
beamlit/models/__init__.py,sha256=042wT7sG_YUmJJAb9edrui-DesMxLjOGVvnEtqc92CY,8916
|
@@ -254,8 +254,8 @@ beamlit/serve/app.py,sha256=5XZci-R95Zjl97wMtQd1BRtonnkJJ2AeoTVFPKGAOfA,4283
|
|
254
254
|
beamlit/serve/middlewares/__init__.py,sha256=O7fyfE1DIYmajFY9WWdzxCgeAQWZzJfeUjzHGbpWaAk,309
|
255
255
|
beamlit/serve/middlewares/accesslog.py,sha256=lcu33j4epFSHRBaeTpyt8deNb3kaM3K91-andw4fp80,1112
|
256
256
|
beamlit/serve/middlewares/processtime.py,sha256=3x5w1yQexB0xFNKK6fgLbINxT-eLLunfZ6UDV0bIIF4,944
|
257
|
-
beamlit-0.0.
|
258
|
-
beamlit-0.0.
|
259
|
-
beamlit-0.0.
|
260
|
-
beamlit-0.0.
|
261
|
-
beamlit-0.0.
|
257
|
+
beamlit-0.0.57rc115.dist-info/METADATA,sha256=-4QXAnnZZ9N1D6GkBoJnpIbzthjSFdu9TLQY_NpJraI,3547
|
258
|
+
beamlit-0.0.57rc115.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
259
|
+
beamlit-0.0.57rc115.dist-info/entry_points.txt,sha256=zxhgdn7SP-Otk4rEv7LMPAAa9w4TUCLbu9TJi9-K3xg,115
|
260
|
+
beamlit-0.0.57rc115.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
|
261
|
+
beamlit-0.0.57rc115.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|