beamlit 0.0.33rc50__py3-none-any.whl → 0.0.34rc52__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,9 +6,10 @@ import importlib
6
6
  import os
7
7
  from logging import getLogger
8
8
 
9
- from langchain_core.tools import Tool
9
+ from langchain_core.tools import StructuredTool
10
10
  from langgraph.checkpoint.memory import MemorySaver
11
11
  from langgraph.prebuilt import create_react_agent
12
+ from langchain_core.tools.base import create_schema_from_function
12
13
 
13
14
  from beamlit.api.models import get_model
14
15
  from beamlit.authentication import new_client
@@ -94,19 +95,21 @@ def get_functions(client, dir="src/functions", from_decorator="function", remote
94
95
  else:
95
96
  if asyncio.iscoroutinefunction(func):
96
97
  functions.append(
97
- Tool(
98
+ StructuredTool(
98
99
  name=func.__name__,
99
100
  description=func.__doc__,
100
101
  func=func,
101
102
  coroutine=func,
103
+ args_schema=create_schema_from_function(func.__name__, func)
102
104
  )
103
105
  )
104
106
  else:
105
107
  functions.append(
106
- Tool(
108
+ StructuredTool(
107
109
  name=func.__name__,
108
110
  description=func.__doc__,
109
111
  func=func,
112
+ args_schema=create_schema_from_function(func.__name__, func)
110
113
  )
111
114
  )
112
115
  except Exception as e:
@@ -152,7 +155,7 @@ def agent(
152
155
  remote_functions_empty=not remote_functions,
153
156
  )
154
157
 
155
- settings.agent.functions = functions
158
+
156
159
 
157
160
  if agent is not None:
158
161
  metadata = AgentMetadata(**agent.get("metadata", {}))
@@ -208,6 +211,8 @@ def agent(
208
211
  toolkit.initialize()
209
212
  functions.extend(toolkit.get_tools())
210
213
 
214
+ settings.agent.functions = functions
215
+
211
216
  if override_agent is None and len(functions) == 0:
212
217
  raise ValueError(
213
218
  "You must define at least one function, you can define this function in directory "
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beamlit
3
- Version: 0.0.33rc50
3
+ Version: 0.0.34rc52
4
4
  Summary: Add your description here
5
5
  Author-email: cploujoux <ch.ploujoux@gmail.com>
6
6
  Requires-Python: >=3.12
@@ -7,7 +7,7 @@ beamlit/types.py,sha256=E1hhDh_zXfsSQ0NCt9-uw90_Mr5iIlsdfnfvxv5HarU,1005
7
7
  beamlit/agents/__init__.py,sha256=nf1iwQwGtCG6nDqyVhxfWoqR6dv6X3bvSpCeqkTCFaM,101
8
8
  beamlit/agents/chain.py,sha256=vfCjiFHuu02uTTGicxMlFzjyICQkIjpXrBGs-7uJEsg,2826
9
9
  beamlit/agents/chat.py,sha256=gVyv4FGBdQTDhdutX8l64OUNa6Fdqaw4eCfEDRH0IPQ,3558
10
- beamlit/agents/decorator.py,sha256=PUw5xfG4KmmVeSbgI-Ac7KAm5n0addPhg5MysfxLpWk,10297
10
+ beamlit/agents/decorator.py,sha256=7w2rAo0Kg280lpo67byF5vor4qqMtlhuRqziwrSA62s,10629
11
11
  beamlit/api/__init__.py,sha256=zTSiG_ujSjAqWPyc435YXaX9XTlpMjiJWBbV-f-YtdA,45
12
12
  beamlit/api/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  beamlit/api/agents/create_agent.py,sha256=t5Pr62My2EhQlcIY71MrI73-0_q5Djr3a_Ybt9MIiQQ,3587
@@ -256,6 +256,6 @@ beamlit/serve/app.py,sha256=DXWxQoMeuA5FYvBMyLrP94OEWQbwLf4GZk3I9fkwSPA,3523
256
256
  beamlit/serve/middlewares/__init__.py,sha256=1dVmnOmhAQWvWktqHkKSIX-YoF6fmMU8xkUQuhg_rJU,148
257
257
  beamlit/serve/middlewares/accesslog.py,sha256=Mu4T4_9OvHybjA0ApzZFpgi2C8f3X1NbUk-76v634XM,631
258
258
  beamlit/serve/middlewares/processtime.py,sha256=lDAaIasZ4bwvN-HKHvZpaD9r-yrkVNZYx4abvbjbrCg,411
259
- beamlit-0.0.33rc50.dist-info/METADATA,sha256=EwI_0qBXTM0HfSJ-k7w8d37h2-X4ZJ0VucVWV8iKtVU,2405
260
- beamlit-0.0.33rc50.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
261
- beamlit-0.0.33rc50.dist-info/RECORD,,
259
+ beamlit-0.0.34rc52.dist-info/METADATA,sha256=5z-4coIVveGscH6kroJEgJ3SVl1C9nEOkmRV5T38zaU,2405
260
+ beamlit-0.0.34rc52.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
261
+ beamlit-0.0.34rc52.dist-info/RECORD,,