feat: add trace_id filter for listing steps (#2560)
This commit is contained in:
@@ -21,6 +21,7 @@ async def list_steps(
|
||||
end_date: Optional[str] = Query(None, description='Return steps before this ISO datetime (e.g. "2025-01-29T15:01:19-08:00")'),
|
||||
model: Optional[str] = Query(None, description="Filter by the name of the model used for the step"),
|
||||
agent_id: Optional[str] = Query(None, description="Filter by the ID of the agent that performed the step"),
|
||||
trace_ids: Optional[list[str]] = Query(None, description="Filter by trace ids returned by the server"),
|
||||
server: SyncServer = Depends(get_letta_server),
|
||||
actor_id: Optional[str] = Header(None, alias="user_id"),
|
||||
):
|
||||
@@ -44,6 +45,7 @@ async def list_steps(
|
||||
order=order,
|
||||
model=model,
|
||||
agent_id=agent_id,
|
||||
trace_ids=trace_ids,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ class StepManager:
|
||||
order: Optional[str] = None,
|
||||
model: Optional[str] = None,
|
||||
agent_id: Optional[str] = None,
|
||||
trace_ids: Optional[list[str]] = None,
|
||||
) -> List[PydanticStep]:
|
||||
"""List all jobs with optional pagination and status filter."""
|
||||
async with db_registry.async_session() as session:
|
||||
@@ -41,6 +42,8 @@ class StepManager:
|
||||
filter_kwargs["model"] = model
|
||||
if agent_id:
|
||||
filter_kwargs["agent_id"] = agent_id
|
||||
if trace_ids:
|
||||
filter_kwargs["trace_id"] = trace_ids
|
||||
|
||||
steps = await StepModel.list_async(
|
||||
db_session=session,
|
||||
|
||||
Reference in New Issue
Block a user