letta-nightly 0.5.1.dev20241030104135__py3-none-any.whl → 0.5.1.dev20241101104122__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.
Potentially problematic release.
This version of letta-nightly might be problematic. Click here for more details.
- letta/agent.py +41 -2
- letta/client/client.py +98 -23
- letta/client/streaming.py +3 -0
- letta/constants.py +3 -0
- letta/functions/functions.py +4 -5
- letta/functions/schema_generator.py +4 -3
- letta/helpers/__init__.py +1 -0
- letta/helpers/tool_rule_solver.py +115 -0
- letta/llm_api/helpers.py +3 -1
- letta/llm_api/llm_api_tools.py +1 -2
- letta/llm_api/openai.py +5 -0
- letta/metadata.py +43 -1
- letta/orm/__init__.py +4 -0
- letta/orm/tool.py +0 -3
- letta/schemas/agent.py +5 -5
- letta/schemas/letta_response.py +3 -3
- letta/schemas/tool.py +4 -6
- letta/schemas/tool_rule.py +25 -0
- letta/server/rest_api/app.py +5 -3
- letta/server/rest_api/routers/v1/agents.py +16 -3
- letta/server/rest_api/routers/v1/organizations.py +2 -2
- letta/server/server.py +7 -43
- letta/server/startup.sh +3 -0
- letta/server/static_files/assets/{index-d6b3669a.js → index-9fa459a2.js} +66 -69
- letta/server/static_files/index.html +1 -1
- letta/services/tool_manager.py +21 -4
- {letta_nightly-0.5.1.dev20241030104135.dist-info → letta_nightly-0.5.1.dev20241101104122.dist-info}/METADATA +1 -1
- {letta_nightly-0.5.1.dev20241030104135.dist-info → letta_nightly-0.5.1.dev20241101104122.dist-info}/RECORD +31 -32
- letta/server/rest_api/admin/__init__.py +0 -0
- letta/server/rest_api/admin/agents.py +0 -21
- letta/server/rest_api/admin/tools.py +0 -82
- letta/server/rest_api/admin/users.py +0 -98
- {letta_nightly-0.5.1.dev20241030104135.dist-info → letta_nightly-0.5.1.dev20241101104122.dist-info}/LICENSE +0 -0
- {letta_nightly-0.5.1.dev20241030104135.dist-info → letta_nightly-0.5.1.dev20241101104122.dist-info}/WHEEL +0 -0
- {letta_nightly-0.5.1.dev20241030104135.dist-info → letta_nightly-0.5.1.dev20241101104122.dist-info}/entry_points.txt +0 -0
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
</script>
|
|
32
|
-
<script type="module" crossorigin src="/assets/index-
|
|
32
|
+
<script type="module" crossorigin src="/assets/index-9fa459a2.js"></script>
|
|
33
33
|
<link rel="stylesheet" href="/assets/index-3ab03d5b.css">
|
|
34
34
|
</head>
|
|
35
35
|
<body>
|
letta/services/tool_manager.py
CHANGED
|
@@ -28,7 +28,9 @@ class ToolManager:
|
|
|
28
28
|
def create_or_update_tool(self, tool_create: ToolCreate, actor: PydanticUser) -> PydanticTool:
|
|
29
29
|
"""Create a new tool based on the ToolCreate schema."""
|
|
30
30
|
# Derive json_schema
|
|
31
|
-
derived_json_schema = tool_create.json_schema or derive_openai_json_schema(
|
|
31
|
+
derived_json_schema = tool_create.json_schema or derive_openai_json_schema(
|
|
32
|
+
source_code=tool_create.source_code, name=tool_create.name
|
|
33
|
+
)
|
|
32
34
|
derived_name = tool_create.name or derived_json_schema["name"]
|
|
33
35
|
|
|
34
36
|
try:
|
|
@@ -36,7 +38,7 @@ class ToolManager:
|
|
|
36
38
|
# This is important, because even if it's a different user, adding the same tool to the org should not happen
|
|
37
39
|
tool = self.get_tool_by_name(tool_name=derived_name, actor=actor)
|
|
38
40
|
# Put to dict and remove fields that should not be reset
|
|
39
|
-
update_data = tool_create.model_dump(exclude={"module"
|
|
41
|
+
update_data = tool_create.model_dump(exclude={"module"}, exclude_unset=True)
|
|
40
42
|
# Remove redundant update fields
|
|
41
43
|
update_data = {key: value for key, value in update_data.items() if getattr(tool, key) != value}
|
|
42
44
|
|
|
@@ -59,8 +61,7 @@ class ToolManager:
|
|
|
59
61
|
"""Create a new tool based on the ToolCreate schema."""
|
|
60
62
|
# Create the tool
|
|
61
63
|
with self.session_maker() as session:
|
|
62
|
-
|
|
63
|
-
create_data = tool_create.model_dump(exclude={"terminal"})
|
|
64
|
+
create_data = tool_create.model_dump()
|
|
64
65
|
tool = ToolModel(**create_data, organization_id=actor.organization_id) # Unpack everything directly into ToolModel
|
|
65
66
|
tool.create(session, actor=actor)
|
|
66
67
|
|
|
@@ -106,6 +107,22 @@ class ToolManager:
|
|
|
106
107
|
for key, value in update_data.items():
|
|
107
108
|
setattr(tool, key, value)
|
|
108
109
|
|
|
110
|
+
# If source code is changed and a new json_schema is not provided, we want to auto-refresh the name and schema
|
|
111
|
+
# CAUTION: This will override any name/schema values the user passed in
|
|
112
|
+
if "source_code" in update_data.keys() and "json_schema" not in update_data.keys():
|
|
113
|
+
pydantic_tool = tool.to_pydantic()
|
|
114
|
+
|
|
115
|
+
# Decide whether or not to reset name
|
|
116
|
+
# If name was not explicitly passed in as part of the update, then we auto-generate a new name based on source code
|
|
117
|
+
name = None
|
|
118
|
+
if "name" in update_data.keys():
|
|
119
|
+
name = update_data["name"]
|
|
120
|
+
new_schema = derive_openai_json_schema(source_code=pydantic_tool.source_code, name=name)
|
|
121
|
+
|
|
122
|
+
# The name will either be set (if explicit) or autogenerated from the source code
|
|
123
|
+
tool.name = new_schema["name"]
|
|
124
|
+
tool.json_schema = new_schema
|
|
125
|
+
|
|
109
126
|
# Save the updated tool to the database
|
|
110
127
|
tool.update(db_session=session, actor=actor)
|
|
111
128
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
letta/__init__.py,sha256=zlZXKr0iQIsC7FTkN9fjTvAgQGPXyr0nnkMJ7_OE1D0,1014
|
|
2
2
|
letta/__main__.py,sha256=6Hs2PV7EYc5Tid4g4OtcLXhqVHiNYTGzSBdoOnW2HXA,29
|
|
3
|
-
letta/agent.py,sha256=
|
|
3
|
+
letta/agent.py,sha256=uMU0_5XEitgYyfN5R53EzBnjajSCxzM5OTuEtOTmHFg,74850
|
|
4
4
|
letta/agent_store/chroma.py,sha256=upR5zGnGs6I6btulEYbiZdGG87BgKjxUJOQZ4Y-RQ_M,12492
|
|
5
5
|
letta/agent_store/db.py,sha256=mTY3YWUs5n17479GMeTmxN8DAyzbBweVcypyNsK_slg,23435
|
|
6
6
|
letta/agent_store/lancedb.py,sha256=i63d4VZwj9UIOTNs5f0JZ_r5yZD-jKWz4FAH4RMpXOE,5104
|
|
@@ -13,11 +13,11 @@ letta/cli/cli.py,sha256=i6wFBaX8-WwZ6nl_T0FFptfozlnYEBM7RcShwBl-qfw,16106
|
|
|
13
13
|
letta/cli/cli_config.py,sha256=ynsezKawQ0l95rymlv-AJ3QjbqiyaXZyuzsDfBYwMwg,8537
|
|
14
14
|
letta/cli/cli_load.py,sha256=x4L8s15GwIW13xrhKYFWHo_y-IVGtoPDHWWKcHDRP10,4587
|
|
15
15
|
letta/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
|
-
letta/client/client.py,sha256=
|
|
17
|
-
letta/client/streaming.py,sha256=
|
|
16
|
+
letta/client/client.py,sha256=flhH2CDnh0mi8Gv2APkiUmF7EKfF0n9lUFp2ykGmRDY,95411
|
|
17
|
+
letta/client/streaming.py,sha256=Hh5pjlyrdCuO2V75ZCxSSOCPd3BmHdKFGaIUJC6fBp0,4775
|
|
18
18
|
letta/client/utils.py,sha256=OJlAKWrldc4I6M1WpcTWNtPJ4wfxlzlZqWLfCozkFtI,2872
|
|
19
19
|
letta/config.py,sha256=eK-ip06ELHNYriInkgfidDvJxQ2tD1u49I-VLXB87nE,18929
|
|
20
|
-
letta/constants.py,sha256=
|
|
20
|
+
letta/constants.py,sha256=G7YPJ9z93h727kAP2o4wPE-F5EG2-zhtSXTF92tKe80,6513
|
|
21
21
|
letta/credentials.py,sha256=D9mlcPsdDWlIIXQQD8wSPE9M_QvsRrb0p3LB5i9OF5Q,5806
|
|
22
22
|
letta/data_sources/connectors.py,sha256=qO81ASB6V-vDPthfHYtZiyqcQDQPTT0NuD8hVwC6xI0,9907
|
|
23
23
|
letta/data_sources/connectors_helper.py,sha256=2TQjCt74fCgT5sw1AP8PalDEk06jPBbhrPG4HVr-WLs,3371
|
|
@@ -26,9 +26,11 @@ letta/errors.py,sha256=cDOo4cSYL-LA0w0b0GdsxXd5k2I1LLOY8nhtXk9YqYs,2875
|
|
|
26
26
|
letta/functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
27
27
|
letta/functions/function_sets/base.py,sha256=N4QmOjL6gDEyOg67ocF6zVKM-NquTo-yXG_T8r18buA,6440
|
|
28
28
|
letta/functions/function_sets/extras.py,sha256=Jik3UiDqYTm4Lam1XPTvuVjvgUHwIAhopsnbmVhGMBg,4732
|
|
29
|
-
letta/functions/functions.py,sha256=
|
|
29
|
+
letta/functions/functions.py,sha256=n-g5qx_-5BBMEYpa-lrzeHIUbuXImPO4ABrFZTPZKMQ,4102
|
|
30
30
|
letta/functions/helpers.py,sha256=JU3e5xkkTVx4EevBmtyCRnidf0ncAeASvH2ZT_aBvPc,9905
|
|
31
|
-
letta/functions/schema_generator.py,sha256=
|
|
31
|
+
letta/functions/schema_generator.py,sha256=M6cLDnoJOARd5OkAQUeGxjpLUQtMu4WEztcIkZFFh-I,7098
|
|
32
|
+
letta/helpers/__init__.py,sha256=p0luQ1Oe3Skc6sH4O58aHHA3Qbkyjifpuq0DZ1GAY0U,59
|
|
33
|
+
letta/helpers/tool_rule_solver.py,sha256=rcl8LBLbK5Hpxgf0gNMSV2uqWuVTuJNFJdCDsR5Eyd8,4758
|
|
32
34
|
letta/humans/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
35
|
letta/humans/examples/basic.txt,sha256=Lcp8YESTWvOJgO4Yf_yyQmgo5bKakeB1nIVrwEGG6PA,17
|
|
34
36
|
letta/humans/examples/cs_phd.txt,sha256=9C9ZAV_VuG7GB31ksy3-_NAyk8rjE6YtVOkhp08k1xw,297
|
|
@@ -39,10 +41,10 @@ letta/llm_api/azure_openai.py,sha256=Y1HKPog1XzM_f7ujUK_Gv2zQkoy5pU-1bKiUnvSxSrs
|
|
|
39
41
|
letta/llm_api/azure_openai_constants.py,sha256=oXtKrgBFHf744gyt5l1thILXgyi8NDNUrKEa2GGGpjw,278
|
|
40
42
|
letta/llm_api/cohere.py,sha256=vDRd-SUGp1t_JUIdwC3RkIhwMl0OY7n-tAU9uPORYkY,14826
|
|
41
43
|
letta/llm_api/google_ai.py,sha256=3xZ074nSOCC22c15yerA5ngWzh0ex4wxeI-6faNbHPE,17708
|
|
42
|
-
letta/llm_api/helpers.py,sha256=
|
|
43
|
-
letta/llm_api/llm_api_tools.py,sha256=
|
|
44
|
+
letta/llm_api/helpers.py,sha256=KqkdjZWYghx4OPwLcHEC6ruc_z9DScbysw3VH4x9A0Q,9887
|
|
45
|
+
letta/llm_api/llm_api_tools.py,sha256=KFG2miI7KrDOIcOSgm2jwBIb3qvzYt2O_5UNjTbTsm8,14786
|
|
44
46
|
letta/llm_api/mistral.py,sha256=fHdfD9ug-rQIk2qn8tRKay1U6w9maF11ryhKi91FfXM,1593
|
|
45
|
-
letta/llm_api/openai.py,sha256=
|
|
47
|
+
letta/llm_api/openai.py,sha256=o2I7yNyBMsW33MwQJMo2EWYTC5dLDdxfGmg-mQle6nA,23844
|
|
46
48
|
letta/local_llm/README.md,sha256=hFJyw5B0TU2jrh9nb0zGZMgdH-Ei1dSRfhvPQG_NSoU,168
|
|
47
49
|
letta/local_llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
50
|
letta/local_llm/chat_completion_proxy.py,sha256=SiohxsjGTku4vOryOZx7I0t0xoO_sUuhXgoe62fKq3c,12995
|
|
@@ -83,19 +85,19 @@ letta/local_llm/webui/settings.py,sha256=gmLHfiOl1u4JmlAZU2d2O8YKF9lafdakyjwR_ft
|
|
|
83
85
|
letta/log.py,sha256=QHquDnL7oUAvdKlAwUlCK9zXKDMUjrU9WA0bxnMsP0Y,2101
|
|
84
86
|
letta/main.py,sha256=yHgM1lltQZvbE8k0QDQMmVyJiWEj07ZTOYIBHDxE_DQ,18709
|
|
85
87
|
letta/memory.py,sha256=6q1x3-PY-PeXzAt6hvP-UF1ajvroPZ7XW-5nLy-JhMo,17657
|
|
86
|
-
letta/metadata.py,sha256=
|
|
88
|
+
letta/metadata.py,sha256=B4B8f5WSqmUwIGU5MN6fyBdHwryxrr9y0cZWr_eq9pE,29168
|
|
87
89
|
letta/o1_agent.py,sha256=LqATgTpkc02-nCH_F87EOvgxLjdjT9F07kdzj3zSdQg,3118
|
|
88
90
|
letta/openai_backcompat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
89
91
|
letta/openai_backcompat/openai_object.py,sha256=Y1ZS1sATP60qxJiOsjOP3NbwSzuzvkNAvb3DeuhM5Uk,13490
|
|
90
92
|
letta/orm/__all__.py,sha256=2gh2MZTkA3Hw67VWVKK3JIStJOqTeLdpCvYSVYNeEDA,692
|
|
91
|
-
letta/orm/__init__.py,sha256=
|
|
93
|
+
letta/orm/__init__.py,sha256=J2GZpfXQunxU0ChavjkhoaSruluRFrLYknXD2m0BP_g,144
|
|
92
94
|
letta/orm/base.py,sha256=uK56wXg4Hv5jGuBsThSgmlFdl0e2u4VGiTX4RiRqTK4,2671
|
|
93
95
|
letta/orm/enums.py,sha256=KfHcFt_fR6GUmSlmfsa-TetvmuRxGESNve8MStRYW64,145
|
|
94
96
|
letta/orm/errors.py,sha256=somsGtotFlb3SDM6tKdZ5TDGwEEP3ppx47ICAvNMnkg,225
|
|
95
97
|
letta/orm/mixins.py,sha256=hZJFYnmSGklryuAOypvVhMgXyU7pgatGEun-p-2f_Fc,2457
|
|
96
98
|
letta/orm/organization.py,sha256=ccE0ShFWqWPdtXiCRkZCSeIERbtwU-a7AF99N3S6IRM,1468
|
|
97
99
|
letta/orm/sqlalchemy_base.py,sha256=LuV-or0T8kdg2M0H7Y8KEIcaeKD1DkARzA-LgAGR4qU,7721
|
|
98
|
-
letta/orm/tool.py,sha256=
|
|
100
|
+
letta/orm/tool.py,sha256=4cYKSoogfpH4O0wruIqU8vzEGgiCOL3gQfG5doSqpDw,2089
|
|
99
101
|
letta/orm/user.py,sha256=69FU1rSXhlRJMaAUPYebxgFPn8UCQRU8TYUkjXLrALQ,1136
|
|
100
102
|
letta/persistence_manager.py,sha256=LlLgEDpSafCPAiyKmuq0NvVAnfBkZo6TWbGIKYQjQBs,5200
|
|
101
103
|
letta/personas/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -122,7 +124,7 @@ letta/prompts/system/memgpt_modified_chat.txt,sha256=HOaPVurEftD8KsuwsclDgE2afIf
|
|
|
122
124
|
letta/prompts/system/memgpt_modified_o1.txt,sha256=AxxYVjYLZwpZ6yfifh1SuPtwlJGWTcTVzw53QbkN-Ao,5492
|
|
123
125
|
letta/providers.py,sha256=nWvTvVsZH1EE2aHAwihJvCIDJpgfeWAOUE_YK1x5Zj4,19635
|
|
124
126
|
letta/pytest.ini,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
125
|
-
letta/schemas/agent.py,sha256=
|
|
127
|
+
letta/schemas/agent.py,sha256=erAIm5wSzb7h9eWiYPMyuiH9J45dQXa5bz2kxde82j0,7210
|
|
126
128
|
letta/schemas/api_key.py,sha256=u07yzzMn-hBAHZIIKbWY16KsgiFjSNR8lAghpMUo3_4,682
|
|
127
129
|
letta/schemas/block.py,sha256=2_GftSIoTie6qHqUcZTfvN5bZT-p3goGcVx3TAuNOPQ,3936
|
|
128
130
|
letta/schemas/embedding_config.py,sha256=1kD6NpiXeH4roVumxqDAKk7xt8SpXGWNhZs_XXUSlEU,2855
|
|
@@ -133,7 +135,7 @@ letta/schemas/job.py,sha256=605TWjUdNy5Rgoc7en_DX3Giz-I7sVTXiSRZqxL__d8,1543
|
|
|
133
135
|
letta/schemas/letta_base.py,sha256=4QXFgyjCHqIagi8B6_4nmqb9eoJ52Y6aCxBxQpGX48M,2832
|
|
134
136
|
letta/schemas/letta_message.py,sha256=RuVVtwFbi85yP3dXQxowofQ6cI2cO_CdGtgpHGQzgHc,6563
|
|
135
137
|
letta/schemas/letta_request.py,sha256=_oiDshc_AoFWIfXRk2VX5-AxO5vDlyN-9r-gnyLj_30,1890
|
|
136
|
-
letta/schemas/letta_response.py,sha256=
|
|
138
|
+
letta/schemas/letta_response.py,sha256=ClI0LKyhMVI0N5CSnTAbcHaw7simkyrUTKYX0fr0qzw,1610
|
|
137
139
|
letta/schemas/llm_config.py,sha256=eFA48vKBTO70qaob8pak2CWOH7TCQeqWuClkMBc2vbY,4172
|
|
138
140
|
letta/schemas/memory.py,sha256=rNUxCs11nZf_gbKgkJ-c4FRHZVhqIfTyfD2nS5WP6oI,11490
|
|
139
141
|
letta/schemas/message.py,sha256=DQxnRYrYgHXpTKfMzfS-bpCAe-BO_Rmcfc1Wf-4GHjw,33703
|
|
@@ -145,17 +147,14 @@ letta/schemas/openai/openai.py,sha256=Hilo5BiLAGabzxCwnwfzK5QrWqwYD8epaEKFa4Pwnd
|
|
|
145
147
|
letta/schemas/organization.py,sha256=0MOUbaiDGTXkzTjaALLI2wj4E1bL5V_0jjI6jEgFKlA,635
|
|
146
148
|
letta/schemas/passage.py,sha256=eYQMxD_XjHAi72jmqcGBU4wM4VZtSU0XK8uhQxxN3Ug,3563
|
|
147
149
|
letta/schemas/source.py,sha256=hB4Ai6Nj8dFdbxv5_Qaf4uN_cmdGmnzgc-4QnHXcV3o,2562
|
|
148
|
-
letta/schemas/tool.py,sha256=
|
|
150
|
+
letta/schemas/tool.py,sha256=j1tMMx652RA8X9xOZm-TwqS0S2MAA58I8p_zgQHdFPA,9275
|
|
151
|
+
letta/schemas/tool_rule.py,sha256=dHEwVOZ40lMEVCrry7wlZM0IJo5SJrZqXKYpXe40bjY,778
|
|
149
152
|
letta/schemas/usage.py,sha256=lvn1ooHwLEdv6gwQpw5PBUbcwn_gwdT6HA-fCiix6sY,817
|
|
150
153
|
letta/schemas/user.py,sha256=toiA53UKB1hpH6k2xHyQNKVeDUoSB3RmLfxSwmKPAz4,1523
|
|
151
154
|
letta/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
152
155
|
letta/server/constants.py,sha256=yAdGbLkzlOU_dLTx0lKDmAnj0ZgRXCEaIcPJWO69eaE,92
|
|
153
156
|
letta/server/rest_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
154
|
-
letta/server/rest_api/
|
|
155
|
-
letta/server/rest_api/admin/agents.py,sha256=cFNDU4Z8wGpcWXuo5aBgX6CcxLzPpTFYnTIaiF-3qvw,564
|
|
156
|
-
letta/server/rest_api/admin/tools.py,sha256=HdXR_MRWkh3zMtb96Eaomp4rReNm3DirnXCNqAD7tNU,3093
|
|
157
|
-
letta/server/rest_api/admin/users.py,sha256=B3KeVkPpXACFZUjjc6twDSxWO8sHLtBIaO61f1dpFU4,3493
|
|
158
|
-
letta/server/rest_api/app.py,sha256=JNmDnvp9fP--hJPtPpEWgQT-14O1YOceZbWELr2vedA,6207
|
|
157
|
+
letta/server/rest_api/app.py,sha256=czPY3ZOQoYRdK8OlU5ZrYgKM5N39E5cXfsbVEOsJdj4,6282
|
|
159
158
|
letta/server/rest_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
160
159
|
letta/server/rest_api/auth/index.py,sha256=fQBGyVylGSRfEMLQ17cZzrHd5Y1xiVylvPqH5Rl-lXQ,1378
|
|
161
160
|
letta/server/rest_api/auth_token.py,sha256=725EFEIiNj4dh70hrSd94UysmFD8vcJLrTRfNHkzxDo,774
|
|
@@ -169,23 +168,23 @@ letta/server/rest_api/routers/openai/assistants/threads.py,sha256=WXVGBaBvSNPB7Z
|
|
|
169
168
|
letta/server/rest_api/routers/openai/chat_completions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
170
169
|
letta/server/rest_api/routers/openai/chat_completions/chat_completions.py,sha256=-uye6cm4SnoQGwxhr1N1FrSXOlnO2Hvbfj6k8JSc45k,4918
|
|
171
170
|
letta/server/rest_api/routers/v1/__init__.py,sha256=sqlVZa-u9DJwdRsp0_8YUGrac9DHguIB4wETlEDRylA,666
|
|
172
|
-
letta/server/rest_api/routers/v1/agents.py,sha256=
|
|
171
|
+
letta/server/rest_api/routers/v1/agents.py,sha256=afBcEd9CAv_Adbd44UeqUh1bQAJ8d4HjxE5r4-W8xwc,25508
|
|
173
172
|
letta/server/rest_api/routers/v1/blocks.py,sha256=0WekE_yBD2U3jYgPxI0DCFjACWavCAlvm_Ybw5SZBnw,2583
|
|
174
173
|
letta/server/rest_api/routers/v1/health.py,sha256=pKCuVESlVOhGIb4VC4K-H82eZqfghmT6kvj2iOkkKuc,401
|
|
175
174
|
letta/server/rest_api/routers/v1/jobs.py,sha256=a-j0v-5A0un0pVCOHpfeWnzpOWkVDQO6ti42k_qAlZY,2272
|
|
176
175
|
letta/server/rest_api/routers/v1/llms.py,sha256=TcyvSx6MEM3je5F4DysL7ligmssL_pFlJaaO4uL95VY,877
|
|
177
|
-
letta/server/rest_api/routers/v1/organizations.py,sha256=
|
|
176
|
+
letta/server/rest_api/routers/v1/organizations.py,sha256=hCuni52aM1Gfmuu_BeodXAvTkfrvexEo_wZf8UtyaAM,2034
|
|
178
177
|
letta/server/rest_api/routers/v1/sources.py,sha256=eY_pk9jRL2Y9yIZdsTjH6EuKsfH1neaTU15MKNL0dvw,8749
|
|
179
178
|
letta/server/rest_api/routers/v1/tools.py,sha256=aVZcVxL68Oq8N6p3p_MsGrNxmnK3-UWAIHdVztFw_Nk,3794
|
|
180
179
|
letta/server/rest_api/routers/v1/users.py,sha256=bxQ-YdevjDqmgNDfbSPAG_4KEVvPNBHD_-Lp1MdeMec,3374
|
|
181
180
|
letta/server/rest_api/static_files.py,sha256=NG8sN4Z5EJ8JVQdj19tkFa9iQ1kBPTab9f_CUxd_u4Q,3143
|
|
182
181
|
letta/server/rest_api/utils.py,sha256=GdHYCzXtbM5VCAYDPR0z5gnNZpRhwPld2BGZV7xT6cU,2924
|
|
183
|
-
letta/server/server.py,sha256=
|
|
184
|
-
letta/server/startup.sh,sha256=
|
|
182
|
+
letta/server/server.py,sha256=RvZfZE0JGZ8nLCAzgi1n_MHAKzyjMBC9GmaBc2qu4LQ,78534
|
|
183
|
+
letta/server/startup.sh,sha256=Atyf4hL5XLpC4aA3esEyOeNWfemlgXlgpeKB59fDFvw,334
|
|
185
184
|
letta/server/static_files/assets/index-3ab03d5b.css,sha256=OrA9W4iKJ5h2Wlr7GwdAT4wow0CM8hVit1yOxEL49Qw,54295
|
|
186
|
-
letta/server/static_files/assets/index-
|
|
185
|
+
letta/server/static_files/assets/index-9fa459a2.js,sha256=j2oMcDJO9dWJaH5e-tsflbVpWK20gLWpZKJk4-Kuy6A,1815592
|
|
187
186
|
letta/server/static_files/favicon.ico,sha256=DezhLdFSbM8o81wCOZcV3riq7tFUOGQD4h6-vr-HuU0,342
|
|
188
|
-
letta/server/static_files/index.html,sha256=
|
|
187
|
+
letta/server/static_files/index.html,sha256=NmXJ7rPwblDBJj6oBKP6eeBwzBAeGhxtVnEZlLSuArk,1198
|
|
189
188
|
letta/server/static_files/memgpt_logo_transparent.png,sha256=7l6niNb4MlUILxLlUZPxIE1TEHj_Z9f9XDxoST3d7Vw,85383
|
|
190
189
|
letta/server/utils.py,sha256=rRvW6L1lzau4u9boamiyZH54lf5tQ91ypXzUW9cfSPA,1667
|
|
191
190
|
letta/server/ws_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -195,15 +194,15 @@ letta/server/ws_api/protocol.py,sha256=M_-gM5iuDBwa1cuN2IGNCG5GxMJwU2d3XW93XALv9
|
|
|
195
194
|
letta/server/ws_api/server.py,sha256=C2Kv48PCwl46DQFb0ZP30s86KJLQ6dZk2AhWQEZn9pY,6004
|
|
196
195
|
letta/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
197
196
|
letta/services/organization_manager.py,sha256=wW4wOmKaqhHC7oTGWU38OO-dFtmRI0JVmq_k8gI1b0A,3658
|
|
198
|
-
letta/services/tool_manager.py,sha256=
|
|
197
|
+
letta/services/tool_manager.py,sha256=lU_U_6pfae7m5Xsn1R7g-Xb9rGIs1s7JXmirOPDGumg,7984
|
|
199
198
|
letta/services/user_manager.py,sha256=5wjmnhLoxsc9FCKD0IPotfV24i_iCqmifOkhIBvshtc,4404
|
|
200
199
|
letta/settings.py,sha256=yiYNmnYKj_BdTm0cBEIvQKYGU-lCmFntqsyVfRUy3_k,3411
|
|
201
200
|
letta/streaming_interface.py,sha256=_FPUWy58j50evHcpXyd7zB1wWqeCc71NCFeWh_TBvnw,15736
|
|
202
201
|
letta/streaming_utils.py,sha256=329fsvj1ZN0r0LpQtmMPZ2vSxkDBIUUwvGHZFkjm2I8,11745
|
|
203
202
|
letta/system.py,sha256=buKYPqG5n2x41hVmWpu6JUpyd7vTWED9Km2_M7dLrvk,6960
|
|
204
203
|
letta/utils.py,sha256=SXLEYhyp3gHyIjrxNIKNZZ5ittKo3KOj6zxgC_Trex0,31012
|
|
205
|
-
letta_nightly-0.5.1.
|
|
206
|
-
letta_nightly-0.5.1.
|
|
207
|
-
letta_nightly-0.5.1.
|
|
208
|
-
letta_nightly-0.5.1.
|
|
209
|
-
letta_nightly-0.5.1.
|
|
204
|
+
letta_nightly-0.5.1.dev20241101104122.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
|
|
205
|
+
letta_nightly-0.5.1.dev20241101104122.dist-info/METADATA,sha256=sPIL8AWEivsdS3WkY01imsjtr6Hz2qQGyg_WwPkhp4s,10660
|
|
206
|
+
letta_nightly-0.5.1.dev20241101104122.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
207
|
+
letta_nightly-0.5.1.dev20241101104122.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
|
|
208
|
+
letta_nightly-0.5.1.dev20241101104122.dist-info/RECORD,,
|
|
File without changes
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
|
-
from fastapi import APIRouter
|
|
4
|
-
|
|
5
|
-
from letta.schemas.agent import AgentState
|
|
6
|
-
from letta.server.rest_api.interface import QueuingInterface
|
|
7
|
-
from letta.server.server import SyncServer
|
|
8
|
-
|
|
9
|
-
router = APIRouter()
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
def setup_agents_admin_router(server: SyncServer, interface: QueuingInterface):
|
|
13
|
-
@router.get("/agents", tags=["agents"], response_model=List[AgentState])
|
|
14
|
-
def get_all_agents():
|
|
15
|
-
"""
|
|
16
|
-
Get a list of all agents in the database
|
|
17
|
-
"""
|
|
18
|
-
interface.clear()
|
|
19
|
-
return server.list_agents()
|
|
20
|
-
|
|
21
|
-
return router
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
from typing import List, Literal, Optional
|
|
2
|
-
|
|
3
|
-
from fastapi import APIRouter, Body, HTTPException
|
|
4
|
-
from pydantic import BaseModel, Field
|
|
5
|
-
|
|
6
|
-
from letta.schemas.tool import Tool as ToolModel # TODO: modify
|
|
7
|
-
from letta.server.rest_api.interface import QueuingInterface
|
|
8
|
-
from letta.server.server import SyncServer
|
|
9
|
-
|
|
10
|
-
router = APIRouter()
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class ListToolsResponse(BaseModel):
|
|
14
|
-
tools: List[ToolModel] = Field(..., description="List of tools (functions).")
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
class CreateToolRequest(BaseModel):
|
|
18
|
-
json_schema: dict = Field(..., description="JSON schema of the tool.")
|
|
19
|
-
source_code: str = Field(..., description="The source code of the function.")
|
|
20
|
-
source_type: Optional[Literal["python"]] = Field(None, description="The type of the source code.")
|
|
21
|
-
tags: Optional[List[str]] = Field(None, description="Metadata tags.")
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class CreateToolResponse(BaseModel):
|
|
25
|
-
tool: ToolModel = Field(..., description="Information about the newly created tool.")
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
def setup_tools_index_router(server: SyncServer, interface: QueuingInterface):
|
|
29
|
-
|
|
30
|
-
@router.delete("/tools/{tool_name}", tags=["tools"])
|
|
31
|
-
async def delete_tool(
|
|
32
|
-
tool_name: str,
|
|
33
|
-
# user_id: uuid.UUID = Depends(get_current_user_with_server), # TODO: add back when user-specific
|
|
34
|
-
):
|
|
35
|
-
"""
|
|
36
|
-
Delete a tool by name
|
|
37
|
-
"""
|
|
38
|
-
# Clear the interface
|
|
39
|
-
interface.clear()
|
|
40
|
-
# tool = server.ms.delete_tool(user_id=user_id, tool_name=tool_name) TODO: add back when user-specific
|
|
41
|
-
server.ms.delete_tool(name=tool_name, user_id=None)
|
|
42
|
-
|
|
43
|
-
@router.get("/tools/{tool_name}", tags=["tools"], response_model=ToolModel)
|
|
44
|
-
async def get_tool(tool_name: str):
|
|
45
|
-
"""
|
|
46
|
-
Get a tool by name
|
|
47
|
-
"""
|
|
48
|
-
# Clear the interface
|
|
49
|
-
interface.clear()
|
|
50
|
-
# tool = server.ms.get_tool(user_id=user_id, tool_name=tool_name) TODO: add back when user-specific
|
|
51
|
-
tool = server.ms.get_tool(tool_name=tool_name, user_id=None)
|
|
52
|
-
if tool is None:
|
|
53
|
-
# return 404 error
|
|
54
|
-
raise HTTPException(status_code=404, detail=f"Tool with name {tool_name} not found.")
|
|
55
|
-
return tool
|
|
56
|
-
|
|
57
|
-
@router.get("/tools", tags=["tools"], response_model=ListToolsResponse)
|
|
58
|
-
async def list_all_tools():
|
|
59
|
-
"""
|
|
60
|
-
Get a list of all tools available to agents created by a user
|
|
61
|
-
"""
|
|
62
|
-
# Clear the interface
|
|
63
|
-
interface.clear()
|
|
64
|
-
# tools = server.ms.list_tools(user_id=user_id) TODO: add back when user-specific
|
|
65
|
-
tools = server.ms.list_tools(user_id=None)
|
|
66
|
-
return ListToolsResponse(tools=tools)
|
|
67
|
-
|
|
68
|
-
@router.post("/tools", tags=["tools"], response_model=ToolModel)
|
|
69
|
-
async def create_tool(
|
|
70
|
-
request: CreateToolRequest = Body(...),
|
|
71
|
-
):
|
|
72
|
-
"""
|
|
73
|
-
Create a new tool
|
|
74
|
-
"""
|
|
75
|
-
try:
|
|
76
|
-
return server.create_tool(
|
|
77
|
-
json_schema=request.json_schema, source_code=request.source_code, source_type=request.source_type, tags=request.tags
|
|
78
|
-
)
|
|
79
|
-
except Exception as e:
|
|
80
|
-
raise HTTPException(status_code=500, detail=f"Failed to create tool: {e}")
|
|
81
|
-
|
|
82
|
-
return router
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
2
|
-
|
|
3
|
-
from fastapi import APIRouter, Body, HTTPException, Query
|
|
4
|
-
|
|
5
|
-
from letta.schemas.api_key import APIKey, APIKeyCreate
|
|
6
|
-
from letta.schemas.user import User, UserCreate
|
|
7
|
-
from letta.server.rest_api.interface import QueuingInterface
|
|
8
|
-
from letta.server.server import SyncServer
|
|
9
|
-
|
|
10
|
-
router = APIRouter()
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def setup_admin_router(server: SyncServer, interface: QueuingInterface):
|
|
14
|
-
@router.get("/users", tags=["admin"], response_model=List[User])
|
|
15
|
-
def get_all_users(cursor: Optional[str] = Query(None), limit: Optional[int] = Query(50)):
|
|
16
|
-
"""
|
|
17
|
-
Get a list of all users in the database
|
|
18
|
-
"""
|
|
19
|
-
try:
|
|
20
|
-
# TODO: make this call a server function
|
|
21
|
-
_, users = server.ms.get_all_users(cursor=cursor, limit=limit)
|
|
22
|
-
except HTTPException:
|
|
23
|
-
raise
|
|
24
|
-
except Exception as e:
|
|
25
|
-
raise HTTPException(status_code=500, detail=f"{e}")
|
|
26
|
-
return users
|
|
27
|
-
|
|
28
|
-
@router.post("/users", tags=["admin"], response_model=User)
|
|
29
|
-
def create_user(request: UserCreate = Body(...)):
|
|
30
|
-
"""
|
|
31
|
-
Create a new user in the database
|
|
32
|
-
"""
|
|
33
|
-
try:
|
|
34
|
-
user = server.user_manager.create_user(request)
|
|
35
|
-
except HTTPException:
|
|
36
|
-
raise
|
|
37
|
-
except Exception as e:
|
|
38
|
-
raise HTTPException(status_code=500, detail=f"{e}")
|
|
39
|
-
return user
|
|
40
|
-
|
|
41
|
-
@router.delete("/users", tags=["admin"], response_model=User)
|
|
42
|
-
def delete_user(
|
|
43
|
-
user_id: str = Query(..., description="The user_id key to be deleted."),
|
|
44
|
-
):
|
|
45
|
-
# TODO make a soft deletion, instead of a hard deletion
|
|
46
|
-
try:
|
|
47
|
-
user = server.ms.get_user(user_id=user_id)
|
|
48
|
-
if user is None:
|
|
49
|
-
raise HTTPException(status_code=404, detail=f"User does not exist")
|
|
50
|
-
server.ms.delete_user(user_id=user_id)
|
|
51
|
-
except HTTPException:
|
|
52
|
-
raise
|
|
53
|
-
except Exception as e:
|
|
54
|
-
raise HTTPException(status_code=500, detail=f"{e}")
|
|
55
|
-
return user
|
|
56
|
-
|
|
57
|
-
@router.post("/users/keys", tags=["admin"], response_model=APIKey)
|
|
58
|
-
def create_new_api_key(request: APIKeyCreate = Body(...)):
|
|
59
|
-
"""
|
|
60
|
-
Create a new API key for a user
|
|
61
|
-
"""
|
|
62
|
-
try:
|
|
63
|
-
api_key = server.create_api_key(request)
|
|
64
|
-
except HTTPException:
|
|
65
|
-
raise
|
|
66
|
-
except Exception as e:
|
|
67
|
-
raise HTTPException(status_code=500, detail=f"{e}")
|
|
68
|
-
return api_key
|
|
69
|
-
|
|
70
|
-
@router.get("/users/keys", tags=["admin"], response_model=List[APIKey])
|
|
71
|
-
def get_api_keys(
|
|
72
|
-
user_id: str = Query(..., description="The unique identifier of the user."),
|
|
73
|
-
):
|
|
74
|
-
"""
|
|
75
|
-
Get a list of all API keys for a user
|
|
76
|
-
"""
|
|
77
|
-
try:
|
|
78
|
-
if server.ms.get_user(user_id=user_id) is None:
|
|
79
|
-
raise HTTPException(status_code=404, detail=f"User does not exist")
|
|
80
|
-
api_keys = server.ms.get_all_api_keys_for_user(user_id=user_id)
|
|
81
|
-
except HTTPException:
|
|
82
|
-
raise
|
|
83
|
-
except Exception as e:
|
|
84
|
-
raise HTTPException(status_code=500, detail=f"{e}")
|
|
85
|
-
return api_keys
|
|
86
|
-
|
|
87
|
-
@router.delete("/users/keys", tags=["admin"], response_model=APIKey)
|
|
88
|
-
def delete_api_key(
|
|
89
|
-
api_key: str = Query(..., description="The API key to be deleted."),
|
|
90
|
-
):
|
|
91
|
-
try:
|
|
92
|
-
return server.delete_api_key(api_key)
|
|
93
|
-
except HTTPException:
|
|
94
|
-
raise
|
|
95
|
-
except Exception as e:
|
|
96
|
-
raise HTTPException(status_code=500, detail=f"{e}")
|
|
97
|
-
|
|
98
|
-
return router
|
|
File without changes
|
|
File without changes
|
|
File without changes
|