From 27a75c7dd1ab63640ccf9918584f0164265e2eaf Mon Sep 17 00:00:00 2001 From: Max Hniebergall <137079448+maxhniebergall@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:07:33 -0400 Subject: [PATCH] [ML] Update Delete Inference Endpoint for dry_run and force options (#2602) * Update Delete Inference Endpoint for dry_run and force options * fix style * Add `query_parameters` Co-authored-by: David Kyle * fix syntax error * fixes from review --------- Co-authored-by: David Kyle --- specification/_json_spec/inference.delete.json | 12 ++++++++++++ specification/inference/_types/Results.ts | 9 +++++++++ specification/inference/delete/DeleteRequest.ts | 14 ++++++++++++++ specification/inference/delete/DeleteResponse.ts | 4 ++-- 4 files changed, 37 insertions(+), 2 deletions(-) diff --git a/specification/_json_spec/inference.delete.json b/specification/_json_spec/inference.delete.json index 67f9a43823..39cf20ba7c 100644 --- a/specification/_json_spec/inference.delete.json +++ b/specification/_json_spec/inference.delete.json @@ -36,6 +36,18 @@ } } ] + }, + "params": { + "dry_run": { + "type": "boolean", + "description": "If true the endpoint will not be deleted and a list of ingest processors which reference this endpoint will be returned.", + "required": false + }, + "force": { + "type": "boolean", + "description": "True if the endpoint should be forcefully stopped (regardless of whether or not it is referenced by any ingest processors or semantic text fields).", + "required": false + } } } } diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index 700e82d936..d6dc17d8d7 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -19,6 +19,7 @@ import { float, byte, integer } from '@_types/Numeric' import { Dictionary } from '@spec_utils/Dictionary' +import { AcknowledgedResponseBase } from '@_types/Base' /** * Sparse Embedding tokens are represented as a dictionary @@ -74,6 +75,7 @@ export class RankedDocument { score: float text?: string } + /** * InferenceResult is an aggregation of mutually exclusive variants * @variants container @@ -85,3 +87,10 @@ export class InferenceResult { completion?: Array rerank?: Array } + +/** + * Acknowledged response. For dry_run, contains the list of pipelines which reference the inference endpoint + */ +export class DeleteInferenceEndpointResult extends AcknowledgedResponseBase { + pipelines: Array +} diff --git a/specification/inference/delete/DeleteRequest.ts b/specification/inference/delete/DeleteRequest.ts index 690f8a38f3..7c090ad775 100644 --- a/specification/inference/delete/DeleteRequest.ts +++ b/specification/inference/delete/DeleteRequest.ts @@ -33,9 +33,23 @@ export interface Request extends RequestBase { * The task type */ task_type?: TaskType + /** * The inference Id */ inference_id: Id } + query_parameters: { + /** + * When true, the endpoint is not deleted, and a list of ingest processors which reference this endpoint is returned + * @server_default false + */ + dry_run?: Boolean + + /** + * When true, the inference endpoint is forcefully deleted even if it is still being used by ingest processors or semantic text fields + * @server_default false + */ + force?: Boolean + } } diff --git a/specification/inference/delete/DeleteResponse.ts b/specification/inference/delete/DeleteResponse.ts index 7374da4a4c..25a812a097 100644 --- a/specification/inference/delete/DeleteResponse.ts +++ b/specification/inference/delete/DeleteResponse.ts @@ -17,8 +17,8 @@ * under the License. */ -import { AcknowledgedResponseBase } from '@_types/Base' +import { DeleteInferenceEndpointResult } from '@inference/_types/Results' export class Response { - body: AcknowledgedResponseBase + body: DeleteInferenceEndpointResult }