letta-nightly 0.7.27.dev20250527104330__py3-none-any.whl → 0.7.28.dev20250528220726__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.
- letta/__init__.py +1 -1
- letta/llm_api/google_vertex_client.py +1 -0
- letta/orm/agent.py +1 -1
- letta/orm/sqlalchemy_base.py +0 -36
- letta/services/helpers/agent_manager_helper.py +5 -7
- {letta_nightly-0.7.27.dev20250527104330.dist-info → letta_nightly-0.7.28.dev20250528220726.dist-info}/METADATA +1 -1
- {letta_nightly-0.7.27.dev20250527104330.dist-info → letta_nightly-0.7.28.dev20250528220726.dist-info}/RECORD +10 -10
- {letta_nightly-0.7.27.dev20250527104330.dist-info → letta_nightly-0.7.28.dev20250528220726.dist-info}/LICENSE +0 -0
- {letta_nightly-0.7.27.dev20250527104330.dist-info → letta_nightly-0.7.28.dev20250528220726.dist-info}/WHEEL +0 -0
- {letta_nightly-0.7.27.dev20250527104330.dist-info → letta_nightly-0.7.28.dev20250528220726.dist-info}/entry_points.txt +0 -0
letta/__init__.py
CHANGED
letta/orm/agent.py
CHANGED
letta/orm/sqlalchemy_base.py
CHANGED
@@ -61,8 +61,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
61
61
|
query_text: Optional[str] = None,
|
62
62
|
query_embedding: Optional[List[float]] = None,
|
63
63
|
ascending: bool = True,
|
64
|
-
tags: Optional[List[str]] = None,
|
65
|
-
match_all_tags: bool = False,
|
66
64
|
actor: Optional["User"] = None,
|
67
65
|
access: Optional[List[Literal["read", "write", "admin"]]] = ["read"],
|
68
66
|
access_type: AccessType = AccessType.ORGANIZATION,
|
@@ -86,8 +84,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
86
84
|
query_text: Text to search for
|
87
85
|
query_embedding: Vector to search for similar embeddings
|
88
86
|
ascending: Sort direction
|
89
|
-
tags: List of tags to filter by
|
90
|
-
match_all_tags: If True, return items matching all tags. If False, match any tag.
|
91
87
|
**kwargs: Additional filters to apply
|
92
88
|
"""
|
93
89
|
if start_date and end_date and start_date > end_date:
|
@@ -123,8 +119,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
123
119
|
query_text=query_text,
|
124
120
|
query_embedding=query_embedding,
|
125
121
|
ascending=ascending,
|
126
|
-
tags=tags,
|
127
|
-
match_all_tags=match_all_tags,
|
128
122
|
actor=actor,
|
129
123
|
access=access,
|
130
124
|
access_type=access_type,
|
@@ -162,8 +156,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
162
156
|
query_text: Optional[str] = None,
|
163
157
|
query_embedding: Optional[List[float]] = None,
|
164
158
|
ascending: bool = True,
|
165
|
-
tags: Optional[List[str]] = None,
|
166
|
-
match_all_tags: bool = False,
|
167
159
|
actor: Optional["User"] = None,
|
168
160
|
access: Optional[List[Literal["read", "write", "admin"]]] = ["read"],
|
169
161
|
access_type: AccessType = AccessType.ORGANIZATION,
|
@@ -189,8 +181,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
189
181
|
query_text: Text to search for
|
190
182
|
query_embedding: Vector to search for similar embeddings
|
191
183
|
ascending: Sort direction
|
192
|
-
tags: List of tags to filter by
|
193
|
-
match_all_tags: If True, return items matching all tags. If False, match any tag.
|
194
184
|
**kwargs: Additional filters to apply
|
195
185
|
"""
|
196
186
|
if start_date and end_date and start_date > end_date:
|
@@ -226,8 +216,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
226
216
|
query_text=query_text,
|
227
217
|
query_embedding=query_embedding,
|
228
218
|
ascending=ascending,
|
229
|
-
tags=tags,
|
230
|
-
match_all_tags=match_all_tags,
|
231
219
|
actor=actor,
|
232
220
|
access=access,
|
233
221
|
access_type=access_type,
|
@@ -263,8 +251,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
263
251
|
query_text: Optional[str] = None,
|
264
252
|
query_embedding: Optional[List[float]] = None,
|
265
253
|
ascending: bool = True,
|
266
|
-
tags: Optional[List[str]] = None,
|
267
|
-
match_all_tags: bool = False,
|
268
254
|
actor: Optional["User"] = None,
|
269
255
|
access: Optional[List[Literal["read", "write", "admin"]]] = ["read"],
|
270
256
|
access_type: AccessType = AccessType.ORGANIZATION,
|
@@ -286,28 +272,6 @@ class SqlalchemyBase(CommonSqlalchemyMetaMixins, Base):
|
|
286
272
|
if actor:
|
287
273
|
query = cls.apply_access_predicate(query, actor, access, access_type)
|
288
274
|
|
289
|
-
# Handle tag filtering if the model has tags
|
290
|
-
if tags and hasattr(cls, "tags"):
|
291
|
-
query = select(cls)
|
292
|
-
|
293
|
-
if match_all_tags:
|
294
|
-
# Match ALL tags - use subqueries
|
295
|
-
subquery = (
|
296
|
-
select(cls.tags.property.mapper.class_.agent_id)
|
297
|
-
.where(cls.tags.property.mapper.class_.tag.in_(tags))
|
298
|
-
.group_by(cls.tags.property.mapper.class_.agent_id)
|
299
|
-
.having(func.count() == len(tags))
|
300
|
-
)
|
301
|
-
query = query.filter(cls.id.in_(subquery))
|
302
|
-
else:
|
303
|
-
# Match ANY tag - use join and filter
|
304
|
-
query = (
|
305
|
-
query.join(cls.tags).filter(cls.tags.property.mapper.class_.tag.in_(tags)).distinct(cls.id).order_by(cls.id)
|
306
|
-
) # Deduplicate results
|
307
|
-
|
308
|
-
# select distinct primary key
|
309
|
-
query = query.distinct(cls.id).order_by(cls.id)
|
310
|
-
|
311
275
|
if identifier_keys and hasattr(cls, "identities"):
|
312
276
|
query = query.join(cls.identities).filter(cls.identities.property.mapper.class_.identifier_key.in_(identifier_keys))
|
313
277
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import datetime
|
2
2
|
from typing import List, Literal, Optional
|
3
3
|
|
4
|
-
from sqlalchemy import and_, asc, desc,
|
4
|
+
from sqlalchemy import and_, asc, desc, exists, or_, select
|
5
5
|
|
6
6
|
from letta import system
|
7
7
|
from letta.constants import IN_CONTEXT_MEMORY_KEYWORD, STRUCTURED_OUTPUT_MODELS
|
@@ -438,13 +438,11 @@ def _apply_tag_filter(query, tags: Optional[List[str]], match_all_tags: bool):
|
|
438
438
|
The modified query with tag filters applied.
|
439
439
|
"""
|
440
440
|
if tags:
|
441
|
-
# Build a subquery to select agent IDs that have the specified tags.
|
442
|
-
subquery = select(AgentsTags.agent_id).where(AgentsTags.tag.in_(tags)).group_by(AgentsTags.agent_id)
|
443
|
-
# If all tags must match, add a HAVING clause to ensure the count of tags equals the number provided.
|
444
441
|
if match_all_tags:
|
445
|
-
|
446
|
-
|
447
|
-
|
442
|
+
for tag in tags:
|
443
|
+
query = query.filter(exists().where((AgentsTags.agent_id == AgentModel.id) & (AgentsTags.tag == tag)))
|
444
|
+
else:
|
445
|
+
query = query.where(exists().where((AgentsTags.agent_id == AgentModel.id) & (AgentsTags.tag.in_(tags))))
|
448
446
|
return query
|
449
447
|
|
450
448
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
letta/__init__.py,sha256=
|
1
|
+
letta/__init__.py,sha256=yOf-32vlAg_yweq_nDaRVyeKTfYdaELQzQJUQnVAkSs,888
|
2
2
|
letta/agent.py,sha256=2r6xovRHeUnmWZ6WJoIP217ryse5Q3Bkco1JXiV599w,87459
|
3
3
|
letta/agents/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
letta/agents/base_agent.py,sha256=mdFEpYBVyFjmt6BzO9YrpJnH99RkBWZ9gnP3Q_bnbBI,5505
|
@@ -78,7 +78,7 @@ letta/llm_api/cohere.py,sha256=IZ6LXyOFMYjWHTeNG9lvFxCdV_NIl0hY2q9SPFYXNkQ,14849
|
|
78
78
|
letta/llm_api/deepseek.py,sha256=b1mSW8gnBrpAI8d2GcBpDyLYDnuC-P1UP6xJPalfQS4,12456
|
79
79
|
letta/llm_api/google_ai_client.py,sha256=WSLTayAd7FQPilIZ7MxJnSCgw4JCl2vY_KE2aorvr5Q,9933
|
80
80
|
letta/llm_api/google_constants.py,sha256=4PKWUNNbBHgHi4K5u9YaHr_8UC3fokfI6Qb6Dfpt4mU,693
|
81
|
-
letta/llm_api/google_vertex_client.py,sha256=
|
81
|
+
letta/llm_api/google_vertex_client.py,sha256=jihAplMvkcgWRd_u0_1qQmhCEG3N5Okx03nkF7g6wPI,22846
|
82
82
|
letta/llm_api/helpers.py,sha256=rpZInutKVKgoywreclisNSi2zVxwFinAzJIuxF6ll4I,17041
|
83
83
|
letta/llm_api/llm_api_tools.py,sha256=gMYoEvs5vSyvjos2eYJN6_BpQ2aNpt3zvyF7D2phbqY,30044
|
84
84
|
letta/llm_api/llm_client.py,sha256=sO9MwiSOJ_ycOFnYrQP0_g6cFkMSnrZqFDz1sUeBHD8,2098
|
@@ -130,7 +130,7 @@ letta/openai_backcompat/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG
|
|
130
130
|
letta/openai_backcompat/openai_object.py,sha256=GSzeCTwLpLD2fH4X8wVqzwdmoTjKK2I4PnriBY453lc,13505
|
131
131
|
letta/orm/__all__.py,sha256=2gh2MZTkA3Hw67VWVKK3JIStJOqTeLdpCvYSVYNeEDA,692
|
132
132
|
letta/orm/__init__.py,sha256=ajknaBBEy2z7eCXT53p34Symp0ece7CwnMn-sBlZKC8,1327
|
133
|
-
letta/orm/agent.py,sha256=
|
133
|
+
letta/orm/agent.py,sha256=yRMKhBzPSL5QgvWNEfYLgZkrK5PCxtgW-DFjIH3Dyq4,13551
|
134
134
|
letta/orm/agents_tags.py,sha256=IM9UxHtcispiieh0EnOIGTk--nGK9XaS6v3jl_cjcWo,1011
|
135
135
|
letta/orm/base.py,sha256=PNAsqGngx8X4pcH8xndD6GFx9pyFwwaywjRCQXd12EI,3090
|
136
136
|
letta/orm/block.py,sha256=ZLVw_vFoTt1bckWmJnSycrd9CXYrzuAQOZWzX0LP33Y,5741
|
@@ -159,7 +159,7 @@ letta/orm/provider_trace.py,sha256=CJMGz-rLqagJ-yXh9SJRbiGr5nAYdxY524hmiTgDFx4,1
|
|
159
159
|
letta/orm/sandbox_config.py,sha256=DyOy_1_zCMlp13elCqPcuuA6OwUove6mrjhcpROTg50,4150
|
160
160
|
letta/orm/source.py,sha256=rtehzez80rRrJigXeRBgTlfTZEUy6cVqDizWEN2tvuY,2224
|
161
161
|
letta/orm/sources_agents.py,sha256=Ik_PokCBrXRd9wXWomeNeb8EtLUwjb9VMZ8LWXqpK5A,473
|
162
|
-
letta/orm/sqlalchemy_base.py,sha256=
|
162
|
+
letta/orm/sqlalchemy_base.py,sha256=86V3SNQTs-DOfJwGs5uDNLGIk2larkpwk3zWLMe8ITM,40396
|
163
163
|
letta/orm/sqlite_functions.py,sha256=JCScKiRlYCKxy9hChQ8wsk4GMKknZE24MunnG3fM1Gw,4255
|
164
164
|
letta/orm/step.py,sha256=ZIMxDba_5Ca6aUH0GFr35qcVA86PMCzCIfCwd-HD3Do,3354
|
165
165
|
letta/orm/tool.py,sha256=ft3BDA7Pt-zsXLyPvS_Z_Ibis6H6vY20F7Li7p6nPu8,2652
|
@@ -306,7 +306,7 @@ letta/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
306
306
|
letta/services/agent_manager.py,sha256=N2Wsi0zrwuhRjQyofSvC1aOPwiP3MUSamYSdJFyaslc,122236
|
307
307
|
letta/services/block_manager.py,sha256=e4_VAHA5XzOLOdIE3uLqtnxykjEvfTgSJSRqNKDUsWM,21716
|
308
308
|
letta/services/group_manager.py,sha256=zzxrPlk3FTUfiOMPwdjuVr9loxInjtXlJsO_TKReJqk,17267
|
309
|
-
letta/services/helpers/agent_manager_helper.py,sha256=
|
309
|
+
letta/services/helpers/agent_manager_helper.py,sha256=Fnjkn72-2PwlMJFXS0teZNWT8l_2Uj7L2gPf-EoZtnU,21092
|
310
310
|
letta/services/helpers/noop_helper.py,sha256=OZ6wZLsdNEAg9Q2t5oFTOMK6jp-YUMBPdoyiR8M3T1c,272
|
311
311
|
letta/services/helpers/tool_execution_helper.py,sha256=JdH6VTWFrXfwPWsWNSZFKuRFhhXp8qiDYWjbPc8PLLI,7649
|
312
312
|
letta/services/identity_manager.py,sha256=WZl5wTz_572FelNjnwyDX9QEDguZOsQvc9QfQTasGNI,10331
|
@@ -346,8 +346,8 @@ letta/system.py,sha256=mKxmvvekuP8mdgsebRINGBoFbUdJhxLJ260crPBNVyk,8386
|
|
346
346
|
letta/tracing.py,sha256=YMb9KgoBVz7nwCPwnErk2EJEKMiQ_ohctW1nOwhHd1Y,8458
|
347
347
|
letta/types/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
348
348
|
letta/utils.py,sha256=W8J1FfhRADFqoyx3J8-Z1_aWyG433PBoEh_b5wdOZIg,32262
|
349
|
-
letta_nightly-0.7.
|
350
|
-
letta_nightly-0.7.
|
351
|
-
letta_nightly-0.7.
|
352
|
-
letta_nightly-0.7.
|
353
|
-
letta_nightly-0.7.
|
349
|
+
letta_nightly-0.7.28.dev20250528220726.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
|
350
|
+
letta_nightly-0.7.28.dev20250528220726.dist-info/METADATA,sha256=DbhmJlZQbgjEOIQilcmRdMenIfFJEkfDPaxhheLDb64,22374
|
351
|
+
letta_nightly-0.7.28.dev20250528220726.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
352
|
+
letta_nightly-0.7.28.dev20250528220726.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
|
353
|
+
letta_nightly-0.7.28.dev20250528220726.dist-info/RECORD,,
|
File without changes
|
File without changes
|