Skip to content

Commit

Permalink
[ML] Update Delete Inference Endpoint for dry_run and force options (#…
Browse files Browse the repository at this point in the history
…2602)

* Update Delete Inference Endpoint for dry_run and force options

* fix style

* Add `query_parameters`

Co-authored-by: David Kyle <[email protected]>

* fix syntax error

* fixes from review

---------

Co-authored-by: David Kyle <[email protected]>
  • Loading branch information
maxhniebergall and davidkyle authored Jun 6, 2024
1 parent 6655e83 commit 27a75c7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 2 deletions.
12 changes: 12 additions & 0 deletions specification/_json_spec/inference.delete.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
9 changes: 9 additions & 0 deletions specification/inference/_types/Results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -74,6 +75,7 @@ export class RankedDocument {
score: float
text?: string
}

/**
* InferenceResult is an aggregation of mutually exclusive variants
* @variants container
Expand All @@ -85,3 +87,10 @@ export class InferenceResult {
completion?: Array<CompletionResult>
rerank?: Array<RankedDocument>
}

/**
* Acknowledged response. For dry_run, contains the list of pipelines which reference the inference endpoint
*/
export class DeleteInferenceEndpointResult extends AcknowledgedResponseBase {
pipelines: Array<string>
}
14 changes: 14 additions & 0 deletions specification/inference/delete/DeleteRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
4 changes: 2 additions & 2 deletions specification/inference/delete/DeleteResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 27a75c7

Please sign in to comment.