From eebc3cf8a648dac58b79dbfecd6788c384b792dd Mon Sep 17 00:00:00 2001 From: Max Hniebergall Date: Wed, 5 Jun 2024 12:57:37 -0400 Subject: [PATCH 1/5] Update Delete Inference Endpoint for dry_run and force options --- .../_json_spec/inference.delete.json | 24 ++++++++++++++++--- specification/inference/_types/Results.ts | 9 +++++++ .../inference/delete/DeleteRequest.ts | 13 ++++++++++ .../inference/delete/DeleteResponse.ts | 7 ++++-- 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/specification/_json_spec/inference.delete.json b/specification/_json_spec/inference.delete.json index 67f9a43823..2ef39244e4 100644 --- a/specification/_json_spec/inference.delete.json +++ b/specification/_json_spec/inference.delete.json @@ -7,13 +7,17 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": ["application/json"] + "accept": [ + "application/json" + ] }, "url": { "paths": [ { "path": "/_inference/{inference_id}", - "methods": ["DELETE"], + "methods": [ + "DELETE" + ], "parts": { "inference_id": { "type": "string", @@ -23,7 +27,9 @@ }, { "path": "/_inference/{task_type}/{inference_id}", - "methods": ["DELETE"], + "methods": [ + "DELETE" + ], "parts": { "task_type": { "type": "string", @@ -36,6 +42,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..6a6018618a 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 ingest processors which reference the inference endpoint + */ +export class DeleteInferenceEndpointResult extends AcknowledgedResponseBase { + ingest_processors: Array +} diff --git a/specification/inference/delete/DeleteRequest.ts b/specification/inference/delete/DeleteRequest.ts index 690f8a38f3..4deef6fac5 100644 --- a/specification/inference/delete/DeleteRequest.ts +++ b/specification/inference/delete/DeleteRequest.ts @@ -33,9 +33,22 @@ export interface Request extends RequestBase { * The task type */ task_type?: TaskType + /** * The inference Id */ inference_id: Id + + /** + * 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..1ab87939a1 100644 --- a/specification/inference/delete/DeleteResponse.ts +++ b/specification/inference/delete/DeleteResponse.ts @@ -17,8 +17,11 @@ * under the License. */ -import { AcknowledgedResponseBase } from '@_types/Base' + +import {DeleteInferenceEndpointResult} from "@inference/_types/Results"; export class Response { - body: AcknowledgedResponseBase + body: { + dryRunResult: DeleteInferenceEndpointResult + } } From 8b91557aa603f98ce03c96b2811fd52a44d4234c Mon Sep 17 00:00:00 2001 From: Max Hniebergall Date: Wed, 5 Jun 2024 13:17:35 -0400 Subject: [PATCH 2/5] fix style --- specification/_json_spec/inference.delete.json | 12 +++--------- specification/inference/_types/Results.ts | 4 ++-- specification/inference/delete/DeleteResponse.ts | 3 +-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/specification/_json_spec/inference.delete.json b/specification/_json_spec/inference.delete.json index 2ef39244e4..39cf20ba7c 100644 --- a/specification/_json_spec/inference.delete.json +++ b/specification/_json_spec/inference.delete.json @@ -7,17 +7,13 @@ "stability": "experimental", "visibility": "public", "headers": { - "accept": [ - "application/json" - ] + "accept": ["application/json"] }, "url": { "paths": [ { "path": "/_inference/{inference_id}", - "methods": [ - "DELETE" - ], + "methods": ["DELETE"], "parts": { "inference_id": { "type": "string", @@ -27,9 +23,7 @@ }, { "path": "/_inference/{task_type}/{inference_id}", - "methods": [ - "DELETE" - ], + "methods": ["DELETE"], "parts": { "task_type": { "type": "string", diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index 6a6018618a..a760119f54 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -19,7 +19,7 @@ import { float, byte, integer } from '@_types/Numeric' import { Dictionary } from '@spec_utils/Dictionary' -import {AcknowledgedResponseBase} from "@_types/Base"; +import { AcknowledgedResponseBase } from '@_types/Base' /** * Sparse Embedding tokens are represented as a dictionary @@ -92,5 +92,5 @@ export class InferenceResult { * Acknowledged response. For dry_run, contains the list of ingest processors which reference the inference endpoint */ export class DeleteInferenceEndpointResult extends AcknowledgedResponseBase { - ingest_processors: Array + ingest_processors: Array } diff --git a/specification/inference/delete/DeleteResponse.ts b/specification/inference/delete/DeleteResponse.ts index 1ab87939a1..6cf319fad4 100644 --- a/specification/inference/delete/DeleteResponse.ts +++ b/specification/inference/delete/DeleteResponse.ts @@ -17,8 +17,7 @@ * under the License. */ - -import {DeleteInferenceEndpointResult} from "@inference/_types/Results"; +import { DeleteInferenceEndpointResult } from '@inference/_types/Results' export class Response { body: { From 5b6848c8fc467f1018f5d749d8a774eb2311764d Mon Sep 17 00:00:00 2001 From: Max Hniebergall <137079448+maxhniebergall@users.noreply.github.com> Date: Wed, 5 Jun 2024 17:29:36 -0400 Subject: [PATCH 3/5] Add `query_parameters` Co-authored-by: David Kyle --- specification/inference/delete/DeleteRequest.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/inference/delete/DeleteRequest.ts b/specification/inference/delete/DeleteRequest.ts index 4deef6fac5..ef3e0316d0 100644 --- a/specification/inference/delete/DeleteRequest.ts +++ b/specification/inference/delete/DeleteRequest.ts @@ -38,7 +38,7 @@ export interface Request extends RequestBase { * 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 From 983a5a959f3fde9c89b9a8ebcdb8a0bc109b64be Mon Sep 17 00:00:00 2001 From: Max Hniebergall Date: Thu, 6 Jun 2024 09:19:03 -0400 Subject: [PATCH 4/5] fix syntax error --- specification/inference/delete/DeleteRequest.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/inference/delete/DeleteRequest.ts b/specification/inference/delete/DeleteRequest.ts index ef3e0316d0..7c090ad775 100644 --- a/specification/inference/delete/DeleteRequest.ts +++ b/specification/inference/delete/DeleteRequest.ts @@ -38,7 +38,8 @@ export interface Request extends RequestBase { * The inference Id */ inference_id: Id -query_parameters: { + } + query_parameters: { /** * When true, the endpoint is not deleted, and a list of ingest processors which reference this endpoint is returned * @server_default false From eeb5b974f9705d55a2e655df0eb042d716a5d431 Mon Sep 17 00:00:00 2001 From: Max Hniebergall Date: Thu, 6 Jun 2024 11:55:36 -0400 Subject: [PATCH 5/5] fixes from review --- specification/inference/_types/Results.ts | 4 ++-- specification/inference/delete/DeleteResponse.ts | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/specification/inference/_types/Results.ts b/specification/inference/_types/Results.ts index a760119f54..d6dc17d8d7 100644 --- a/specification/inference/_types/Results.ts +++ b/specification/inference/_types/Results.ts @@ -89,8 +89,8 @@ export class InferenceResult { } /** - * Acknowledged response. For dry_run, contains the list of ingest processors which reference the inference endpoint + * Acknowledged response. For dry_run, contains the list of pipelines which reference the inference endpoint */ export class DeleteInferenceEndpointResult extends AcknowledgedResponseBase { - ingest_processors: Array + pipelines: Array } diff --git a/specification/inference/delete/DeleteResponse.ts b/specification/inference/delete/DeleteResponse.ts index 6cf319fad4..25a812a097 100644 --- a/specification/inference/delete/DeleteResponse.ts +++ b/specification/inference/delete/DeleteResponse.ts @@ -20,7 +20,5 @@ import { DeleteInferenceEndpointResult } from '@inference/_types/Results' export class Response { - body: { - dryRunResult: DeleteInferenceEndpointResult - } + body: DeleteInferenceEndpointResult }