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: remove duplicate provider trace logging and dead code (#9278)

Kian Jones203b6ead7cb2
diff --git a/letta/agents/letta_agent.py b/letta/agents/letta_agent.py
index e60fda2d3..8460a46a1 100644
--- a/letta/agents/letta_agent.py
+++ b/letta/agents/letta_agent.py
@@ -1490,7 +1490,7 @@ class LettaAgent(BaseAgent):
# Attempt LLM request with telemetry wrapper
return (
request_data,
- await llm_client.stream_async_with_telemetry(request_data, agent_state.llm_config),
+ await llm_client.stream_async(request_data, agent_state.llm_config),
current_in_context_messages,
new_in_context_messages,
valid_tool_names,
diff --git a/letta/llm_api/llm_client_base.py b/letta/llm_api/llm_client_base.py
index c8bfbc7de..be54b6b92 100644
--- a/letta/llm_api/llm_client_base.py
+++ b/letta/llm_api/llm_client_base.py
@@ -127,14 +127,6 @@ class LLMClientBase:
except Exception as e:
logger.warning(f"Failed to log telemetry: {e}")
- async def stream_async_with_telemetry(self, request_data: dict, llm_config: LLMConfig):
- """Returns raw stream. Caller should log telemetry after processing via log_provider_trace_async().
-
- Call set_telemetry_context() first to set agent_id, run_id, etc.
- After consuming the stream, call log_provider_trace_async() with the response data.
- """
- return await self.stream_async(request_data, llm_config)
-
async def log_provider_trace_async(
self,
request_data: dict,
diff --git a/letta/services/summarizer/summarizer.py b/letta/services/summarizer/summarizer.py
index dc9680c47..a3247497d 100644
--- a/letta/services/summarizer/summarizer.py
+++ b/letta/services/summarizer/summarizer.py
@@ -542,7 +542,7 @@ async def simple_summary(
)
# AnthropicClient.stream_async sets request_data["stream"] = True internally.
- stream = await llm_client.stream_async_with_telemetry(req_data, summarizer_llm_config)
+ stream = await llm_client.stream_async(req_data, summarizer_llm_config)
async for _chunk in interface.process(stream):
# We don't emit anything; we just want the fully-accumulated content.
pass