beamlit 0.0.57rc112__py3-none-any.whl → 0.0.57rc114__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/decorator.py +3 -2
- beamlit/deploy/deploy.py +12 -11
- beamlit/functions/common.py +5 -4
- beamlit/functions/decorator.py +2 -1
- beamlit/functions/local/local.py +2 -1
- beamlit/functions/mcp/client.py +2 -4
- beamlit/functions/mcp/mcp.py +1 -1
- beamlit/functions/remote/remote.py +2 -1
- beamlit/run.py +1 -0
- {beamlit-0.0.57rc112.dist-info → beamlit-0.0.57rc114.dist-info}/METADATA +1 -1
- {beamlit-0.0.57rc112.dist-info → beamlit-0.0.57rc114.dist-info}/RECORD +14 -14
- {beamlit-0.0.57rc112.dist-info → beamlit-0.0.57rc114.dist-info}/WHEEL +0 -0
- {beamlit-0.0.57rc112.dist-info → beamlit-0.0.57rc114.dist-info}/entry_points.txt +0 -0
- {beamlit-0.0.57rc112.dist-info → beamlit-0.0.57rc114.dist-info}/licenses/LICENSE +0 -0
beamlit/agents/decorator.py
CHANGED
@@ -10,14 +10,15 @@ import inspect
|
|
10
10
|
from logging import getLogger
|
11
11
|
from typing import Callable
|
12
12
|
|
13
|
+
from langgraph.checkpoint.memory import MemorySaver
|
14
|
+
from langgraph.prebuilt import create_react_agent
|
15
|
+
|
13
16
|
from beamlit.api.models import get_model, list_models
|
14
17
|
from beamlit.authentication import new_client
|
15
18
|
from beamlit.common.settings import Settings, init
|
16
19
|
from beamlit.errors import UnexpectedStatus
|
17
20
|
from beamlit.functions import get_functions
|
18
21
|
from beamlit.models import Agent, AgentSpec, Metadata
|
19
|
-
from langgraph.checkpoint.memory import MemorySaver
|
20
|
-
from langgraph.prebuilt import create_react_agent
|
21
22
|
|
22
23
|
from .chat import get_chat_model_full
|
23
24
|
from .voice.openai import OpenAIVoiceReactAgent
|
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/common.py
CHANGED
@@ -21,6 +21,9 @@ import traceback
|
|
21
21
|
from logging import getLogger
|
22
22
|
from typing import Union
|
23
23
|
|
24
|
+
from langchain_core.tools import StructuredTool
|
25
|
+
from langchain_core.tools.base import create_schema_from_function
|
26
|
+
|
24
27
|
from beamlit.authentication import new_client
|
25
28
|
from beamlit.client import AuthenticatedClient
|
26
29
|
from beamlit.common import slugify
|
@@ -28,8 +31,6 @@ from beamlit.common.settings import get_settings
|
|
28
31
|
from beamlit.functions.local.local import LocalToolKit
|
29
32
|
from beamlit.functions.remote.remote import RemoteToolkit
|
30
33
|
from beamlit.models import AgentChain
|
31
|
-
from langchain_core.tools import StructuredTool
|
32
|
-
from langchain_core.tools.base import create_schema_from_function
|
33
34
|
|
34
35
|
logger = getLogger(__name__)
|
35
36
|
|
@@ -152,8 +153,8 @@ async def get_functions(
|
|
152
153
|
func = getattr(module, func_name)
|
153
154
|
if settings.remote:
|
154
155
|
toolkit = RemoteToolkit(client, slugify(func.__name__))
|
155
|
-
toolkit.initialize()
|
156
|
-
functions.extend(toolkit.get_tools())
|
156
|
+
await toolkit.initialize()
|
157
|
+
functions.extend(await toolkit.get_tools())
|
157
158
|
else:
|
158
159
|
if asyncio.iscoroutinefunction(func):
|
159
160
|
functions.append(
|
beamlit/functions/decorator.py
CHANGED
@@ -4,9 +4,10 @@ import functools
|
|
4
4
|
from collections.abc import Callable
|
5
5
|
from logging import getLogger
|
6
6
|
|
7
|
-
from beamlit.models import Function, FunctionKit
|
8
7
|
from fastapi import Request
|
9
8
|
|
9
|
+
from beamlit.models import Function, FunctionKit
|
10
|
+
|
10
11
|
logger = getLogger(__name__)
|
11
12
|
|
12
13
|
def kit(bl_kit: FunctionKit = None, **kwargs: dict) -> Callable:
|
beamlit/functions/local/local.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
2
|
|
3
3
|
import pydantic
|
4
|
+
from langchain_core.tools.base import BaseTool
|
5
|
+
|
4
6
|
from beamlit.authentication.authentication import AuthenticatedClient
|
5
7
|
from beamlit.functions.mcp.mcp import MCPClient, MCPToolkit
|
6
8
|
from beamlit.models import Function
|
7
|
-
from langchain_core.tools.base import BaseTool
|
8
9
|
|
9
10
|
|
10
11
|
@dataclass
|
beamlit/functions/mcp/client.py
CHANGED
@@ -4,13 +4,11 @@ from typing import Any
|
|
4
4
|
from urllib.parse import urljoin, urlparse
|
5
5
|
|
6
6
|
import anyio
|
7
|
-
import
|
7
|
+
import mcp.types as types
|
8
8
|
from anyio.abc import TaskStatus
|
9
9
|
from anyio.streams.memory import MemoryObjectReceiveStream, MemoryObjectSendStream
|
10
|
-
from websockets.client import connect as ws_connect
|
11
10
|
from websockets.client import WebSocketClientProtocol
|
12
|
-
|
13
|
-
import mcp.types as types
|
11
|
+
from websockets.client import connect as ws_connect
|
14
12
|
|
15
13
|
logger = logging.getLogger(__name__)
|
16
14
|
|
beamlit/functions/mcp/mcp.py
CHANGED
@@ -47,7 +47,7 @@ class MCPClient:
|
|
47
47
|
logger.debug(f"WebSocket tools: {response}")
|
48
48
|
return response
|
49
49
|
except Exception as e:
|
50
|
-
logger.error(f"Error listing
|
50
|
+
logger.error(f"Error listing tools: {e}")
|
51
51
|
logger.debug("WebSocket not available, trying HTTP")
|
52
52
|
return None # Signal to list_tools() to try HTTP instead
|
53
53
|
|
@@ -11,6 +11,8 @@ from typing import Callable
|
|
11
11
|
|
12
12
|
import pydantic
|
13
13
|
import typing_extensions as t
|
14
|
+
from langchain_core.tools.base import BaseTool, ToolException
|
15
|
+
|
14
16
|
from beamlit.api.functions import get_function, list_functions
|
15
17
|
from beamlit.authentication.authentication import AuthenticatedClient
|
16
18
|
from beamlit.common.settings import get_settings
|
@@ -18,7 +20,6 @@ from beamlit.errors import UnexpectedStatus
|
|
18
20
|
from beamlit.functions.mcp.mcp import MCPClient, MCPToolkit
|
19
21
|
from beamlit.models import Function, StoreFunctionParameter
|
20
22
|
from beamlit.run import RunClient
|
21
|
-
from langchain_core.tools.base import BaseTool, ToolException
|
22
23
|
|
23
24
|
|
24
25
|
def create_dynamic_schema(name: str, parameters: list[StoreFunctionParameter]) -> type[pydantic.BaseModel]:
|
beamlit/run.py
CHANGED
@@ -2,12 +2,12 @@ beamlit/__init__.py,sha256=545gFC-wLLwUktWcOAjUWe_Glha40tBetRTOYSfHnbI,164
|
|
2
2
|
beamlit/client.py,sha256=PnR6ybZk5dLIJPnDKAf2epHOeQC_7yL0fG4muvphHjA,12695
|
3
3
|
beamlit/errors.py,sha256=gO8GBmKqmSNgAg-E5oT-oOyxztvp7V_6XG7OUTT15q0,546
|
4
4
|
beamlit/py.typed,sha256=8ZJUsxZiuOy1oJeVhsTWQhTG_6pTVHVXk5hJL79ebTk,25
|
5
|
-
beamlit/run.py,sha256=
|
5
|
+
beamlit/run.py,sha256=YMI8iTPB1M9gd_1FG958tw-Prf9EwIcca4jK4igi7MM,4448
|
6
6
|
beamlit/types.py,sha256=E1hhDh_zXfsSQ0NCt9-uw90_Mr5iIlsdfnfvxv5HarU,1005
|
7
7
|
beamlit/agents/__init__.py,sha256=bWsFaXUbAps3IsL3Prti89m1s714vICXodbQi77h3vY,206
|
8
8
|
beamlit/agents/chain.py,sha256=JsinjAYBr3oaM4heouZaiaV2jMmi779LHAMtD_4P59s,4867
|
9
9
|
beamlit/agents/chat.py,sha256=ufuydptucLNe_Jyr7lQO1WfQ5pe0I5YKh-y0smwWABM,8301
|
10
|
-
beamlit/agents/decorator.py,sha256=
|
10
|
+
beamlit/agents/decorator.py,sha256=yRxzrLOMhXW0S4ThRD7cm6UqUarw6gdB_ZP2jnZanvM,8311
|
11
11
|
beamlit/agents/thread.py,sha256=PVP9Gey8fMZHA-Cs8WbfmdSlD7g-n4HKuk1sTVf8yOQ,1087
|
12
12
|
beamlit/agents/voice/openai.py,sha256=-RDBwl16i4TbUhFo5-77Ci3zmI3Y8U2yf2MmvXR2haQ,9479
|
13
13
|
beamlit/agents/voice/utils.py,sha256=tQidyM40Ewuy12wKqpvJLvfJgneQ0sZf50dqnerPGHg,836
|
@@ -127,17 +127,17 @@ 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
|
134
|
-
beamlit/functions/common.py,sha256=
|
135
|
-
beamlit/functions/decorator.py,sha256=
|
136
|
-
beamlit/functions/local/local.py,sha256=
|
137
|
-
beamlit/functions/mcp/client.py,sha256=
|
138
|
-
beamlit/functions/mcp/mcp.py,sha256=
|
134
|
+
beamlit/functions/common.py,sha256=v4nmLP9Wotpb5e6hV30XbItgZjr5lwXcF0EOotxRngI,10127
|
135
|
+
beamlit/functions/decorator.py,sha256=iQbLwUo0K83DFJ3ub8O5jKtkbSINnku6GZcKJ9h7-5E,2292
|
136
|
+
beamlit/functions/local/local.py,sha256=F7b_xYDytJIZc0fM1sYMtJgfBCF1cLjquQm83VchTLs,1891
|
137
|
+
beamlit/functions/mcp/client.py,sha256=enLo0dzWMBHJEQf6as3UWM8tN3CjUN1YO3UPn67DLac,4072
|
138
|
+
beamlit/functions/mcp/mcp.py,sha256=BXNq2i1R1eWQytfXDUR2TUmfUkvg14XJxD4XytXkM4g,5945
|
139
139
|
beamlit/functions/mcp/utils.py,sha256=V7bah6cymdtjJ_LJUrNcHDeApDHA6uXvaGVeFJGKj2U,1850
|
140
|
-
beamlit/functions/remote/remote.py,sha256=
|
140
|
+
beamlit/functions/remote/remote.py,sha256=bkDUFiZI8YokqX8Fo76AnKLZF9PcjcDBr37hhxLevs8,6728
|
141
141
|
beamlit/models/__init__.py,sha256=042wT7sG_YUmJJAb9edrui-DesMxLjOGVvnEtqc92CY,8916
|
142
142
|
beamlit/models/acl.py,sha256=tH67gsl_BMaviSbTaaIkO1g9cWZgJ6VgAnYVjQSzGZY,3952
|
143
143
|
beamlit/models/agent.py,sha256=DPZZOrDyOAXlh7uvPmhK1jgz8L4UWmaF_SH-OnAdjlw,4162
|
@@ -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.57rc114.dist-info/METADATA,sha256=96xVguOL9Y4_QO7EOQ6ba9eAf3IA_K_B3AXMw4z_92s,3547
|
258
|
+
beamlit-0.0.57rc114.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
259
|
+
beamlit-0.0.57rc114.dist-info/entry_points.txt,sha256=zxhgdn7SP-Otk4rEv7LMPAAa9w4TUCLbu9TJi9-K3xg,115
|
260
|
+
beamlit-0.0.57rc114.dist-info/licenses/LICENSE,sha256=p5PNQvpvyDT_0aYBDgmV1fFI_vAD2aSV0wWG7VTgRis,1069
|
261
|
+
beamlit-0.0.57rc114.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|