Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

fix: temp disable stream tokens (#2189)

Charles Packeref1635c0d6fc
diff --git a/.persist/.gitkeep b/.persist/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
diff --git a/letta/server/rest_api/routers/v1/agents.py b/letta/server/rest_api/routers/v1/agents.py
index 20661ef9b..ebf10b7cd 100644
--- a/letta/server/rest_api/routers/v1/agents.py
+++ b/letta/server/rest_api/routers/v1/agents.py
@@ -486,6 +486,8 @@ async def send_message_streaming(
This endpoint accepts a message from a user and processes it through the agent.
It will stream the steps of the response always, and stream the tokens if 'stream_tokens' is set to True.
"""
+ request.stream_tokens = False
+
actor = server.get_user_or_default(user_id=user_id)
result = await send_message_to_agent(
server=server,
diff --git a/letta/server/rest_api/utils.py b/letta/server/rest_api/utils.py
index 4fd92b5aa..a87400dc2 100644
--- a/letta/server/rest_api/utils.py
+++ b/letta/server/rest_api/utils.py
@@ -1,6 +1,5 @@
import asyncio
import json
-import traceback
import warnings
from enum import Enum
from typing import AsyncGenerator, Optional, Union
@@ -62,6 +61,9 @@ async def sse_async_generator(
raise ValueError(f"Expected LettaUsageStatistics, got {type(usage)}")
yield sse_formatter({"usage": usage.model_dump()})
except Exception as e:
+ import traceback
+
+ traceback.print_exc()
warnings.warn(f"Error getting usage data: {e}")
yield sse_formatter({"error": "Failed to get usage data"})
diff --git a/letta/services/sandbox_config_manager.py b/letta/services/sandbox_config_manager.py
index 05b669d82..c91e6669f 100644
--- a/letta/services/sandbox_config_manager.py
+++ b/letta/services/sandbox_config_manager.py
@@ -33,7 +33,7 @@ class SandboxConfigManager:
def get_or_create_default_sandbox_config(self, sandbox_type: SandboxType, actor: PydanticUser) -> PydanticSandboxConfig:
sandbox_config = self.get_sandbox_config_by_type(sandbox_type, actor=actor)
if not sandbox_config:
- logger.info(f"Creating new sandbox config of type {sandbox_type}, none found for organization {actor.organization_id}.")
+ logger.debug(f"Creating new sandbox config of type {sandbox_type}, none found for organization {actor.organization_id}.")
# TODO: Add more sandbox types later
if sandbox_type == SandboxType.E2B: