From 2daf1b658eed2be9c83ebc7b4cfa7ae3382f07c4 Mon Sep 17 00:00:00 2001 From: William FH <13333726+hinthornw@users.noreply.github.com> Date: Fri, 20 Sep 2024 17:43:48 -0700 Subject: [PATCH] Adding method for removing a run from an annotation queue (#1027) (#1029) Closes #1026 --------- Co-authored-by: Max Hoecker <48892291+MaxHoecker@users.noreply.github.com> 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..d15cfa46f 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: + """Delete 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: