From 4d5b5f541804c5400438e7def393a80250b2bc16 Mon Sep 17 00:00:00 2001 From: Max Hoecker <48892291+MaxHoecker@users.noreply.github.com> Date: Fri, 20 Sep 2024 19:34:32 -0400 Subject: [PATCH] Adding method for removing a run from an annotation queue (#1027) Closes #1026 Co-authored-by: mhoecke1 --- python/langsmith/client.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 7cf98bc3d..5cadbd640 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -4681,6 +4681,22 @@ def add_runs_to_annotation_queue( ) ls_utils.raise_for_status_with_text(response) + def delete_run_from_annotation_queue( + self, queue_id: ID_TYPE, *, run_id: ID_TYPE + ) -> None: + """Deletes a run from an annotation queue with the specified queue ID and run ID. + + Args: + queue_id (ID_TYPE): The ID of the annotation queue. + run_id (ID_TYPE): The ID of the run to be added to the annotation + queue. + """ + response = self.request_with_retries( + "DELETE", + f"/annotation-queues/{_as_uuid(queue_id, 'queue_id')}/runs/{_as_uuid(run_id, 'run_id')}", + ) + ls_utils.raise_for_status_with_text(response) + def get_run_from_annotation_queue( self, queue_id: ID_TYPE, *, index: int ) -> ls_schemas.RunWithAnnotationQueueInfo: