Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
feat: remove un-paginated message list on usage stats [LET-5747] (#5599)
cthomas7b2e7e2f4cd8
diff --git a/fern/openapi.json b/fern/openapi.jsonindex 2b5a7a75f..cde9fa4d8 100644--- a/fern/openapi.json+++ b/fern/openapi.json@@ -31250,24 +31250,6 @@"description": "The number of steps taken by the agent.","default": 0},- "steps_messages": {- "anyOf": [- {- "items": {- "items": {- "$ref": "#/components/schemas/Message"- },- "type": "array"- },- "type": "array"- },- {- "type": "null"- }- ],- "title": "Steps Messages",- "description": "The messages generated per step"- },"run_ids": {"anyOf": [{diff --git a/letta/schemas/usage.py b/letta/schemas/usage.pyindex d2f2c6886..547c61da4 100644--- a/letta/schemas/usage.py+++ b/letta/schemas/usage.py@@ -22,5 +22,4 @@ class LettaUsageStatistics(BaseModel):total_tokens: int = Field(0, description="The total number of tokens processed by the agent.")step_count: int = Field(0, description="The number of steps taken by the agent.")# TODO: Optional for now. This field makes everyone's lives easier- steps_messages: Optional[List[List[Message]]] = Field(None, description="The messages generated per step")run_ids: Optional[List[str]] = Field(None, description="The background task run IDs associated with the agent interaction")diff --git a/letta/server/rest_api/utils.py b/letta/server/rest_api/utils.pyindex 048dd3ae7..972dd13cb 100644--- a/letta/server/rest_api/utils.py+++ b/letta/server/rest_api/utils.py@@ -121,7 +121,7 @@ async def sse_async_generator(err_msg = f"Expected LettaUsageStatistics, got {type(usage)}"logger.error(err_msg)raise ValueError(err_msg)- yield sse_formatter(usage.model_dump(exclude={"steps_messages"}))+ yield sse_formatter(usage.model_dump())except ContextWindowExceededError as e:capture_sentry_exception(e)diff --git a/tests/test_sdk_client.py b/tests/test_sdk_client.pyindex 396e88ca6..a7196c7c2 100644--- a/tests/test_sdk_client.py+++ b/tests/test_sdk_client.py@@ -2363,7 +2363,6 @@ def test_create_agent(client: LettaSDKClient) -> None:"prompt_tokens","total_tokens","step_count",- "steps_messages","run_ids",},)