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: filter internal runs endpoint by conversation id [LET-6886] (#8437)

Christina Tong318498bde3dc
diff --git a/fern/openapi.json b/fern/openapi.json
index 25bff2dcb..a1dffb576 100644
--- a/fern/openapi.json
+++ b/fern/openapi.json
@@ -11622,6 +11622,24 @@
},
"description": "Filter runs by project ID."
},
+ {
+ "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": "duration_percentile",
"in": "query",
diff --git a/letta/server/rest_api/routers/v1/internal_runs.py b/letta/server/rest_api/routers/v1/internal_runs.py
index 6788141cd..420888340 100644
--- a/letta/server/rest_api/routers/v1/internal_runs.py
+++ b/letta/server/rest_api/routers/v1/internal_runs.py
@@ -64,6 +64,7 @@ async def list_runs(
deprecated=True,
),
project_id: Optional[str] = Query(None, description="Filter runs by project ID."),
+ conversation_id: Optional[str] = Query(None, description="Filter runs by conversation ID."),
duration_percentile: Optional[int] = Query(
None, description="Filter runs by duration percentile (1-100). Returns runs slower than this percentile."
),
@@ -122,6 +123,7 @@ async def list_runs(
step_count_operator=step_count_operator,
tools_used=tools_used,
project_id=project_id,
+ conversation_id=conversation_id,
order_by=order_by,
duration_percentile=duration_percentile,
duration_filter=duration_filter,