letta-nightly 0.7.26.dev20250523225257__py3-none-any.whl → 0.7.27.dev20250525041502__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/interfaces/openai_streaming_interface.py +2 -1
- letta/llm_api/anthropic.py +12 -0
- letta/llm_api/openai.py +1 -0
- letta/llm_api/openai_client.py +3 -2
- letta/schemas/providers.py +1 -1
- letta/server/db.py +11 -8
- letta/server/rest_api/routers/v1/agents.py +2 -1
- {letta_nightly-0.7.26.dev20250523225257.dist-info → letta_nightly-0.7.27.dev20250525041502.dist-info}/METADATA +3 -2
- {letta_nightly-0.7.26.dev20250523225257.dist-info → letta_nightly-0.7.27.dev20250525041502.dist-info}/RECORD +13 -13
- {letta_nightly-0.7.26.dev20250523225257.dist-info → letta_nightly-0.7.27.dev20250525041502.dist-info}/LICENSE +0 -0
- {letta_nightly-0.7.26.dev20250523225257.dist-info → letta_nightly-0.7.27.dev20250525041502.dist-info}/WHEEL +0 -0
- {letta_nightly-0.7.26.dev20250523225257.dist-info → letta_nightly-0.7.27.dev20250525041502.dist-info}/entry_points.txt +0 -0
letta/__init__.py
CHANGED
@@ -58,9 +58,10 @@ class OpenAIStreamingInterface:
|
|
58
58
|
|
59
59
|
def get_tool_call_object(self) -> ToolCall:
|
60
60
|
"""Useful for agent loop"""
|
61
|
+
function_name = self.last_flushed_function_name if self.last_flushed_function_name else self.function_name_buffer
|
61
62
|
return ToolCall(
|
62
63
|
id=self.letta_tool_message_id,
|
63
|
-
function=FunctionCall(arguments=self.current_function_arguments, name=
|
64
|
+
function=FunctionCall(arguments=self.current_function_arguments, name=function_name),
|
64
65
|
)
|
65
66
|
|
66
67
|
async def process(self, stream: AsyncStream[ChatCompletionChunk]) -> AsyncGenerator[LettaMessage, None]:
|
letta/llm_api/anthropic.py
CHANGED
@@ -55,6 +55,18 @@ BASE_URL = "https://api.anthropic.com/v1"
|
|
55
55
|
# https://docs.anthropic.com/claude/docs/models-overview
|
56
56
|
# Sadly hardcoded
|
57
57
|
MODEL_LIST = [
|
58
|
+
{
|
59
|
+
"name": "claude-opus-4-20250514",
|
60
|
+
"context_window": 200000,
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"name": "claude-sonnet-4-20250514",
|
64
|
+
"context_window": 200000,
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"name": "claude-3-5-haiku-20241022",
|
68
|
+
"context_window": 200000,
|
69
|
+
},
|
58
70
|
## Opus
|
59
71
|
{
|
60
72
|
"name": "claude-3-opus-20240229",
|
letta/llm_api/openai.py
CHANGED
@@ -56,6 +56,7 @@ def openai_check_valid_api_key(base_url: str, api_key: Union[str, None]) -> None
|
|
56
56
|
else:
|
57
57
|
raise ValueError("No API key provided")
|
58
58
|
|
59
|
+
|
59
60
|
def openai_get_model_list(url: str, api_key: Optional[str] = None, fix_url: bool = False, extra_params: Optional[dict] = None) -> dict:
|
60
61
|
"""https://platform.openai.com/docs/api-reference/models/list"""
|
61
62
|
from letta.utils import printd
|
letta/llm_api/openai_client.py
CHANGED
@@ -41,7 +41,7 @@ def is_openai_reasoning_model(model: str) -> bool:
|
|
41
41
|
"""Utility function to check if the model is a 'reasoner'"""
|
42
42
|
|
43
43
|
# NOTE: needs to be updated with new model releases
|
44
|
-
is_reasoning = model.startswith("o1") or model.startswith("o3")
|
44
|
+
is_reasoning = model.startswith("o1") or model.startswith("o3") or model.startswith("o4")
|
45
45
|
return is_reasoning
|
46
46
|
|
47
47
|
|
@@ -187,7 +187,8 @@ class OpenAIClient(LLMClientBase):
|
|
187
187
|
tool_choice=tool_choice,
|
188
188
|
user=str(),
|
189
189
|
max_completion_tokens=llm_config.max_tokens,
|
190
|
-
temperature
|
190
|
+
# NOTE: the reasoners that don't support temperature require 1.0, not None
|
191
|
+
temperature=llm_config.temperature if supports_temperature_param(model) else 1.0,
|
191
192
|
)
|
192
193
|
|
193
194
|
# always set user id for openai requests
|
letta/schemas/providers.py
CHANGED
@@ -289,7 +289,7 @@ class OpenAIProvider(Provider):
|
|
289
289
|
|
290
290
|
# for openai, filter models
|
291
291
|
if self.base_url == "https://api.openai.com/v1":
|
292
|
-
allowed_types = ["gpt-4", "o1", "o3"]
|
292
|
+
allowed_types = ["gpt-4", "o1", "o3", "o4"]
|
293
293
|
# NOTE: o1-mini and o1-preview do not support tool calling
|
294
294
|
# NOTE: o1-pro is only available in Responses API
|
295
295
|
disallowed_types = ["transcribe", "search", "realtime", "tts", "audio", "computer", "o1-mini", "o1-preview", "o1-pro"]
|
letta/server/db.py
CHANGED
@@ -120,18 +120,21 @@ class DatabaseRegistry:
|
|
120
120
|
async_pg_uri = async_pg_uri.replace("sslmode=", "ssl=")
|
121
121
|
|
122
122
|
async_engine = create_async_engine(async_pg_uri, **self._build_sqlalchemy_engine_args(is_async=True))
|
123
|
-
|
124
|
-
self._async_engines["default"] = async_engine
|
125
|
-
|
126
|
-
# Create async session factory
|
127
|
-
self._async_session_factories["default"] = async_sessionmaker(
|
128
|
-
autocommit=False, autoflush=False, bind=self._async_engines["default"], class_=AsyncSession
|
129
|
-
)
|
130
123
|
self._initialized["async"] = True
|
131
124
|
else:
|
132
125
|
self.logger.warning("Async SQLite is currently not supported. Please use PostgreSQL for async database operations.")
|
133
126
|
# TODO (cliandy): unclear around async sqlite support in sqlalchemy, we will not currently support this
|
134
|
-
self._initialized["async"] =
|
127
|
+
self._initialized["async"] = True
|
128
|
+
engine_path = "sqlite+aiosqlite:///" + os.path.join(self.config.recall_storage_path, "sqlite.db")
|
129
|
+
self.logger.info("Creating sqlite engine " + engine_path)
|
130
|
+
async_engine = create_async_engine(engine_path, **self._build_sqlalchemy_engine_args(is_async=True))
|
131
|
+
|
132
|
+
# Create async session factory
|
133
|
+
self._async_engines["default"] = async_engine
|
134
|
+
self._async_session_factories["default"] = async_sessionmaker(
|
135
|
+
autocommit=False, autoflush=False, bind=self._async_engines["default"], class_=AsyncSession
|
136
|
+
)
|
137
|
+
self._initialized["async"] = True
|
135
138
|
|
136
139
|
def _build_sqlalchemy_engine_args(self, *, is_async: bool) -> dict:
|
137
140
|
"""Prepare keyword arguments for create_engine / create_async_engine."""
|
@@ -716,6 +716,7 @@ async def send_message_streaming(
|
|
716
716
|
feature_enabled = settings.use_experimental or experimental_header.lower() == "true"
|
717
717
|
model_compatible = agent.llm_config.model_endpoint_type in ["anthropic", "openai", "together", "google_ai", "google_vertex"]
|
718
718
|
model_compatible_token_streaming = agent.llm_config.model_endpoint_type in ["anthropic", "openai"]
|
719
|
+
not_letta_endpoint = not ("letta" in agent.llm_config.model_endpoint)
|
719
720
|
|
720
721
|
if agent_eligible and feature_enabled and model_compatible:
|
721
722
|
if agent.enable_sleeptime:
|
@@ -745,7 +746,7 @@ async def send_message_streaming(
|
|
745
746
|
)
|
746
747
|
from letta.server.rest_api.streaming_response import StreamingResponseWithStatusCode
|
747
748
|
|
748
|
-
if request.stream_tokens and model_compatible_token_streaming:
|
749
|
+
if request.stream_tokens and model_compatible_token_streaming and not_letta_endpoint:
|
749
750
|
result = StreamingResponseWithStatusCode(
|
750
751
|
experimental_agent.step_stream(
|
751
752
|
input_messages=request.messages,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: letta-nightly
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.27.dev20250525041502
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
5
5
|
License: Apache License
|
6
6
|
Author: Letta Team
|
@@ -23,6 +23,7 @@ Provides-Extra: qdrant
|
|
23
23
|
Provides-Extra: server
|
24
24
|
Provides-Extra: tests
|
25
25
|
Requires-Dist: aiomultiprocess (>=0.9.1,<0.10.0)
|
26
|
+
Requires-Dist: aiosqlite (>=0.21.0,<0.22.0)
|
26
27
|
Requires-Dist: alembic (>=1.13.3,<2.0.0)
|
27
28
|
Requires-Dist: anthropic (>=0.49.0,<0.50.0)
|
28
29
|
Requires-Dist: apscheduler (>=3.11.0,<4.0.0)
|
@@ -88,9 +89,9 @@ Requires-Dist: questionary (>=2.0.1,<3.0.0)
|
|
88
89
|
Requires-Dist: rich (>=13.9.4,<14.0.0)
|
89
90
|
Requires-Dist: sentry-sdk[fastapi] (==2.19.1)
|
90
91
|
Requires-Dist: setuptools (>=70,<71)
|
91
|
-
Requires-Dist: sqlalchemy (>=2.0.25,<3.0.0)
|
92
92
|
Requires-Dist: sqlalchemy-json (>=0.7.0,<0.8.0)
|
93
93
|
Requires-Dist: sqlalchemy-utils (>=0.41.2,<0.42.0)
|
94
|
+
Requires-Dist: sqlalchemy[asyncio] (>=2.0.41,<3.0.0)
|
94
95
|
Requires-Dist: sqlmodel (>=0.0.16,<0.0.17)
|
95
96
|
Requires-Dist: tavily-python (>=0.7.2,<0.8.0)
|
96
97
|
Requires-Dist: tqdm (>=4.66.1,<5.0.0)
|
@@ -1,4 +1,4 @@
|
|
1
|
-
letta/__init__.py,sha256=
|
1
|
+
letta/__init__.py,sha256=fPBVTKmk9XEoH8EsHzXoJKj1nYCE32EOHkcESZ6ghBs,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
|
@@ -61,7 +61,7 @@ letta/interface.py,sha256=6GKasvJMASu-kcZch6Hffz1vnHuPA_ryI6cLH2bMArc,13023
|
|
61
61
|
letta/interfaces/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
62
62
|
letta/interfaces/anthropic_streaming_interface.py,sha256=qjZaj6uY8NAr6HPhHkgk_6VBbpOu4OvUWT9V4R9Rg0E,21545
|
63
63
|
letta/interfaces/openai_chat_completions_streaming_interface.py,sha256=LANdVBA8UNWscBvsFbWTT8cxNg5fHA_woWU2jkTf6TQ,4911
|
64
|
-
letta/interfaces/openai_streaming_interface.py,sha256=
|
64
|
+
letta/interfaces/openai_streaming_interface.py,sha256=vdEaD_yOZ1UqPY75on_d1_nc45TAw3WQurOc2rSZ4nk,20281
|
65
65
|
letta/interfaces/utils.py,sha256=c6jvO0dBYHh8DQnlN-B0qeNC64d3CSunhfqlFA4pJTY,278
|
66
66
|
letta/jobs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
67
67
|
letta/jobs/helpers.py,sha256=kO4aj954xsQ1RAmkjY6LQQ7JEIGuhaxB1e9pzrYKHAY,914
|
@@ -69,7 +69,7 @@ letta/jobs/llm_batch_job_polling.py,sha256=Qv2zkV6ziu5t0Jd3WfGu092oG6CNRBnuX8CI0
|
|
69
69
|
letta/jobs/scheduler.py,sha256=yVlXWn98gidCuvBU0ikrHFWLXxdKdkL1Kw55GugVARk,10510
|
70
70
|
letta/jobs/types.py,sha256=K8GKEnqEgAT6Kq4F2hUrBC4ZAFM9OkfOjVMStzxKuXQ,742
|
71
71
|
letta/llm_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
72
|
-
letta/llm_api/anthropic.py,sha256=
|
72
|
+
letta/llm_api/anthropic.py,sha256=Lvk2_d3UD32Q-PjWpATOjMp2Qf1SUPmXJUCn28UgB-Y,47281
|
73
73
|
letta/llm_api/anthropic_client.py,sha256=SwKwhXL_lGAj9G2cAQnkeesFB0ipAiWQYSVBqqbGH_Y,25888
|
74
74
|
letta/llm_api/aws_bedrock.py,sha256=kAPpKPRe4ZUa6fkxFbo8xwQgq4fJf3QoZEAP1LOCfaw,4168
|
75
75
|
letta/llm_api/azure_openai.py,sha256=YAkXwKyfnJFNhB45pkJVFsoxUNB_M74rQYchtw_CN6I,5099
|
@@ -84,8 +84,8 @@ letta/llm_api/llm_api_tools.py,sha256=gMYoEvs5vSyvjos2eYJN6_BpQ2aNpt3zvyF7D2phbq
|
|
84
84
|
letta/llm_api/llm_client.py,sha256=sO9MwiSOJ_ycOFnYrQP0_g6cFkMSnrZqFDz1sUeBHD8,2098
|
85
85
|
letta/llm_api/llm_client_base.py,sha256=nbW70WZmk9bwLPzjgJ9ATeKjm3xzfZs7vk5lQE0QJ3U,6494
|
86
86
|
letta/llm_api/mistral.py,sha256=fHdfD9ug-rQIk2qn8tRKay1U6w9maF11ryhKi91FfXM,1593
|
87
|
-
letta/llm_api/openai.py,sha256=
|
88
|
-
letta/llm_api/openai_client.py,sha256=
|
87
|
+
letta/llm_api/openai.py,sha256=t_uJEceayjjDNQ06pA-PMDVlKnakVTEn54sub8QHJ8s,27354
|
88
|
+
letta/llm_api/openai_client.py,sha256=PF4wjQnMSJdvhD5akDzzdCLHJaldyKC78MYUZZLFVgw,15322
|
89
89
|
letta/local_llm/README.md,sha256=hFJyw5B0TU2jrh9nb0zGZMgdH-Ei1dSRfhvPQG_NSoU,168
|
90
90
|
letta/local_llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
91
91
|
letta/local_llm/chat_completion_proxy.py,sha256=gc5gaKoHP8QaWRulDeEYPk7Onl8KdCBmpF2l9znXKeQ,13853
|
@@ -229,7 +229,7 @@ letta/schemas/openai/openai.py,sha256=Hilo5BiLAGabzxCwnwfzK5QrWqwYD8epaEKFa4Pwnd
|
|
229
229
|
letta/schemas/organization.py,sha256=TXrHN4IBQnX-mWvRuCOH57XZSLYCVOY0wWm2_UzDQIA,1279
|
230
230
|
letta/schemas/passage.py,sha256=RG0vkaewEu4a_NAZM-FVyMammHjqpPP0RDYAdu27g6A,3723
|
231
231
|
letta/schemas/provider_trace.py,sha256=gsgo1CdfTUFSnm1ep1tSZ0fZfGSx45EdPaVyVJREt_U,1958
|
232
|
-
letta/schemas/providers.py,sha256=
|
232
|
+
letta/schemas/providers.py,sha256=2I5MtHHpBGZu0yv2qjrjMZMrn3kV8HRhFPizMOOdrFc,63069
|
233
233
|
letta/schemas/response_format.py,sha256=pXNsjbtpA3Tf8HsDyIa40CSmoUbVR_7n2WOfQaX4aFs,2204
|
234
234
|
letta/schemas/run.py,sha256=SRqPRziINIiPunjOhE_NlbnQYgxTvqmbauni_yfBQRA,2085
|
235
235
|
letta/schemas/sandbox_config.py,sha256=Qfkzw422HCQUsE3GKry94oecQGziAzGXIyd6ke8W06M,5985
|
@@ -252,7 +252,7 @@ letta/serialize_schemas/marshmallow_tool.py,sha256=jwU69BDCakPlYPSk-ta21kuvsURKO
|
|
252
252
|
letta/serialize_schemas/pydantic_agent_schema.py,sha256=NKq70niUVMI3_lxMKc3u3rOBUhm77bIFaPRj9aidMUQ,3006
|
253
253
|
letta/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
254
254
|
letta/server/constants.py,sha256=yAdGbLkzlOU_dLTx0lKDmAnj0ZgRXCEaIcPJWO69eaE,92
|
255
|
-
letta/server/db.py,sha256=
|
255
|
+
letta/server/db.py,sha256=EmYbho-yIT1JfBvDBjfzWIRzjk65ZRNNdz4vqgGWwXg,10302
|
256
256
|
letta/server/generate_openapi_schema.sh,sha256=0OtBhkC1g6CobVmNEd_m2B6sTdppjbJLXaM95icejvE,371
|
257
257
|
letta/server/rest_api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
258
258
|
letta/server/rest_api/app.py,sha256=8Y5R_t_s4IAG7wRfdbmCeF5YT9pfGG4h6_kpUAaUwoQ,14771
|
@@ -266,7 +266,7 @@ letta/server/rest_api/routers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
266
266
|
letta/server/rest_api/routers/openai/chat_completions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
267
267
|
letta/server/rest_api/routers/openai/chat_completions/chat_completions.py,sha256=QBWab1fn2LXVDMtc6li3gOzmrNzDiUw5WUJsMeeMZII,5076
|
268
268
|
letta/server/rest_api/routers/v1/__init__.py,sha256=JfSSttkEWu0W18NVVDxl8AGnd8Qhj0BXJNxntOB7070,1768
|
269
|
-
letta/server/rest_api/routers/v1/agents.py,sha256=
|
269
|
+
letta/server/rest_api/routers/v1/agents.py,sha256=QhOs53_DMciQ9k3dgdBtsU_ntpyM61fynSi5hLQgYZA,38728
|
270
270
|
letta/server/rest_api/routers/v1/blocks.py,sha256=2uCUK91hFFmiAJt0Mrj0wn0Q6UC6J7xcV1dbDLU44r0,4767
|
271
271
|
letta/server/rest_api/routers/v1/embeddings.py,sha256=P-Dvt_HNKoTyjRwkScAMg1hlB3cNxMeAQwV7bSatsKI,957
|
272
272
|
letta/server/rest_api/routers/v1/groups.py,sha256=DT2tc4wwiq_gzmxefltEIrFSoqOntzhvmgqQy23varA,10738
|
@@ -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.27.dev20250525041502.dist-info/LICENSE,sha256=mExtuZ_GYJgDEI38GWdiEYZizZS4KkVt2SF1g_GPNhI,10759
|
350
|
+
letta_nightly-0.7.27.dev20250525041502.dist-info/METADATA,sha256=c4-TYI62CcqQ91lIMjvSxhrEdg_MYC_hgG3wTYNLcH4,22374
|
351
|
+
letta_nightly-0.7.27.dev20250525041502.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
352
|
+
letta_nightly-0.7.27.dev20250525041502.dist-info/entry_points.txt,sha256=2zdiyGNEZGV5oYBuS-y2nAAgjDgcC9yM_mHJBFSRt5U,40
|
353
|
+
letta_nightly-0.7.27.dev20250525041502.dist-info/RECORD,,
|
File without changes
|
File without changes
|