diff --git a/js/src/client.ts b/js/src/client.ts index fb440107f..d9aa11ca4 100644 --- a/js/src/client.ts +++ b/js/src/client.ts @@ -3648,13 +3648,38 @@ 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"); + } + /** * Get the size of an annotation queue. * @param queueId - The ID of the annotation queue */ public async getSizeFromAnnotationQueue( queueId: string - ): Promise> { + ): Promise<{ size: number }> { const response = await this.caller.call( _getFetchImplementation(), `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/size`,