From 3f1d4af9b211c7dc788155467caeed8a4d44f617 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 6 Jan 2025 11:00:31 +0000 Subject: [PATCH 1/2] feat: Add method to delete a run from an annotation queue --- js/src/client.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/js/src/client.ts b/js/src/client.ts index 47079823b..a7ce2a12d 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -3648,6 +3648,26 @@ export class Client implements LangSmithTracingClientInterface { return await response.json(); } + + /** + * Delete a run from an an annotation queue. + * @param queueId - The ID of the annotation queue to delete the run from + * @param queueRunId - The ID of the run to delete from the annotation queue + */ + public async deleteRunFromAnnotationQueue(queueId: string, queueRunId: string): Promise { + const response = await this.caller.call( + _getFetchImplementation(), + `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs/${assertUuid(queueRunId, "queueRunId")}`, + { + method: "DELETE", + headers: { ...this.headers, Accept: "application/json" }, + signal: AbortSignal.timeout(this.timeout_ms), + ...this.fetchOptions, + } + ); + await raiseForStatus(response, "delete run from annotation queue"); + } + protected async _currentTenantIsOwner(owner: string): Promise { const settings = await this._getSettings(); return owner == "-" || settings.tenant_handle === owner; From b5d12557b01b106232929cf2ebb358578f52f55b Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 6 Jan 2025 13:38:51 +0000 Subject: [PATCH 2/2] Format code --- js/src/client.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/js/src/client.ts b/js/src/client.ts index a7ce2a12d..d5be8d250 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -3648,16 +3648,21 @@ export class Client implements LangSmithTracingClientInterface { return await response.json(); } - /** * Delete a run from an an annotation queue. * @param queueId - The ID of the annotation queue to delete the run from * @param queueRunId - The ID of the run to delete from the annotation queue */ - public async deleteRunFromAnnotationQueue(queueId: string, queueRunId: string): Promise { + public async deleteRunFromAnnotationQueue( + queueId: string, + queueRunId: string + ): Promise { const response = await this.caller.call( _getFetchImplementation(), - `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs/${assertUuid(queueRunId, "queueRunId")}`, + `${this.apiUrl}/annotation-queues/${assertUuid( + queueId, + "queueId" + )}/runs/${assertUuid(queueRunId, "queueRunId")}`, { method: "DELETE", headers: { ...this.headers, Accept: "application/json" },