letta-nightly 0.6.12.dev20250122104013__py3-none-any.whl → 0.6.14.dev20250123041709__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/__init__.py +2 -2
- letta/agent.py +69 -100
- letta/chat_only_agent.py +1 -1
- letta/client/client.py +169 -149
- letta/constants.py +1 -8
- letta/data_sources/connectors.py +1 -1
- letta/functions/helpers.py +29 -4
- letta/functions/schema_generator.py +55 -0
- letta/llm_api/helpers.py +51 -1
- letta/memory.py +9 -7
- letta/orm/agent.py +2 -2
- letta/orm/block.py +3 -1
- letta/orm/custom_columns.py +5 -4
- letta/orm/enums.py +1 -0
- letta/orm/message.py +2 -2
- letta/orm/sqlalchemy_base.py +5 -0
- letta/schemas/agent.py +13 -13
- letta/schemas/block.py +2 -2
- letta/schemas/environment_variables.py +1 -1
- letta/schemas/job.py +1 -1
- letta/schemas/letta_base.py +6 -0
- letta/schemas/letta_message.py +6 -6
- letta/schemas/memory.py +3 -2
- letta/schemas/message.py +21 -13
- letta/schemas/passage.py +1 -1
- letta/schemas/source.py +4 -4
- letta/schemas/tool.py +38 -43
- letta/server/rest_api/app.py +1 -16
- letta/server/rest_api/routers/v1/agents.py +95 -118
- letta/server/rest_api/routers/v1/blocks.py +8 -46
- letta/server/rest_api/routers/v1/jobs.py +4 -4
- letta/server/rest_api/routers/v1/providers.py +2 -2
- letta/server/rest_api/routers/v1/runs.py +6 -6
- letta/server/rest_api/routers/v1/sources.py +8 -38
- letta/server/rest_api/routers/v1/tags.py +1 -1
- letta/server/rest_api/routers/v1/tools.py +6 -24
- letta/server/server.py +6 -6
- letta/services/agent_manager.py +43 -9
- letta/services/block_manager.py +3 -3
- letta/services/job_manager.py +5 -3
- letta/services/organization_manager.py +1 -1
- letta/services/passage_manager.py +3 -3
- letta/services/provider_manager.py +2 -2
- letta/services/sandbox_config_manager.py +2 -2
- letta/services/source_manager.py +3 -3
- letta/services/tool_execution_sandbox.py +3 -1
- letta/services/tool_manager.py +8 -3
- letta/services/user_manager.py +2 -2
- letta/settings.py +29 -0
- letta/system.py +2 -2
- {letta_nightly-0.6.12.dev20250122104013.dist-info → letta_nightly-0.6.14.dev20250123041709.dist-info}/METADATA +1 -1
- {letta_nightly-0.6.12.dev20250122104013.dist-info → letta_nightly-0.6.14.dev20250123041709.dist-info}/RECORD +55 -61
- letta/server/rest_api/routers/openai/__init__.py +0 -0
- letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- letta/server/rest_api/routers/openai/assistants/assistants.py +0 -115
- letta/server/rest_api/routers/openai/assistants/schemas.py +0 -115
- letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -120
- {letta_nightly-0.6.12.dev20250122104013.dist-info → letta_nightly-0.6.14.dev20250123041709.dist-info}/LICENSE +0 -0
- {letta_nightly-0.6.12.dev20250122104013.dist-info → letta_nightly-0.6.14.dev20250123041709.dist-info}/WHEEL +0 -0
- {letta_nightly-0.6.12.dev20250122104013.dist-info → letta_nightly-0.6.14.dev20250123041709.dist-info}/entry_points.txt +0 -0
|
@@ -364,7 +364,9 @@ class ToolExecutionSandbox:
|
|
|
364
364
|
sbx = Sandbox(sandbox_config.get_e2b_config().template, metadata={self.METADATA_CONFIG_STATE_KEY: state_hash})
|
|
365
365
|
else:
|
|
366
366
|
# no template
|
|
367
|
-
sbx = Sandbox(
|
|
367
|
+
sbx = Sandbox(
|
|
368
|
+
metadata={self.METADATA_CONFIG_STATE_KEY: state_hash}, **e2b_config.model_dump(to_orm=True, exclude={"pip_requirements"})
|
|
369
|
+
)
|
|
368
370
|
|
|
369
371
|
# install pip requirements
|
|
370
372
|
if e2b_config.pip_requirements:
|
letta/services/tool_manager.py
CHANGED
|
@@ -39,7 +39,7 @@ class ToolManager:
|
|
|
39
39
|
tool = self.get_tool_by_name(tool_name=pydantic_tool.name, actor=actor)
|
|
40
40
|
if tool:
|
|
41
41
|
# Put to dict and remove fields that should not be reset
|
|
42
|
-
update_data = pydantic_tool.model_dump(exclude_unset=True, exclude_none=True)
|
|
42
|
+
update_data = pydantic_tool.model_dump(to_orm=True, exclude_unset=True, exclude_none=True)
|
|
43
43
|
|
|
44
44
|
# If there's anything to update
|
|
45
45
|
if update_data:
|
|
@@ -53,6 +53,11 @@ class ToolManager:
|
|
|
53
53
|
|
|
54
54
|
return tool
|
|
55
55
|
|
|
56
|
+
@enforce_types
|
|
57
|
+
def create_or_update_composio_tool(self, pydantic_tool: PydanticTool, actor: PydanticUser) -> PydanticTool:
|
|
58
|
+
pydantic_tool.tool_type = ToolType.EXTERNAL_COMPOSIO
|
|
59
|
+
return self.create_or_update_tool(pydantic_tool, actor)
|
|
60
|
+
|
|
56
61
|
@enforce_types
|
|
57
62
|
def create_tool(self, pydantic_tool: PydanticTool, actor: PydanticUser) -> PydanticTool:
|
|
58
63
|
"""Create a new tool based on the ToolCreate schema."""
|
|
@@ -62,7 +67,7 @@ class ToolManager:
|
|
|
62
67
|
# Auto-generate description if not provided
|
|
63
68
|
if pydantic_tool.description is None:
|
|
64
69
|
pydantic_tool.description = pydantic_tool.json_schema.get("description", None)
|
|
65
|
-
tool_data = pydantic_tool.model_dump()
|
|
70
|
+
tool_data = pydantic_tool.model_dump(to_orm=True)
|
|
66
71
|
|
|
67
72
|
tool = ToolModel(**tool_data)
|
|
68
73
|
tool.create(session, actor=actor) # Re-raise other database-related errors
|
|
@@ -107,7 +112,7 @@ class ToolManager:
|
|
|
107
112
|
tool = ToolModel.read(db_session=session, identifier=tool_id, actor=actor)
|
|
108
113
|
|
|
109
114
|
# Update tool attributes with only the fields that were explicitly set
|
|
110
|
-
update_data = tool_update.model_dump(exclude_none=True)
|
|
115
|
+
update_data = tool_update.model_dump(to_orm=True, exclude_none=True)
|
|
111
116
|
for key, value in update_data.items():
|
|
112
117
|
setattr(tool, key, value)
|
|
113
118
|
|
letta/services/user_manager.py
CHANGED
|
@@ -45,7 +45,7 @@ class UserManager:
|
|
|
45
45
|
def create_user(self, pydantic_user: PydanticUser) -> PydanticUser:
|
|
46
46
|
"""Create a new user if it doesn't already exist."""
|
|
47
47
|
with self.session_maker() as session:
|
|
48
|
-
new_user = UserModel(**pydantic_user.model_dump())
|
|
48
|
+
new_user = UserModel(**pydantic_user.model_dump(to_orm=True))
|
|
49
49
|
new_user.create(session)
|
|
50
50
|
return new_user.to_pydantic()
|
|
51
51
|
|
|
@@ -57,7 +57,7 @@ class UserManager:
|
|
|
57
57
|
existing_user = UserModel.read(db_session=session, identifier=user_update.id)
|
|
58
58
|
|
|
59
59
|
# Update only the fields that are provided in UserUpdate
|
|
60
|
-
update_data = user_update.model_dump(exclude_unset=True, exclude_none=True)
|
|
60
|
+
update_data = user_update.model_dump(to_orm=True, exclude_unset=True, exclude_none=True)
|
|
61
61
|
for key, value in update_data.items():
|
|
62
62
|
setattr(existing_user, key, value)
|
|
63
63
|
|
letta/settings.py
CHANGED
|
@@ -18,6 +18,34 @@ class ToolSettings(BaseSettings):
|
|
|
18
18
|
local_sandbox_dir: Optional[str] = None
|
|
19
19
|
|
|
20
20
|
|
|
21
|
+
class SummarizerSettings(BaseSettings):
|
|
22
|
+
model_config = SettingsConfigDict(env_prefix="letta_summarizer_", extra="ignore")
|
|
23
|
+
|
|
24
|
+
# Controls if we should evict all messages
|
|
25
|
+
# TODO: Can refactor this into an enum if we have a bunch of different kinds of summarizers
|
|
26
|
+
evict_all_messages: bool = False
|
|
27
|
+
|
|
28
|
+
# The maximum number of retries for the summarizer
|
|
29
|
+
# If we reach this cutoff, it probably means that the summarizer is not compressing down the in-context messages any further
|
|
30
|
+
# And we throw a fatal error
|
|
31
|
+
max_summarizer_retries: int = 3
|
|
32
|
+
|
|
33
|
+
# When to warn the model that a summarize command will happen soon
|
|
34
|
+
# The amount of tokens before a system warning about upcoming truncation is sent to Letta
|
|
35
|
+
memory_warning_threshold: float = 0.75
|
|
36
|
+
|
|
37
|
+
# Whether to send the system memory warning message
|
|
38
|
+
send_memory_warning_message: bool = False
|
|
39
|
+
|
|
40
|
+
# The desired memory pressure to summarize down to
|
|
41
|
+
desired_memory_token_pressure: float = 0.3
|
|
42
|
+
|
|
43
|
+
# The number of messages at the end to keep
|
|
44
|
+
# Even when summarizing, we may want to keep a handful of recent messages
|
|
45
|
+
# These serve as in-context examples of how to use functions / what user messages look like
|
|
46
|
+
keep_last_n_messages: int = 0
|
|
47
|
+
|
|
48
|
+
|
|
21
49
|
class ModelSettings(BaseSettings):
|
|
22
50
|
|
|
23
51
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
@@ -147,3 +175,4 @@ settings = Settings(_env_parse_none_str="None")
|
|
|
147
175
|
test_settings = TestSettings()
|
|
148
176
|
model_settings = ModelSettings()
|
|
149
177
|
tool_settings = ToolSettings()
|
|
178
|
+
summarizer_settings = SummarizerSettings()
|
letta/system.py
CHANGED
|
@@ -161,10 +161,10 @@ def package_system_message(system_message, message_type="system_alert", time=Non
|
|
|
161
161
|
return json.dumps(packaged_message)
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
def package_summarize_message(summary,
|
|
164
|
+
def package_summarize_message(summary, summary_message_count, hidden_message_count, total_message_count, timestamp=None):
|
|
165
165
|
context_message = (
|
|
166
166
|
f"Note: prior messages ({hidden_message_count} of {total_message_count} total messages) have been hidden from view due to conversation memory constraints.\n"
|
|
167
|
-
+ f"The following is a summary of the previous {
|
|
167
|
+
+ f"The following is a summary of the previous {summary_message_count} messages:\n {summary}"
|
|
168
168
|
)
|
|
169
169
|
|
|
170
170
|
formatted_time = get_local_time() if timestamp is None else timestamp
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
letta/__init__.py,sha256=
|
|
1
|
+
letta/__init__.py,sha256=BeMu4nr5y0Y255XZLIZrYc_4K9QUwY1ndKLRgJHzip8,920
|
|
2
2
|
letta/__main__.py,sha256=6Hs2PV7EYc5Tid4g4OtcLXhqVHiNYTGzSBdoOnW2HXA,29
|
|
3
|
-
letta/agent.py,sha256=
|
|
3
|
+
letta/agent.py,sha256=aKJWo3Q3OXuSa8UhPTdHvMvyQaDPMaYHhMZgF8Sg3lc,56622
|
|
4
4
|
letta/benchmark/benchmark.py,sha256=ebvnwfp3yezaXOQyGXkYCDYpsmre-b9hvNtnyx4xkG0,3701
|
|
5
5
|
letta/benchmark/constants.py,sha256=aXc5gdpMGJT327VuxsT5FngbCK2J41PQYeICBO7g_RE,536
|
|
6
|
-
letta/chat_only_agent.py,sha256=
|
|
6
|
+
letta/chat_only_agent.py,sha256=71Lf-df8y3nsE9IFKpEigaZaWHoWnXnhVChkp1L-83I,4760
|
|
7
7
|
letta/cli/cli.py,sha256=_uGKM-RvGLGf7y8iWjkLgLTxIw7uWrdCdL5ETUOCkUs,16472
|
|
8
8
|
letta/cli/cli_config.py,sha256=I5J8D0OpsDDXCTOWFqjmxQuZCGrC1oCuNbVkrKwg4VM,8544
|
|
9
9
|
letta/cli/cli_load.py,sha256=xFw-CuzjChcIptaqQ1XpDROENt0JSjyPeiQ0nmEeO1k,2706
|
|
10
10
|
letta/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
letta/client/client.py,sha256=
|
|
11
|
+
letta/client/client.py,sha256=hv5dOwGxhkI9hZarNIV6hmR0ty7-jLjB5VdAalqa6Q4,136428
|
|
12
12
|
letta/client/streaming.py,sha256=mWyMMCJeYf0aGcX_-9ZeiH3egh2Fl20Yjo1acaPO4nA,4824
|
|
13
13
|
letta/client/utils.py,sha256=VCGV-op5ZSmurd4yw7Vhf93XDQ0BkyBT8qsuV7EqfiU,2859
|
|
14
14
|
letta/config.py,sha256=JFGY4TWW0Wm5fTbZamOwWqk5G8Nn-TXyhgByGoAqy2c,12375
|
|
15
|
-
letta/constants.py,sha256=
|
|
16
|
-
letta/data_sources/connectors.py,sha256=
|
|
15
|
+
letta/constants.py,sha256=CTJa3eFroiQIPg2iCxT_9PqV5IogJKEZLc78K70Ou-Q,7118
|
|
16
|
+
letta/data_sources/connectors.py,sha256=R2AssXpqS7wN6VI8AfxvqaZs5S1ZACc4E_FewmR9iZI,7022
|
|
17
17
|
letta/data_sources/connectors_helper.py,sha256=2TQjCt74fCgT5sw1AP8PalDEk06jPBbhrPG4HVr-WLs,3371
|
|
18
18
|
letta/embeddings.py,sha256=VgqbUqYL6oTuLOKGOd_8swTRMYIpRTIWJbBthjT8eR8,8838
|
|
19
19
|
letta/errors.py,sha256=6fQXg2unP-2fo3R7db0ayKKWlD2XMusOPNi9TgJplCg,5558
|
|
@@ -23,8 +23,8 @@ letta/functions/function_sets/base.py,sha256=bOiitkhzqYKwZBiRYrx29AlordiA5IrXw25
|
|
|
23
23
|
letta/functions/function_sets/extras.py,sha256=sNY5oavQ5ZmO5GpAtnm8hkWokqwqB8ClPB2VOL-B8MM,4719
|
|
24
24
|
letta/functions/function_sets/multi_agent.py,sha256=kF1k-MccbRRvzH0Y93Dw5FjqwgToOwlhFCNRGWcQMMw,3851
|
|
25
25
|
letta/functions/functions.py,sha256=wxxo6MJXBfcPeEc1YYWK5ENOD3RFNTIc65RTDBo77x4,5673
|
|
26
|
-
letta/functions/helpers.py,sha256=
|
|
27
|
-
letta/functions/schema_generator.py,sha256=
|
|
26
|
+
letta/functions/helpers.py,sha256=KQVdIq1klsfKsyYiKbzLd-n0r3i01mjra-QfqR9EOdE,14052
|
|
27
|
+
letta/functions/schema_generator.py,sha256=qIdEYn4gu_lQRaCLSA_zmogcPBWF1Lv7G-PxN77ozCI,19686
|
|
28
28
|
letta/helpers/__init__.py,sha256=p0luQ1Oe3Skc6sH4O58aHHA3Qbkyjifpuq0DZ1GAY0U,59
|
|
29
29
|
letta/helpers/tool_rule_solver.py,sha256=VnJfqb5L1Lcipc_tBVGj0om60GKQkMkNLgg6X9VZl2c,6210
|
|
30
30
|
letta/humans/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -38,7 +38,7 @@ letta/llm_api/azure_openai.py,sha256=Y1HKPog1XzM_f7ujUK_Gv2zQkoy5pU-1bKiUnvSxSrs
|
|
|
38
38
|
letta/llm_api/azure_openai_constants.py,sha256=oXtKrgBFHf744gyt5l1thILXgyi8NDNUrKEa2GGGpjw,278
|
|
39
39
|
letta/llm_api/cohere.py,sha256=H5kzYH_aQAnGNq7lip7XyKGLEOKC318Iw0_tiTP6kc4,14772
|
|
40
40
|
letta/llm_api/google_ai.py,sha256=MIX4nmyC6448AvyPPSE8JZ_tzSpKJTArkZSfQGGoy0M,17920
|
|
41
|
-
letta/llm_api/helpers.py,sha256=
|
|
41
|
+
letta/llm_api/helpers.py,sha256=ov9WHsLSvkceIpSNJ3PUgCvufD862Bcrum-bWrUVJko,16193
|
|
42
42
|
letta/llm_api/llm_api_tools.py,sha256=-cLTeYwhwA6Dy9Io_W3DYrZ-gvYaAtp3TY2Snh1L13o,19512
|
|
43
43
|
letta/llm_api/mistral.py,sha256=fHdfD9ug-rQIk2qn8tRKay1U6w9maF11ryhKi91FfXM,1593
|
|
44
44
|
letta/llm_api/openai.py,sha256=vEQOk_8DA6-qhj3KFk5gcIlE4kAuf6307IVljn8xRRM,25390
|
|
@@ -81,25 +81,25 @@ letta/local_llm/webui/legacy_settings.py,sha256=BLmd3TSx5StnY3ibjwaxYATPt_Lvq-o1
|
|
|
81
81
|
letta/local_llm/webui/settings.py,sha256=gmLHfiOl1u4JmlAZU2d2O8YKF9lafdakyjwR_ftVPh8,552
|
|
82
82
|
letta/log.py,sha256=FxkAk2f8Bl-u9dfImSj1DYnjAsmV6PL3tjTSnEiNP48,2218
|
|
83
83
|
letta/main.py,sha256=_agyaYPJq70OL0goNwO34zENL2KupnTgqlg-HVcNaTY,15379
|
|
84
|
-
letta/memory.py,sha256=
|
|
84
|
+
letta/memory.py,sha256=htiDt-AHci__P8cfxHMts6fe50bPqVK4INw9cbumrRQ,3271
|
|
85
85
|
letta/offline_memory_agent.py,sha256=Wc2_je3oXxXcaiPPNPxc78A3IXVsiK6Q7X3t_SrlHck,7651
|
|
86
86
|
letta/openai_backcompat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
87
|
letta/openai_backcompat/openai_object.py,sha256=Y1ZS1sATP60qxJiOsjOP3NbwSzuzvkNAvb3DeuhM5Uk,13490
|
|
88
88
|
letta/orm/__all__.py,sha256=2gh2MZTkA3Hw67VWVKK3JIStJOqTeLdpCvYSVYNeEDA,692
|
|
89
89
|
letta/orm/__init__.py,sha256=wPokP-EvOri2LhKLjmYVtI_FWchaxgFvJeF_NAfqJIo,842
|
|
90
|
-
letta/orm/agent.py,sha256=
|
|
90
|
+
letta/orm/agent.py,sha256=POgpKT4u5FlcCV5w5HsI4D3ZPalZnJ86zBcyJQ1J_mI,6135
|
|
91
91
|
letta/orm/agents_tags.py,sha256=dYSnHz4IWBjyOiQ4RJomX3P0QN76JTlEZEw5eJM6Emg,925
|
|
92
92
|
letta/orm/base.py,sha256=VjvxF9TwKF9Trf8BJkDgf7D6KrWWopOkUiF18J3IElk,3071
|
|
93
|
-
letta/orm/block.py,sha256=
|
|
93
|
+
letta/orm/block.py,sha256=p360LWSjmpXCcdD0S7jFW3Sl153aljhtjn8shCk2Zm8,3469
|
|
94
94
|
letta/orm/blocks_agents.py,sha256=W0dykl9OchAofSuAYZD5zNmhyMabPr9LTJrz-I3A0m4,983
|
|
95
|
-
letta/orm/custom_columns.py,sha256=
|
|
96
|
-
letta/orm/enums.py,sha256=
|
|
95
|
+
letta/orm/custom_columns.py,sha256=EML5AE5FQ4ugI8MGj4yqfmwBrw7YAcp4_dO6i9oQs6I,5192
|
|
96
|
+
letta/orm/enums.py,sha256=HzX3eXhBH-PnpxhBWtWbkV4J6wrStlJaX_OVdZgAdLU,428
|
|
97
97
|
letta/orm/errors.py,sha256=Se0Guz-gqi-D36NUWSh7AP9zTVCSph9KgZh_trwng4o,734
|
|
98
98
|
letta/orm/file.py,sha256=7_p7LxityP3NQZVURQYG0kgcZhEkVuMN0Fj4h9YOe1w,1780
|
|
99
99
|
letta/orm/job.py,sha256=hTW6INcSc_snMiv8pxCNTAQZACrVXxGMJ-XhCToo6Fk,2088
|
|
100
100
|
letta/orm/job_messages.py,sha256=SgwaYPYwwAC3dBtl9Xye_TWUl9H_-m95S95TTcfPyOg,1245
|
|
101
101
|
letta/orm/job_usage_statistics.py,sha256=gR-lp-ZEBDK8TIFEgwFSDt382l6CFLWHciB-KCISbCQ,1380
|
|
102
|
-
letta/orm/message.py,sha256=
|
|
102
|
+
letta/orm/message.py,sha256=RIu-w2Qk8tt9V-3MwDO9uM1UU433skb1eLpZBMsdTHE,2288
|
|
103
103
|
letta/orm/mixins.py,sha256=9c79Kfr-Z1hL-SDYKeoptx_yMTbBwJJBo9nrKEzSDAc,1622
|
|
104
104
|
letta/orm/organization.py,sha256=b12iASuskPnG2yHyFh8p2BFROkoqMPEYUFMuVcFPCHs,2897
|
|
105
105
|
letta/orm/passage.py,sha256=tm5YhUozLR9hN7odGCqCniTl-3GDiFNz3LWAxullaGA,3132
|
|
@@ -107,7 +107,7 @@ letta/orm/provider.py,sha256=-qA9tvKTZgaM4D7CoDZZiA7zTgjaaWDV4jZvifQv_MM,805
|
|
|
107
107
|
letta/orm/sandbox_config.py,sha256=DyOy_1_zCMlp13elCqPcuuA6OwUove6mrjhcpROTg50,4150
|
|
108
108
|
letta/orm/source.py,sha256=xM3Iwy3xzYdoZja9BZrQwyAnPf5iksaQOs8HlNCvb_c,2031
|
|
109
109
|
letta/orm/sources_agents.py,sha256=Ik_PokCBrXRd9wXWomeNeb8EtLUwjb9VMZ8LWXqpK5A,473
|
|
110
|
-
letta/orm/sqlalchemy_base.py,sha256=
|
|
110
|
+
letta/orm/sqlalchemy_base.py,sha256=g3ZuILuaPD1IhqMi2k0Uwka7SYj4xl9XrwcHP1wz3PA,19442
|
|
111
111
|
letta/orm/sqlite_functions.py,sha256=JCScKiRlYCKxy9hChQ8wsk4GMKknZE24MunnG3fM1Gw,4255
|
|
112
112
|
letta/orm/step.py,sha256=6ygEnkQSIMxNH08Om0a-UK-f2E66QSpp9GdGm7mGjFg,2853
|
|
113
113
|
letta/orm/tool.py,sha256=dJi56QksOCYsz2RvXyGQODyuHmx0rEoU3E1wHt_jPOI,2293
|
|
@@ -140,34 +140,34 @@ letta/prompts/system/memgpt_modified_o1.txt,sha256=objnDgnxpF3-MmU28ZqZ7-TOG8UlH
|
|
|
140
140
|
letta/prompts/system/memgpt_offline_memory.txt,sha256=rWEJeF-6aiinjkJM9hgLUYCmlEcC_HekYB1bjEUYq6M,2460
|
|
141
141
|
letta/prompts/system/memgpt_offline_memory_chat.txt,sha256=ituh7gDuio7nC2UKFB7GpBq6crxb8bYedQfJ0ADoPgg,3949
|
|
142
142
|
letta/pytest.ini,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
|
-
letta/schemas/agent.py,sha256=
|
|
144
|
-
letta/schemas/block.py,sha256=
|
|
143
|
+
letta/schemas/agent.py,sha256=VmzzaRb4HA20fahzUxU2JOdcIxt2ywLFdTRjbR6Ogyk,11783
|
|
144
|
+
letta/schemas/block.py,sha256=FYYmRWjH4d4QHMUx_nmIXjv_qJna_l-Ip_4i51wDBPA,5942
|
|
145
145
|
letta/schemas/embedding_config.py,sha256=RkLbUorFkMWr1tPkn6c2aHrnICjWTbhPY86tIncwXyA,3373
|
|
146
146
|
letta/schemas/enums.py,sha256=f8SVJqb0dzhlNCBN2SgeM4ZMHX5LMyhln1SCJAgXeow,1068
|
|
147
|
-
letta/schemas/environment_variables.py,sha256=
|
|
147
|
+
letta/schemas/environment_variables.py,sha256=VRtzOjdeQdHcSHXisk7oJUQlheruxhSWNS0xqlfGzbs,2429
|
|
148
148
|
letta/schemas/file.py,sha256=ChN2CWzLI2TT9WLItcfElEH0E8b7kzPylF2OQBr6Beg,1550
|
|
149
149
|
letta/schemas/health.py,sha256=zT6mYovvD17iJRuu2rcaQQzbEEYrkwvAE9TB7iU824c,139
|
|
150
|
-
letta/schemas/job.py,sha256=
|
|
151
|
-
letta/schemas/letta_base.py,sha256=
|
|
152
|
-
letta/schemas/letta_message.py,sha256=
|
|
150
|
+
letta/schemas/job.py,sha256=npIWwV3G3eTTbN9rNxqI0Avb9Q3YJJ18e4CrjU-jMoM,1520
|
|
151
|
+
letta/schemas/letta_base.py,sha256=HTnSHJ2YSyhEdpY-vg9Y7ywqS1zzTjb9j5iVPYsuVSk,3991
|
|
152
|
+
letta/schemas/letta_message.py,sha256=k8j0_x0YRHV2QYfqCHOySTmoY-DoBR84rljKc-k2sDQ,9078
|
|
153
153
|
letta/schemas/letta_request.py,sha256=YRLjzGHQusj0NIue2AjCN-6j0cvxZ_DJQKjgTpT3fPc,1355
|
|
154
154
|
letta/schemas/letta_response.py,sha256=yL0w-cdUazgEqg6_F4LJz2tugKNAZsB83Gr5jfXwa5U,7124
|
|
155
155
|
letta/schemas/llm_config.py,sha256=HQrwXk6LGJVoOmZwTUXfK0jwVSeX9kCsL-GUcv7loWQ,4603
|
|
156
|
-
letta/schemas/memory.py,sha256=
|
|
157
|
-
letta/schemas/message.py,sha256=
|
|
156
|
+
letta/schemas/memory.py,sha256=GOYDfPKzbWftUWO9Hv4KW7xAi1EIQmC8zpP7qvEkVHw,10245
|
|
157
|
+
letta/schemas/message.py,sha256=XOObBue8VfWF2TStiPo3ASvJRovncy38kYMnOLW1YAU,34277
|
|
158
158
|
letta/schemas/openai/chat_completion_request.py,sha256=AOIwgbN3CZKVqkuXeMHeSa53u4h0wVq69t3T_LJ0vIE,3389
|
|
159
159
|
letta/schemas/openai/chat_completion_response.py,sha256=ub-oVSyLpuJd-5_yzCSIRR8tD3GM83IeDO1c1uAATa4,3970
|
|
160
160
|
letta/schemas/openai/chat_completions.py,sha256=V0ZPIIk-ds3O6MAkNHMz8zh1hqMFSPrTcYr88WDYzWE,3588
|
|
161
161
|
letta/schemas/openai/embedding_response.py,sha256=WKIZpXab1Av7v6sxKG8feW3ZtpQUNosmLVSuhXYa_xU,357
|
|
162
162
|
letta/schemas/openai/openai.py,sha256=Hilo5BiLAGabzxCwnwfzK5QrWqwYD8epaEKFa4Pwndk,7970
|
|
163
163
|
letta/schemas/organization.py,sha256=WWbUWVSp_VQRFwWN4fdHg1yObiV6x9rZnvIY8x5BPs0,746
|
|
164
|
-
letta/schemas/passage.py,sha256=
|
|
164
|
+
letta/schemas/passage.py,sha256=HOPdaTNCe6vZ1jqZf9PD758d0wG5haMW4Ztfde4ZQq8,3674
|
|
165
165
|
letta/schemas/providers.py,sha256=8sEM3J_KgHkYy7zy8IAsYgltqGMHt15nlNEdK6MpOTo,29668
|
|
166
166
|
letta/schemas/run.py,sha256=OyuAXXjL96ftOeLdqkiIKi9csGeewy-pN5SgWk-vYGg,2124
|
|
167
167
|
letta/schemas/sandbox_config.py,sha256=v32V5T73X-VxhDk0g_1RGniK985KMvg2xyLVi1dvMQY,4215
|
|
168
|
-
letta/schemas/source.py,sha256=
|
|
168
|
+
letta/schemas/source.py,sha256=Z9pGfZIpV19PY5kAbgzz15AckgSRYMab8FkSaC0DsMI,2850
|
|
169
169
|
letta/schemas/step.py,sha256=cCmDChQMndy7aMJGH0Z19VbzJkAeFTYuA0cJpzjW2g0,1928
|
|
170
|
-
letta/schemas/tool.py,sha256=
|
|
170
|
+
letta/schemas/tool.py,sha256=bvWMDH_dSSLqyXXvItiLENwHfXS067Cw-ZsKa6lAlmc,11302
|
|
171
171
|
letta/schemas/tool_rule.py,sha256=LJwi1T474-3zbFGiW7_fegyfduC3F2u7cdlBsV0U_IU,1679
|
|
172
172
|
letta/schemas/usage.py,sha256=8oYRH-JX0PfjIu2zkT5Uu3UWQ7Unnz_uHiO8hRGI4m0,912
|
|
173
173
|
letta/schemas/user.py,sha256=V32Tgl6oqB3KznkxUz12y7agkQicjzW7VocSpj78i6Q,1526
|
|
@@ -175,35 +175,29 @@ letta/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
175
175
|
letta/server/constants.py,sha256=yAdGbLkzlOU_dLTx0lKDmAnj0ZgRXCEaIcPJWO69eaE,92
|
|
176
176
|
letta/server/generate_openapi_schema.sh,sha256=0OtBhkC1g6CobVmNEd_m2B6sTdppjbJLXaM95icejvE,371
|
|
177
177
|
letta/server/rest_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
178
|
-
letta/server/rest_api/app.py,sha256=
|
|
178
|
+
letta/server/rest_api/app.py,sha256=0gQ9TJ6AvbuiyewtNkLPHsk1o3HltDdixCz1rqvhwJg,11108
|
|
179
179
|
letta/server/rest_api/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
180
180
|
letta/server/rest_api/auth/index.py,sha256=fQBGyVylGSRfEMLQ17cZzrHd5Y1xiVylvPqH5Rl-lXQ,1378
|
|
181
181
|
letta/server/rest_api/auth_token.py,sha256=725EFEIiNj4dh70hrSd94UysmFD8vcJLrTRfNHkzxDo,774
|
|
182
182
|
letta/server/rest_api/interface.py,sha256=1p8Bt7uLNLJsKa-TnLXobiLfO91laclK-AiE-jbJr18,51494
|
|
183
183
|
letta/server/rest_api/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
184
|
-
letta/server/rest_api/routers/openai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
185
|
-
letta/server/rest_api/routers/openai/assistants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
186
|
-
letta/server/rest_api/routers/openai/assistants/assistants.py,sha256=PXv5vLFDa3ptMBY6QJUkMaPqk2HFP0IpirJUCmgOY6k,4828
|
|
187
|
-
letta/server/rest_api/routers/openai/assistants/schemas.py,sha256=ZWUrmkvDMeywlxYhcp1hHzLXNgWpD8qWt80jRlhb7Rc,5605
|
|
188
|
-
letta/server/rest_api/routers/openai/chat_completions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
189
|
-
letta/server/rest_api/routers/openai/chat_completions/chat_completions.py,sha256=Sx_D1WvMDuI42Bt66_w4_h3-eT4hyn5pBPEn5yYlKc4,4600
|
|
190
184
|
letta/server/rest_api/routers/v1/__init__.py,sha256=bXEZzmvHNX7N11NDwsxyajjci7yxP-2dYIvbeJi33vA,1070
|
|
191
|
-
letta/server/rest_api/routers/v1/agents.py,sha256=
|
|
192
|
-
letta/server/rest_api/routers/v1/blocks.py,sha256=
|
|
185
|
+
letta/server/rest_api/routers/v1/agents.py,sha256=IAs3LsuoyWHBHJMKdfTNEvVXQ9tiCG8Sa98RI9GyGy0,25265
|
|
186
|
+
letta/server/rest_api/routers/v1/blocks.py,sha256=6zMA4qRbc1kqBzOhkX1Ra4mZM-Z-ccb-cwJf3sSjKt8,3145
|
|
193
187
|
letta/server/rest_api/routers/v1/health.py,sha256=pKCuVESlVOhGIb4VC4K-H82eZqfghmT6kvj2iOkkKuc,401
|
|
194
|
-
letta/server/rest_api/routers/v1/jobs.py,sha256
|
|
188
|
+
letta/server/rest_api/routers/v1/jobs.py,sha256=pKihW12hQdFwt6tHQXs94yOMv6xotlhBB3Vl7Q5ASKQ,2738
|
|
195
189
|
letta/server/rest_api/routers/v1/llms.py,sha256=lYp5URXtZk1yu_Pe-p1Wq1uQ0qeb6aWtx78rXSB7N_E,881
|
|
196
190
|
letta/server/rest_api/routers/v1/organizations.py,sha256=tyqVzXTpMtk3sKxI3Iz4aS6RhbGEbXDzFBB_CpW18v4,2080
|
|
197
|
-
letta/server/rest_api/routers/v1/providers.py,sha256=
|
|
198
|
-
letta/server/rest_api/routers/v1/runs.py,sha256=
|
|
191
|
+
letta/server/rest_api/routers/v1/providers.py,sha256=cUDcNsLxmv_q6BmW3d78qa-K7y3W87Dz_zChWl50jfE,2447
|
|
192
|
+
letta/server/rest_api/routers/v1/runs.py,sha256=zsxXyhGrPloyHVgcxMeREP-l2ay_zMUZdHRr5afV40o,5121
|
|
199
193
|
letta/server/rest_api/routers/v1/sandbox_configs.py,sha256=DJ8mz7HsXCuGypNaxTgoMW8xR1kMOwdVnon00srRdCo,5266
|
|
200
|
-
letta/server/rest_api/routers/v1/sources.py,sha256=
|
|
201
|
-
letta/server/rest_api/routers/v1/tags.py,sha256
|
|
202
|
-
letta/server/rest_api/routers/v1/tools.py,sha256=
|
|
194
|
+
letta/server/rest_api/routers/v1/sources.py,sha256=Bcy7E0KgzrNkjpHoywaQoNVFjxFdkVdh5UwRw20X1WA,8417
|
|
195
|
+
letta/server/rest_api/routers/v1/tags.py,sha256=j0Oach9hNcPQx2KVuN4QJQHVlhjbdL2pv1JExq9yCVo,881
|
|
196
|
+
letta/server/rest_api/routers/v1/tools.py,sha256=WwzLLEXoidQqtosPcV6nTIvuusbu6Iz3WIOFYq6jzE0,12013
|
|
203
197
|
letta/server/rest_api/routers/v1/users.py,sha256=EBQe9IfCG3kzHpKmotz4yVGZioXz3SCSRy5yEhJK8hU,2293
|
|
204
198
|
letta/server/rest_api/static_files.py,sha256=NG8sN4Z5EJ8JVQdj19tkFa9iQ1kBPTab9f_CUxd_u4Q,3143
|
|
205
199
|
letta/server/rest_api/utils.py,sha256=dsjkZzgo9Rk3fjUf1ajjiiql1eeO5DAzmXprttI7bJU,3993
|
|
206
|
-
letta/server/server.py,sha256=
|
|
200
|
+
letta/server/server.py,sha256=ZV7cNuvvFqJnAQ0vAT1Swc9Yo4YzAvapvF_jt-WxWh0,57625
|
|
207
201
|
letta/server/startup.sh,sha256=722uKJWB2C4q3vjn39De2zzPacaZNw_1fN1SpLGjKIo,1569
|
|
208
202
|
letta/server/static_files/assets/index-048c9598.js,sha256=mR16XppvselwKCcNgONs4L7kZEVa4OEERm4lNZYtLSk,146819
|
|
209
203
|
letta/server/static_files/assets/index-0e31b727.css,sha256=SBbja96uiQVLDhDOroHgM6NSl7tS4lpJRCREgSS_hA8,7672
|
|
@@ -217,28 +211,28 @@ letta/server/ws_api/interface.py,sha256=TWl9vkcMCnLsUtgsuENZ-ku2oMDA-OUTzLh_yNRo
|
|
|
217
211
|
letta/server/ws_api/protocol.py,sha256=M_-gM5iuDBwa1cuN2IGNCG5GxMJwU2d3XW93XALv9s8,1821
|
|
218
212
|
letta/server/ws_api/server.py,sha256=cBSzf-V4zT1bL_0i54OTI3cMXhTIIxqjSRF8pYjk7fg,5835
|
|
219
213
|
letta/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
220
|
-
letta/services/agent_manager.py,sha256=
|
|
221
|
-
letta/services/block_manager.py,sha256=
|
|
214
|
+
letta/services/agent_manager.py,sha256=BkGss9v1jBWSWok8bjvFInUZMHb-9Nats8kjJp9qtzg,47794
|
|
215
|
+
letta/services/block_manager.py,sha256=5unHvV0-nDRaPRFh-bcqr4Qye-b1-QWdpz-Il3CfLuM,4968
|
|
222
216
|
letta/services/helpers/agent_manager_helper.py,sha256=ytNViS18ubRbj90yZ2B3jf1on5pzxT9xaQOpCLFA-ss,10451
|
|
223
|
-
letta/services/job_manager.py,sha256=
|
|
217
|
+
letta/services/job_manager.py,sha256=KIXikN9dPrAK_lIEmgn3IdQ-thn6sMLs3zLfa9u7MeA,12897
|
|
224
218
|
letta/services/message_manager.py,sha256=a7U0MfgaNAdjbls7ZtUdS7eJ6prJaMkE0NIHgtzh4us,8552
|
|
225
|
-
letta/services/organization_manager.py,sha256=
|
|
226
|
-
letta/services/passage_manager.py,sha256=
|
|
219
|
+
letta/services/organization_manager.py,sha256=YRYQKlvIgc3gyKoubcwWVEyCbA9CXvh83EVATkkZNPs,3342
|
|
220
|
+
letta/services/passage_manager.py,sha256=INxeNiFAluAkzmCL5jeWWimA3ONUZcck8BuCa0UYajk,7714
|
|
227
221
|
letta/services/per_agent_lock_manager.py,sha256=porM0cKKANQ1FvcGXOO_qM7ARk5Fgi1HVEAhXsAg9-4,546
|
|
228
|
-
letta/services/provider_manager.py,sha256=
|
|
229
|
-
letta/services/sandbox_config_manager.py,sha256=
|
|
230
|
-
letta/services/source_manager.py,sha256=
|
|
222
|
+
letta/services/provider_manager.py,sha256=1NSbn9m5F8xvDw0bQ52Y8wqU0CXqORlbfv81lsiNQxM,3526
|
|
223
|
+
letta/services/sandbox_config_manager.py,sha256=5CoUqM4pw-RT5C3GgQjnDrb6eGo3Ovet-tKgnWFQx2k,13316
|
|
224
|
+
letta/services/source_manager.py,sha256=8P0EiKc9SXTECg5DeKL9RFTuXgIkGVup2NJfJ6YY6kI,7682
|
|
231
225
|
letta/services/step_manager.py,sha256=RngrVs2Sd_oDZv_UoQ1ToLY0RnH-6wS1DqIBPRm-Imc,2961
|
|
232
|
-
letta/services/tool_execution_sandbox.py,sha256=
|
|
233
|
-
letta/services/tool_manager.py,sha256=
|
|
234
|
-
letta/services/user_manager.py,sha256=
|
|
235
|
-
letta/settings.py,sha256=
|
|
226
|
+
letta/services/tool_execution_sandbox.py,sha256=Tjufm58V9XzeYr8oF6g5b3OV5zZ7oPWUTqcC8GsBi9k,23162
|
|
227
|
+
letta/services/tool_manager.py,sha256=mkWrr0PnTWi8JGKgfcV8WZ8H8FrJ6qsBAT04-2mF1zc,8458
|
|
228
|
+
letta/services/user_manager.py,sha256=RaXWC8Nbg_5GZSj2fIDXRFb6hRKWTtqtk2d5H4_Ywwo,4296
|
|
229
|
+
letta/settings.py,sha256=wqKdD4C9HjGWvQlbQN69LK6s_TYj4IT-au_sa1Ad6zE,6011
|
|
236
230
|
letta/streaming_interface.py,sha256=lo2VAQRUJOdWTijwnXuKOC9uejqr2siUAEmZiQUXkj8,15710
|
|
237
231
|
letta/streaming_utils.py,sha256=pJExJe6OgWDyRgzxbsSuT5JrVsXNlZP4hrT4Xu_z3Po,11778
|
|
238
|
-
letta/system.py,sha256=
|
|
232
|
+
letta/system.py,sha256=iCcjvMKXvG1sa18Suy8Gjoa0djYGiPKi3ywMECce40Y,6974
|
|
239
233
|
letta/utils.py,sha256=FQgWuYF0CTCIyH41rVy_rD5_ATPIlBZ24ovBtf3T1tI,33291
|
|
240
|
-
letta_nightly-0.6.
|
|
241
|
-
letta_nightly-0.6.
|
|
242
|
-
letta_nightly-0.6.
|
|
243
|
-
letta_nightly-0.6.
|
|
244
|
-
letta_nightly-0.6.
|
|
234
|
+
letta_nightly-0.6.14.dev20250123041709.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
|
|
235
|
+
letta_nightly-0.6.14.dev20250123041709.dist-info/METADATA,sha256=ZHGKF0OdySp8OMHZNGYT6t321QOXLMnjughyPUluedA,22116
|
|
236
|
+
letta_nightly-0.6.14.dev20250123041709.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
237
|
+
letta_nightly-0.6.14.dev20250123041709.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
|
|
238
|
+
letta_nightly-0.6.14.dev20250123041709.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
|
-
from fastapi import APIRouter, Body, HTTPException, Path, Query
|
|
4
|
-
|
|
5
|
-
from letta.constants import DEFAULT_PRESET
|
|
6
|
-
from letta.schemas.openai.openai import AssistantFile, OpenAIAssistant
|
|
7
|
-
from letta.server.rest_api.routers.openai.assistants.schemas import (
|
|
8
|
-
CreateAssistantFileRequest,
|
|
9
|
-
CreateAssistantRequest,
|
|
10
|
-
DeleteAssistantFileResponse,
|
|
11
|
-
DeleteAssistantResponse,
|
|
12
|
-
)
|
|
13
|
-
from letta.utils import get_utc_time
|
|
14
|
-
|
|
15
|
-
router = APIRouter()
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
# TODO: implement mechanism for creating/authenticating users associated with a bearer token
|
|
19
|
-
router = APIRouter(prefix="/v1/assistants", tags=["assistants"])
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
# create assistant (Letta agent)
|
|
23
|
-
@router.post("/", response_model=OpenAIAssistant)
|
|
24
|
-
def create_assistant(request: CreateAssistantRequest = Body(...)):
|
|
25
|
-
# TODO: create preset
|
|
26
|
-
return OpenAIAssistant(
|
|
27
|
-
id=DEFAULT_PRESET,
|
|
28
|
-
name="default_preset",
|
|
29
|
-
description=request.description,
|
|
30
|
-
created_at=int(get_utc_time().timestamp()),
|
|
31
|
-
model=request.model,
|
|
32
|
-
instructions=request.instructions,
|
|
33
|
-
tools=request.tools,
|
|
34
|
-
file_ids=request.file_ids,
|
|
35
|
-
metadata=request.metadata,
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@router.post("/{assistant_id}/files", response_model=AssistantFile)
|
|
40
|
-
def create_assistant_file(
|
|
41
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
42
|
-
request: CreateAssistantFileRequest = Body(...),
|
|
43
|
-
):
|
|
44
|
-
# TODO: add file to assistant
|
|
45
|
-
return AssistantFile(
|
|
46
|
-
id=request.file_id,
|
|
47
|
-
created_at=int(get_utc_time().timestamp()),
|
|
48
|
-
assistant_id=assistant_id,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
@router.get("/", response_model=List[OpenAIAssistant])
|
|
53
|
-
def list_assistants(
|
|
54
|
-
limit: int = Query(1000, description="How many assistants to retrieve."),
|
|
55
|
-
order: str = Query("asc", description="Order of assistants to retrieve (either 'asc' or 'desc')."),
|
|
56
|
-
after: str = Query(None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list."),
|
|
57
|
-
before: str = Query(None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list."),
|
|
58
|
-
):
|
|
59
|
-
# TODO: implement list assistants (i.e. list available Letta presets)
|
|
60
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
@router.get("/{assistant_id}/files", response_model=List[AssistantFile])
|
|
64
|
-
def list_assistant_files(
|
|
65
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
66
|
-
limit: int = Query(1000, description="How many files to retrieve."),
|
|
67
|
-
order: str = Query("asc", description="Order of files to retrieve (either 'asc' or 'desc')."),
|
|
68
|
-
after: str = Query(None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list."),
|
|
69
|
-
before: str = Query(None, description="A cursor for use in pagination. `after` is an object ID that defines your place in the list."),
|
|
70
|
-
):
|
|
71
|
-
# TODO: list attached data sources to preset
|
|
72
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
@router.get("/{assistant_id}", response_model=OpenAIAssistant)
|
|
76
|
-
def retrieve_assistant(
|
|
77
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
78
|
-
):
|
|
79
|
-
# TODO: get and return preset
|
|
80
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
@router.get("/{assistant_id}/files/{file_id}", response_model=AssistantFile)
|
|
84
|
-
def retrieve_assistant_file(
|
|
85
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
86
|
-
file_id: str = Path(..., description="The unique identifier of the file."),
|
|
87
|
-
):
|
|
88
|
-
# TODO: return data source attached to preset
|
|
89
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@router.post("/{assistant_id}", response_model=OpenAIAssistant)
|
|
93
|
-
def modify_assistant(
|
|
94
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
95
|
-
request: CreateAssistantRequest = Body(...),
|
|
96
|
-
):
|
|
97
|
-
# TODO: modify preset
|
|
98
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
@router.delete("/{assistant_id}", response_model=DeleteAssistantResponse)
|
|
102
|
-
def delete_assistant(
|
|
103
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
104
|
-
):
|
|
105
|
-
# TODO: delete preset
|
|
106
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@router.delete("/{assistant_id}/files/{file_id}", response_model=DeleteAssistantFileResponse)
|
|
110
|
-
def delete_assistant_file(
|
|
111
|
-
assistant_id: str = Path(..., description="The unique identifier of the assistant."),
|
|
112
|
-
file_id: str = Path(..., description="The unique identifier of the file."),
|
|
113
|
-
):
|
|
114
|
-
# TODO: delete source on preset
|
|
115
|
-
raise HTTPException(status_code=404, detail="Not yet implemented (coming soon)")
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
from typing import List, Optional
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
from letta.schemas.openai.openai import MessageRoleType, OpenAIMessage, OpenAIThread, ToolCall, ToolCallOutput
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class CreateAssistantRequest(BaseModel):
|
|
9
|
-
model: str = Field(..., description="The model to use for the assistant.")
|
|
10
|
-
name: str = Field(..., description="The name of the assistant.")
|
|
11
|
-
description: str = Field(None, description="The description of the assistant.")
|
|
12
|
-
instructions: str = Field(..., description="The instructions for the assistant.")
|
|
13
|
-
tools: List[str] = Field(None, description="The tools used by the assistant.")
|
|
14
|
-
file_ids: List[str] = Field(None, description="List of file IDs associated with the assistant.")
|
|
15
|
-
metadata: dict = Field(None, description="Metadata associated with the assistant.")
|
|
16
|
-
|
|
17
|
-
# letta-only (not openai)
|
|
18
|
-
embedding_model: str = Field(None, description="The model to use for the assistant.")
|
|
19
|
-
|
|
20
|
-
## TODO: remove
|
|
21
|
-
# user_id: str = Field(..., description="The unique identifier of the user.")
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class CreateThreadRequest(BaseModel):
|
|
25
|
-
messages: Optional[List[str]] = Field(None, description="List of message IDs associated with the thread.")
|
|
26
|
-
metadata: Optional[dict] = Field(None, description="Metadata associated with the thread.")
|
|
27
|
-
|
|
28
|
-
# letta-only
|
|
29
|
-
assistant_name: Optional[str] = Field(None, description="The name of the assistant (i.e. Letta preset)")
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
class ModifyThreadRequest(BaseModel):
|
|
33
|
-
metadata: dict = Field(None, description="Metadata associated with the thread.")
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class ModifyMessageRequest(BaseModel):
|
|
37
|
-
metadata: dict = Field(None, description="Metadata associated with the message.")
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class ModifyRunRequest(BaseModel):
|
|
41
|
-
metadata: dict = Field(None, description="Metadata associated with the run.")
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class CreateMessageRequest(BaseModel):
|
|
45
|
-
role: str = Field(..., description="Role of the message sender (either 'user' or 'system')")
|
|
46
|
-
content: str = Field(..., description="The message content to be processed by the agent.")
|
|
47
|
-
file_ids: Optional[List[str]] = Field(None, description="List of file IDs associated with the message.")
|
|
48
|
-
metadata: Optional[dict] = Field(None, description="Metadata associated with the message.")
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
class UserMessageRequest(BaseModel):
|
|
52
|
-
user_id: str = Field(..., description="The unique identifier of the user.")
|
|
53
|
-
agent_id: str = Field(..., description="The unique identifier of the agent.")
|
|
54
|
-
message: str = Field(..., description="The message content to be processed by the agent.")
|
|
55
|
-
stream: bool = Field(default=False, description="Flag to determine if the response should be streamed. Set to True for streaming.")
|
|
56
|
-
role: MessageRoleType = Field(default=MessageRoleType.user, description="Role of the message sender (either 'user' or 'system')")
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
class UserMessageResponse(BaseModel):
|
|
60
|
-
messages: List[dict] = Field(..., description="List of messages generated by the agent in response to the received message.")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
class GetAgentMessagesRequest(BaseModel):
|
|
64
|
-
user_id: str = Field(..., description="The unique identifier of the user.")
|
|
65
|
-
agent_id: str = Field(..., description="The unique identifier of the agent.")
|
|
66
|
-
start: int = Field(..., description="Message index to start on (reverse chronological).")
|
|
67
|
-
count: int = Field(..., description="How many messages to retrieve.")
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
class ListMessagesResponse(BaseModel):
|
|
71
|
-
messages: List[OpenAIMessage] = Field(..., description="List of message objects.")
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
class CreateAssistantFileRequest(BaseModel):
|
|
75
|
-
file_id: str = Field(..., description="The unique identifier of the file.")
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class CreateRunRequest(BaseModel):
|
|
79
|
-
assistant_id: str = Field(..., description="The unique identifier of the assistant.")
|
|
80
|
-
model: Optional[str] = Field(None, description="The model used by the run.")
|
|
81
|
-
instructions: str = Field(..., description="The instructions for the run.")
|
|
82
|
-
additional_instructions: Optional[str] = Field(None, description="Additional instructions for the run.")
|
|
83
|
-
tools: Optional[List[ToolCall]] = Field(None, description="The tools used by the run (overrides assistant).")
|
|
84
|
-
metadata: Optional[dict] = Field(None, description="Metadata associated with the run.")
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class CreateThreadRunRequest(BaseModel):
|
|
88
|
-
assistant_id: str = Field(..., description="The unique identifier of the assistant.")
|
|
89
|
-
thread: OpenAIThread = Field(..., description="The thread to run.")
|
|
90
|
-
model: str = Field(..., description="The model used by the run.")
|
|
91
|
-
instructions: str = Field(..., description="The instructions for the run.")
|
|
92
|
-
tools: Optional[List[ToolCall]] = Field(None, description="The tools used by the run (overrides assistant).")
|
|
93
|
-
metadata: Optional[dict] = Field(None, description="Metadata associated with the run.")
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
class DeleteAssistantResponse(BaseModel):
|
|
97
|
-
id: str = Field(..., description="The unique identifier of the agent.")
|
|
98
|
-
object: str = "assistant.deleted"
|
|
99
|
-
deleted: bool = Field(..., description="Whether the agent was deleted.")
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
class DeleteAssistantFileResponse(BaseModel):
|
|
103
|
-
id: str = Field(..., description="The unique identifier of the file.")
|
|
104
|
-
object: str = "assistant.file.deleted"
|
|
105
|
-
deleted: bool = Field(..., description="Whether the file was deleted.")
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
class DeleteThreadResponse(BaseModel):
|
|
109
|
-
id: str = Field(..., description="The unique identifier of the agent.")
|
|
110
|
-
object: str = "thread.deleted"
|
|
111
|
-
deleted: bool = Field(..., description="Whether the agent was deleted.")
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
class SubmitToolOutputsToRunRequest(BaseModel):
|
|
115
|
-
tools_outputs: List[ToolCallOutput] = Field(..., description="The tool outputs to submit.")
|
|
File without changes
|