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: fix letta-free (#2431)

Sarah Wooders99acb95043d3
diff --git a/letta/server/rest_api/routers/v1/agents.py b/letta/server/rest_api/routers/v1/agents.py
index 63c51a10b..6cc759630 100644
--- a/letta/server/rest_api/routers/v1/agents.py
+++ b/letta/server/rest_api/routers/v1/agents.py
@@ -720,6 +720,7 @@ async def send_message_streaming(
feature_enabled = settings.use_experimental or experimental_header.lower() == "true"
model_compatible = agent.llm_config.model_endpoint_type in ["anthropic", "openai", "together", "google_ai", "google_vertex"]
model_compatible_token_streaming = agent.llm_config.model_endpoint_type in ["anthropic", "openai"]
+ not_letta_endpoint = not ("inference.letta.com" in agent.llm_config.model_endpoint)
if user_eligible and agent_eligible and feature_enabled and model_compatible:
if agent.enable_sleeptime:
@@ -749,7 +750,7 @@ async def send_message_streaming(
)
from letta.server.rest_api.streaming_response import StreamingResponseWithStatusCode
- if request.stream_tokens and model_compatible_token_streaming:
+ if request.stream_tokens and model_compatible_token_streaming and not_letta_endpoint:
result = StreamingResponseWithStatusCode(
experimental_agent.step_stream(
input_messages=request.messages,