letta-nightly 0.5.3.dev20241120104224__py3-none-any.whl → 0.5.3.dev20241121022151__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/client/client.py +11 -1
- letta/embeddings.py +3 -11
- letta/server/server.py +9 -1
- {letta_nightly-0.5.3.dev20241120104224.dist-info → letta_nightly-0.5.3.dev20241121022151.dist-info}/METADATA +2 -2
- {letta_nightly-0.5.3.dev20241120104224.dist-info → letta_nightly-0.5.3.dev20241121022151.dist-info}/RECORD +8 -8
- {letta_nightly-0.5.3.dev20241120104224.dist-info → letta_nightly-0.5.3.dev20241121022151.dist-info}/LICENSE +0 -0
- {letta_nightly-0.5.3.dev20241120104224.dist-info → letta_nightly-0.5.3.dev20241121022151.dist-info}/WHEEL +0 -0
- {letta_nightly-0.5.3.dev20241120104224.dist-info → letta_nightly-0.5.3.dev20241121022151.dist-info}/entry_points.txt +0 -0
letta/client/client.py
CHANGED
|
@@ -79,6 +79,7 @@ class AbstractClient(object):
|
|
|
79
79
|
include_base_tools: Optional[bool] = True,
|
|
80
80
|
metadata: Optional[Dict] = {"human:": DEFAULT_HUMAN, "persona": DEFAULT_PERSONA},
|
|
81
81
|
description: Optional[str] = None,
|
|
82
|
+
tags: Optional[List[str]] = None,
|
|
82
83
|
) -> AgentState:
|
|
83
84
|
raise NotImplementedError
|
|
84
85
|
|
|
@@ -94,6 +95,7 @@ class AbstractClient(object):
|
|
|
94
95
|
embedding_config: Optional[EmbeddingConfig] = None,
|
|
95
96
|
message_ids: Optional[List[str]] = None,
|
|
96
97
|
memory: Optional[Memory] = None,
|
|
98
|
+
tags: Optional[List[str]] = None,
|
|
97
99
|
):
|
|
98
100
|
raise NotImplementedError
|
|
99
101
|
|
|
@@ -381,6 +383,7 @@ class RESTClient(AbstractClient):
|
|
|
381
383
|
metadata: Optional[Dict] = {"human:": DEFAULT_HUMAN, "persona": DEFAULT_PERSONA},
|
|
382
384
|
description: Optional[str] = None,
|
|
383
385
|
initial_message_sequence: Optional[List[Message]] = None,
|
|
386
|
+
tags: Optional[List[str]] = None,
|
|
384
387
|
) -> AgentState:
|
|
385
388
|
"""Create an agent
|
|
386
389
|
|
|
@@ -394,6 +397,7 @@ class RESTClient(AbstractClient):
|
|
|
394
397
|
include_base_tools (bool): Include base tools
|
|
395
398
|
metadata (Dict): Metadata
|
|
396
399
|
description (str): Description
|
|
400
|
+
tags (List[str]): Tags for filtering agents
|
|
397
401
|
|
|
398
402
|
Returns:
|
|
399
403
|
agent_state (AgentState): State of the created agent
|
|
@@ -435,6 +439,7 @@ class RESTClient(AbstractClient):
|
|
|
435
439
|
llm_config=llm_config if llm_config else self._default_llm_config,
|
|
436
440
|
embedding_config=embedding_config if embedding_config else self._default_embedding_config,
|
|
437
441
|
initial_message_sequence=initial_message_sequence,
|
|
442
|
+
tags=tags,
|
|
438
443
|
)
|
|
439
444
|
|
|
440
445
|
# Use model_dump_json() instead of model_dump()
|
|
@@ -482,12 +487,12 @@ class RESTClient(AbstractClient):
|
|
|
482
487
|
description: Optional[str] = None,
|
|
483
488
|
system: Optional[str] = None,
|
|
484
489
|
tools: Optional[List[str]] = None,
|
|
485
|
-
tags: Optional[List[str]] = None,
|
|
486
490
|
metadata: Optional[Dict] = None,
|
|
487
491
|
llm_config: Optional[LLMConfig] = None,
|
|
488
492
|
embedding_config: Optional[EmbeddingConfig] = None,
|
|
489
493
|
message_ids: Optional[List[str]] = None,
|
|
490
494
|
memory: Optional[Memory] = None,
|
|
495
|
+
tags: Optional[List[str]] = None,
|
|
491
496
|
):
|
|
492
497
|
"""
|
|
493
498
|
Update an existing agent
|
|
@@ -503,6 +508,7 @@ class RESTClient(AbstractClient):
|
|
|
503
508
|
embedding_config (EmbeddingConfig): Embedding configuration
|
|
504
509
|
message_ids (List[str]): List of message IDs
|
|
505
510
|
memory (Memory): Memory configuration
|
|
511
|
+
tags (List[str]): Tags for filtering agents
|
|
506
512
|
|
|
507
513
|
Returns:
|
|
508
514
|
agent_state (AgentState): State of the updated agent
|
|
@@ -1669,6 +1675,7 @@ class LocalClient(AbstractClient):
|
|
|
1669
1675
|
metadata: Optional[Dict] = {"human:": DEFAULT_HUMAN, "persona": DEFAULT_PERSONA},
|
|
1670
1676
|
description: Optional[str] = None,
|
|
1671
1677
|
initial_message_sequence: Optional[List[Message]] = None,
|
|
1678
|
+
tags: Optional[List[str]] = None,
|
|
1672
1679
|
) -> AgentState:
|
|
1673
1680
|
"""Create an agent
|
|
1674
1681
|
|
|
@@ -1683,6 +1690,7 @@ class LocalClient(AbstractClient):
|
|
|
1683
1690
|
include_base_tools (bool): Include base tools
|
|
1684
1691
|
metadata (Dict): Metadata
|
|
1685
1692
|
description (str): Description
|
|
1693
|
+
tags (List[str]): Tags for filtering agents
|
|
1686
1694
|
|
|
1687
1695
|
Returns:
|
|
1688
1696
|
agent_state (AgentState): State of the created agent
|
|
@@ -1724,6 +1732,7 @@ class LocalClient(AbstractClient):
|
|
|
1724
1732
|
llm_config=llm_config if llm_config else self._default_llm_config,
|
|
1725
1733
|
embedding_config=embedding_config if embedding_config else self._default_embedding_config,
|
|
1726
1734
|
initial_message_sequence=initial_message_sequence,
|
|
1735
|
+
tags=tags,
|
|
1727
1736
|
),
|
|
1728
1737
|
actor=self.user,
|
|
1729
1738
|
)
|
|
@@ -1780,6 +1789,7 @@ class LocalClient(AbstractClient):
|
|
|
1780
1789
|
embedding_config (EmbeddingConfig): Embedding configuration
|
|
1781
1790
|
message_ids (List[str]): List of message IDs
|
|
1782
1791
|
memory (Memory): Memory configuration
|
|
1792
|
+
tags (List[str]): Tags for filtering agents
|
|
1783
1793
|
|
|
1784
1794
|
Returns:
|
|
1785
1795
|
agent_state (AgentState): State of the updated agent
|
letta/embeddings.py
CHANGED
|
@@ -3,18 +3,7 @@ import uuid
|
|
|
3
3
|
from typing import Any, List, Optional
|
|
4
4
|
|
|
5
5
|
import numpy as np
|
|
6
|
-
|
|
7
|
-
# from llama_index.core.base.embeddings import BaseEmbedding
|
|
8
|
-
# from llama_index.core.embeddings import BaseEmbedding
|
|
9
|
-
# from llama_index.core.base.embeddings.base import BaseEmbedding
|
|
10
|
-
# from llama_index.bridge.pydantic import PrivateAttr
|
|
11
|
-
# from llama_index.embeddings.base import BaseEmbedding
|
|
12
|
-
# from llama_index.embeddings.huggingface_utils import format_text
|
|
13
6
|
import tiktoken
|
|
14
|
-
from llama_index.core import Document as LlamaIndexDocument
|
|
15
|
-
|
|
16
|
-
# from llama_index.core.base.embeddings import BaseEmbedding
|
|
17
|
-
from llama_index.core.node_parser import SentenceSplitter
|
|
18
7
|
|
|
19
8
|
from letta.constants import (
|
|
20
9
|
EMBEDDING_TO_TOKENIZER_DEFAULT,
|
|
@@ -26,6 +15,9 @@ from letta.utils import is_valid_url, printd
|
|
|
26
15
|
|
|
27
16
|
|
|
28
17
|
def parse_and_chunk_text(text: str, chunk_size: int) -> List[str]:
|
|
18
|
+
from llama_index.core import Document as LlamaIndexDocument
|
|
19
|
+
from llama_index.core.node_parser import SentenceSplitter
|
|
20
|
+
|
|
29
21
|
parser = SentenceSplitter(chunk_size=chunk_size)
|
|
30
22
|
llama_index_docs = [LlamaIndexDocument(text=text)]
|
|
31
23
|
nodes = parser.get_nodes_from_documents(llama_index_docs)
|
letta/server/server.py
CHANGED
|
@@ -860,6 +860,7 @@ class SyncServer(Server):
|
|
|
860
860
|
memory=request.memory,
|
|
861
861
|
description=request.description,
|
|
862
862
|
metadata_=request.metadata_,
|
|
863
|
+
tags=request.tags,
|
|
863
864
|
)
|
|
864
865
|
if request.agent_type == AgentType.memgpt_agent:
|
|
865
866
|
agent = Agent(
|
|
@@ -904,8 +905,15 @@ class SyncServer(Server):
|
|
|
904
905
|
save_agent(agent, self.ms)
|
|
905
906
|
logger.debug(f"Created new agent from config: {agent}")
|
|
906
907
|
|
|
908
|
+
# TODO: move this into save_agent. save_agent should be moved to server.py
|
|
909
|
+
if request.tags:
|
|
910
|
+
for tag in request.tags:
|
|
911
|
+
self.agents_tags_manager.add_tag_to_agent(agent_id=agent.agent_state.id, tag=tag, actor=actor)
|
|
912
|
+
|
|
907
913
|
assert isinstance(agent.agent_state.memory, Memory), f"Invalid memory type: {type(agent_state.memory)}"
|
|
908
|
-
|
|
914
|
+
|
|
915
|
+
# TODO: remove (hacky)
|
|
916
|
+
agent.agent_state.tags = self.agents_tags_manager.get_tags_for_agent(agent_id=agent.agent_state.id, actor=actor)
|
|
909
917
|
|
|
910
918
|
return agent.agent_state
|
|
911
919
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-nightly
|
|
3
|
-
Version: 0.5.3.
|
|
3
|
+
Version: 0.5.3.dev20241121022151
|
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
|
5
5
|
License: Apache License
|
|
6
6
|
Author: Letta Team
|
|
@@ -56,7 +56,7 @@ Requires-Dist: prettytable (>=3.9.0,<4.0.0)
|
|
|
56
56
|
Requires-Dist: psycopg2 (>=2.9.10,<3.0.0) ; extra == "postgres"
|
|
57
57
|
Requires-Dist: psycopg2-binary (>=2.9.10,<3.0.0) ; extra == "postgres"
|
|
58
58
|
Requires-Dist: pyautogen (==0.2.22) ; extra == "autogen"
|
|
59
|
-
Requires-Dist: pydantic (>=2.7.4,<
|
|
59
|
+
Requires-Dist: pydantic (>=2.7.4,<2.10.0)
|
|
60
60
|
Requires-Dist: pydantic-settings (>=2.2.1,<3.0.0)
|
|
61
61
|
Requires-Dist: pyhumps (>=3.8.0,<4.0.0)
|
|
62
62
|
Requires-Dist: pymilvus (>=2.4.3,<3.0.0) ; extra == "milvus"
|
|
@@ -13,7 +13,7 @@ letta/cli/cli.py,sha256=1dJIZ8DIGM8mg0G0UGLKMTa3fwgHzrN8Hkxd5Uxx7X4,16946
|
|
|
13
13
|
letta/cli/cli_config.py,sha256=D-CpSZI1cDvdSQr3-zhGuDrJnZo1Ko7bi_wuxcBxxqo,8555
|
|
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=
|
|
16
|
+
letta/client/client.py,sha256=1eLqzAUKoO63Ee_p4LjJjrlqmv4phUZc2MPMXhPpEw0,98717
|
|
17
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
|
|
@@ -21,7 +21,7 @@ letta/constants.py,sha256=gg9bI-dqfejJem73iTBVoCygnbKoxCX-PCrnX6kw1YQ,6653
|
|
|
21
21
|
letta/credentials.py,sha256=D9mlcPsdDWlIIXQQD8wSPE9M_QvsRrb0p3LB5i9OF5Q,5806
|
|
22
22
|
letta/data_sources/connectors.py,sha256=5VKxfeV-QyUlK1wexLlpgar99dGm6PHxFaEbSeByo_U,9923
|
|
23
23
|
letta/data_sources/connectors_helper.py,sha256=2TQjCt74fCgT5sw1AP8PalDEk06jPBbhrPG4HVr-WLs,3371
|
|
24
|
-
letta/embeddings.py,sha256=
|
|
24
|
+
letta/embeddings.py,sha256=3vJaQ8RMLLp6yiYZGsthq6Xsu4keb9gp7DYN_2GPBFU,8459
|
|
25
25
|
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
|
|
@@ -185,7 +185,7 @@ letta/server/rest_api/routers/v1/tools.py,sha256=Bkb9oKswOycj5S3fBeim7LpDrZf37Sy
|
|
|
185
185
|
letta/server/rest_api/routers/v1/users.py,sha256=M1wEr2IyHzuRwINYxLXTkrbAH3osLe_cWjzrWrzR1aw,3729
|
|
186
186
|
letta/server/rest_api/static_files.py,sha256=NG8sN4Z5EJ8JVQdj19tkFa9iQ1kBPTab9f_CUxd_u4Q,3143
|
|
187
187
|
letta/server/rest_api/utils.py,sha256=GdHYCzXtbM5VCAYDPR0z5gnNZpRhwPld2BGZV7xT6cU,2924
|
|
188
|
-
letta/server/server.py,sha256=
|
|
188
|
+
letta/server/server.py,sha256=hYlHYb93kjgtBvnQ6RoRstA80wTRfsKpSECVQVkgR7s,77287
|
|
189
189
|
letta/server/startup.sh,sha256=wTOQOJJZw_Iec57WIu0UW0AVflk0ZMWYZWg8D3T_gSQ,698
|
|
190
190
|
letta/server/static_files/assets/index-3ab03d5b.css,sha256=OrA9W4iKJ5h2Wlr7GwdAT4wow0CM8hVit1yOxEL49Qw,54295
|
|
191
191
|
letta/server/static_files/assets/index-9fa459a2.js,sha256=j2oMcDJO9dWJaH5e-tsflbVpWK20gLWpZKJk4-Kuy6A,1815592
|
|
@@ -210,8 +210,8 @@ letta/streaming_interface.py,sha256=_FPUWy58j50evHcpXyd7zB1wWqeCc71NCFeWh_TBvnw,
|
|
|
210
210
|
letta/streaming_utils.py,sha256=329fsvj1ZN0r0LpQtmMPZ2vSxkDBIUUwvGHZFkjm2I8,11745
|
|
211
211
|
letta/system.py,sha256=buKYPqG5n2x41hVmWpu6JUpyd7vTWED9Km2_M7dLrvk,6960
|
|
212
212
|
letta/utils.py,sha256=COwQLAt02eEM9tjp6p5kN8YeTqGXr714l5BvffLVCLU,32376
|
|
213
|
-
letta_nightly-0.5.3.
|
|
214
|
-
letta_nightly-0.5.3.
|
|
215
|
-
letta_nightly-0.5.3.
|
|
216
|
-
letta_nightly-0.5.3.
|
|
217
|
-
letta_nightly-0.5.3.
|
|
213
|
+
letta_nightly-0.5.3.dev20241121022151.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
|
|
214
|
+
letta_nightly-0.5.3.dev20241121022151.dist-info/METADATA,sha256=aZ1G_K6dHCtPcBzYou7tuKNzF8QEgntsnNvMYSHfbMQ,11070
|
|
215
|
+
letta_nightly-0.5.3.dev20241121022151.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
216
|
+
letta_nightly-0.5.3.dev20241121022151.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
|
|
217
|
+
letta_nightly-0.5.3.dev20241121022151.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|