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.

feat: add conversation_id filter to list runs [LET-6865] (#8404)

Ari Webb754e750cc5a9
diff --git a/fern/openapi.json b/fern/openapi.json
index 0fc4f219a..0146c5371 100644
--- a/fern/openapi.json
+++ b/fern/openapi.json
@@ -14469,6 +14469,24 @@
},
"description": "Filter runs by stop reason."
},
+ {
+ "name": "conversation_id",
+ "in": "query",
+ "required": false,
+ "schema": {
+ "anyOf": [
+ {
+ "type": "string"
+ },
+ {
+ "type": "null"
+ }
+ ],
+ "description": "Filter runs by conversation ID.",
+ "title": "Conversation Id"
+ },
+ "description": "Filter runs by conversation ID."
+ },
{
"name": "before",
"in": "query",
diff --git a/letta/server/rest_api/routers/v1/runs.py b/letta/server/rest_api/routers/v1/runs.py
index 1d6451bc9..d643e2251 100644
--- a/letta/server/rest_api/routers/v1/runs.py
+++ b/letta/server/rest_api/routers/v1/runs.py
@@ -55,6 +55,7 @@ async def list_runs(
statuses: Optional[List[str]] = Query(None, description="Filter runs by status. Can specify multiple statuses."),
background: Optional[bool] = Query(None, description="If True, filters for runs that were created in background mode."),
stop_reason: Optional[StopReasonType] = Query(None, description="Filter runs by stop reason."),
+ conversation_id: Optional[str] = Query(None, description="Filter runs by conversation ID."),
before: Optional[str] = Query(
None, description="Run ID cursor for pagination. Returns runs that come before this run ID in the specified sort order"
),
@@ -109,6 +110,7 @@ async def list_runs(
ascending=sort_ascending,
stop_reason=stop_reason,
background=background,
+ conversation_id=conversation_id,
)
return runs