diff --git a/fern/openapi.json b/fern/openapi.json index af2f31dc..8d6db742 100644 --- a/fern/openapi.json +++ b/fern/openapi.json @@ -10207,6 +10207,19 @@ "title": "Order" }, "description": "Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first" + }, + { + "name": "order_by", + "in": "query", + "required": false, + "schema": { + "const": "created_at", + "type": "string", + "description": "Field to sort by", + "default": "created_at", + "title": "Order By" + }, + "description": "Field to sort by" } ], "responses": { diff --git a/letta/server/rest_api/routers/v1/runs.py b/letta/server/rest_api/routers/v1/runs.py index b8bab7db..0577eba9 100644 --- a/letta/server/rest_api/routers/v1/runs.py +++ b/letta/server/rest_api/routers/v1/runs.py @@ -187,6 +187,7 @@ async def list_run_messages( order: Literal["asc", "desc"] = Query( "asc", description="Sort order for messages by creation time. 'asc' for oldest first, 'desc' for newest first" ), + order_by: Literal["created_at"] = Query("created_at", description="Field to sort by"), ): """Get response messages associated with a run.""" actor = await server.user_manager.get_actor_or_default_async(actor_id=headers.actor_id)