letta-nightly 0.7.0.dev20250421104249__py3-none-any.whl → 0.7.0.dev20250423003112__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.
@@ -2,7 +2,7 @@ import uuid
2
2
  from typing import List, Optional
3
3
 
4
4
  from google import genai
5
- from google.genai.types import FunctionCallingConfig, FunctionCallingConfigMode, GenerateContentResponse, ToolConfig
5
+ from google.genai.types import FunctionCallingConfig, FunctionCallingConfigMode, GenerateContentResponse, ThinkingConfig, ToolConfig
6
6
 
7
7
  from letta.helpers.datetime_helpers import get_utc_time
8
8
  from letta.helpers.json_helpers import json_dumps
@@ -60,6 +60,15 @@ class GoogleVertexClient(GoogleAIClient):
60
60
  )
61
61
  request_data["config"]["tool_config"] = tool_config.model_dump()
62
62
 
63
+ # Add thinking_config
64
+ # If enable_reasoner is False, set thinking_budget to 0
65
+ # Otherwise, use the value from max_reasoning_tokens
66
+ thinking_budget = 0 if not self.llm_config.enable_reasoner else self.llm_config.max_reasoning_tokens
67
+ thinking_config = ThinkingConfig(
68
+ thinking_budget=thinking_budget,
69
+ )
70
+ request_data["config"]["thinking_config"] = thinking_config.model_dump()
71
+
63
72
  return request_data
64
73
 
65
74
  def convert_response_to_chat_completion(
@@ -72,7 +72,7 @@ class LLMConfig(BaseModel):
72
72
  description="The reasoning effort to use when generating text reasoning models",
73
73
  )
74
74
  max_reasoning_tokens: int = Field(
75
- 0, description="Configurable thinking budget for extended thinking, only used if enable_reasoner is True. Minimum value is 1024."
75
+ 0, description="Configurable thinking budget for extended thinking. Used for enable_reasoner and also for Google Vertex models like Gemini 2.5 Flash. Minimum value is 1024 when used with enable_reasoner."
76
76
  )
77
77
 
78
78
  # FIXME hack to silence pydantic protected namespace warning
@@ -303,17 +303,24 @@ class MessageManager:
303
303
  if group_id:
304
304
  query = query.filter(MessageModel.group_id == group_id)
305
305
 
306
- # If query_text is provided, filter messages using subquery + json_array_elements.
306
+ # If query_text is provided, filter messages by matching any "text" type content block
307
+ # whose text includes the query string (case-insensitive).
307
308
  if query_text:
308
- content_element = func.json_array_elements(MessageModel.content).alias("content_element")
309
- query = query.filter(
310
- exists(
311
- select(1)
312
- .select_from(content_element)
313
- .where(text("content_element->>'type' = 'text' AND content_element->>'text' ILIKE :query_text"))
314
- .params(query_text=f"%{query_text}%")
309
+ dialect_name = session.bind.dialect.name
310
+
311
+ if dialect_name == "postgresql": # using subquery + json_array_elements.
312
+ content_element = func.json_array_elements(MessageModel.content).alias("content_element")
313
+ subquery_sql = text("content_element->>'type' = 'text' AND content_element->>'text' ILIKE :query_text")
314
+ subquery = select(1).select_from(content_element).where(subquery_sql)
315
+
316
+ elif dialect_name == "sqlite": # using `json_each` and JSON path expressions
317
+ json_item = func.json_each(MessageModel.content).alias("json_item")
318
+ subquery_sql = text(
319
+ "json_extract(value, '$.type') = 'text' AND lower(json_extract(value, '$.text')) LIKE lower(:query_text)"
315
320
  )
316
- )
321
+ subquery = select(1).select_from(json_item).where(subquery_sql)
322
+
323
+ query = query.filter(exists(subquery.params(query_text=f"%{query_text}%")))
317
324
 
318
325
  # If role(s) are provided, filter messages by those roles.
319
326
  if roles:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: letta-nightly
3
- Version: 0.7.0.dev20250421104249
3
+ Version: 0.7.0.dev20250423003112
4
4
  Summary: Create LLM agents with long-term memory and custom tools
5
5
  License: Apache License
6
6
  Author: Letta Team
@@ -75,7 +75,7 @@ letta/llm_api/cohere.py,sha256=7Be_t5jt5EtWX8UUScJkX-IF9SpiZw9cDEcRC6PaxUM,14841
75
75
  letta/llm_api/deepseek.py,sha256=b1mSW8gnBrpAI8d2GcBpDyLYDnuC-P1UP6xJPalfQS4,12456
76
76
  letta/llm_api/google_ai_client.py,sha256=_uXwB5GcDO4kBTs2qtwy3Yz82rkgn8j4ytqYJDmhSW8,22686
77
77
  letta/llm_api/google_constants.py,sha256=1dqwt-YwdYGnAHV5rIPfGHfE3ybPzSn_48vlNYfd-bk,588
78
- letta/llm_api/google_vertex_client.py,sha256=hDj0pthZrht-dsdzyE6vZYBuSzyiLazSdcgpI76lEqg,11144
78
+ letta/llm_api/google_vertex_client.py,sha256=RRYgZ1O9dLwARIPjhpH4QLCSfq7bLJl_IWjhh77_R5E,11603
79
79
  letta/llm_api/helpers.py,sha256=sLYv30UnKBRVPuhU_KDXfKFdbkUONiDAyVEwGr86l3A,16780
80
80
  letta/llm_api/llm_api_tools.py,sha256=s1n3YDGp-ShHOzxeuQ1BOje0oh7H_yGefRVwFXsc_A8,27547
81
81
  letta/llm_api/llm_client.py,sha256=PWnzdwD_7TMmbBuZnCWt10pJL4WXLCsQ3yS9-Y3Nh-c,2112
@@ -210,7 +210,7 @@ letta/schemas/letta_message_content.py,sha256=CeIgyOy8HYMh_oGoPYlATp6d3Hp5v7SU3S
210
210
  letta/schemas/letta_request.py,sha256=TH00tm81Pe8D6r7IrxjKW0Hc8QE_Z4jclbc6VX0_Ybw,1542
211
211
  letta/schemas/letta_response.py,sha256=K11qneqSSE3R2twr65ZYnDzl0oBMf1N1nUnJpI4oiUs,7846
212
212
  letta/schemas/llm_batch_job.py,sha256=n9ZbWINBECRrZW6vslm-f2pk_rI_gpuxcZsqAphl9bE,2879
213
- letta/schemas/llm_config.py,sha256=UA3_a4qv5Kb_jMQSCEZLZ0PLwVyOC332SxIcvZBM5bA,7240
213
+ letta/schemas/llm_config.py,sha256=onXix2S_cgWwUgOflMED7INPn8wg01mGy6w3Cq1dn5U,7315
214
214
  letta/schemas/llm_config_overrides.py,sha256=-oRglCTcajF6UAK3RAa0FLWVuKODPI1v403fDIWMAtA,1815
215
215
  letta/schemas/memory.py,sha256=GOYDfPKzbWftUWO9Hv4KW7xAi1EIQmC8zpP7qvEkVHw,10245
216
216
  letta/schemas/message.py,sha256=cXcQjwzNE7tbwZGuFu-x8T_yUb3EyVrbHYZKSJ4GpbA,48520
@@ -298,7 +298,7 @@ letta/services/helpers/tool_execution_helper.py,sha256=lLoebs1kZKjw62y1PxHbIDkHq
298
298
  letta/services/identity_manager.py,sha256=PqnUnM3OGCRnd5NPjGonwYBnYAQK8rpiissdNYUouGU,9389
299
299
  letta/services/job_manager.py,sha256=Z9cSD-IqpiOIWE_UOTBUEIxGITrJ10JT1G3ske-0yIY,17166
300
300
  letta/services/llm_batch_manager.py,sha256=r224Yfi5sy5Xk9ncR5VxFyNWUmeQwT4zyxV-qUdvHMU,16040
301
- letta/services/message_manager.py,sha256=_n7mij6bXyHqn4lppszjiXVQ7gHaiyPKEM_t6k8XP-U,17329
301
+ letta/services/message_manager.py,sha256=iRFFu7WP9GBtGKrQp5Igiqp_wonSfRKZ_Ran5X6SZZA,17946
302
302
  letta/services/organization_manager.py,sha256=Ax0KmPSc_YYsYaxeld9gc7ST-J6DemHQ542DD7l7AWA,3989
303
303
  letta/services/passage_manager.py,sha256=KY18gHTbx8ROBsOeR7ZAefTMGZwzbxYqOjbadqVFiyQ,9121
304
304
  letta/services/per_agent_lock_manager.py,sha256=porM0cKKANQ1FvcGXOO_qM7ARk5Fgi1HVEAhXsAg9-4,546
@@ -325,8 +325,8 @@ letta/streaming_utils.py,sha256=jLqFTVhUL76FeOuYk8TaRQHmPTf3HSRc2EoJwxJNK6U,1194
325
325
  letta/system.py,sha256=dnOrS2FlRMwijQnOvfrky0Lg8wEw-FUq2zzfAJOUSKA,8477
326
326
  letta/tracing.py,sha256=RstWXpfWVF77nmb_ISORVWd9IQw2Ky3de40k_S70yKI,8258
327
327
  letta/utils.py,sha256=IZFvtj9WYcrxUbkoUUYGDxMYQYdn5SgfqsvnARGsAzc,32245
328
- letta_nightly-0.7.0.dev20250421104249.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
329
- letta_nightly-0.7.0.dev20250421104249.dist-info/METADATA,sha256=QWbK2qhFH3whOhriePYciTizbTeu3j8mL8l7xDolra8,22282
330
- letta_nightly-0.7.0.dev20250421104249.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
331
- letta_nightly-0.7.0.dev20250421104249.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
332
- letta_nightly-0.7.0.dev20250421104249.dist-info/RECORD,,
328
+ letta_nightly-0.7.0.dev20250423003112.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
329
+ letta_nightly-0.7.0.dev20250423003112.dist-info/METADATA,sha256=XAJS8BiUKJ3ZfolS3ZsHNYwl-cRA2m-o6bH_rsY3FH4,22282
330
+ letta_nightly-0.7.0.dev20250423003112.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
331
+ letta_nightly-0.7.0.dev20250423003112.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
332
+ letta_nightly-0.7.0.dev20250423003112.dist-info/RECORD,,