diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 1d27e7c99..4f9bcdb6a 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -3983,6 +3983,29 @@ def delete_example(self, example_id: ID_TYPE) -> None: ) ls_utils.raise_for_status_with_text(response) + def delete_examples(self, example_ids: Sequence[ID_TYPE]) -> None: + """Delete multiple examples by ID. + + Parameters + ---------- + example_ids : Sequence[ID_TYPE] + The IDs of the examples to delete. + """ + response = self.request_with_retries( + "DELETE", + "/examples", + headers={**self._headers, "Content-Type": "application/json"}, + data=_dumps_json( + { + "ids": [ + str(_as_uuid(id_, f"example_ids[{i}]")) + for i, id_ in enumerate(example_ids) + ] + } + ), + ) + ls_utils.raise_for_status_with_text(response) + def list_dataset_splits( self, *,