feat: remove un-paginated message list on usage stats [LET-5747] (#5599)
feat: remove un-paginated message list on usage stats
This commit is contained in:
@@ -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": [
|
||||
{
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -2363,7 +2363,6 @@ def test_create_agent(client: LettaSDKClient) -> None:
|
||||
"prompt_tokens",
|
||||
"total_tokens",
|
||||
"step_count",
|
||||
"steps_messages",
|
||||
"run_ids",
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user