Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Update Delete Inference Endpoint for dry_run and force options #2602

Merged
merged 6 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ingest processors which reference the inference endpoint
*/
export class DeleteInferenceEndpointResult extends AcknowledgedResponseBase {
ingest_processors: Array<string>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the field is pipelines right? That's what I'm seeing in the response:

{
    "acknowledged": false,
    "pipelines": [
        "elser"
    ]
}

}
13 changes: 13 additions & 0 deletions specification/inference/delete/DeleteRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,22 @@ export interface Request extends RequestBase {
* The task type
*/
task_type?: TaskType

/**
* The inference Id
*/
inference_id: Id

maxhniebergall marked this conversation as resolved.
Show resolved Hide resolved
/**
* 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
}
}
6 changes: 4 additions & 2 deletions specification/inference/delete/DeleteResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
* under the License.
*/

import { AcknowledgedResponseBase } from '@_types/Base'
import { DeleteInferenceEndpointResult } from '@inference/_types/Results'

export class Response {
body: AcknowledgedResponseBase
body: {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I think this should be:

export class Response {
  body: DeleteInferenceEndpointResult
}

I don't believe there's a dryRunResult field in the response.

dryRunResult: DeleteInferenceEndpointResult
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does dryRunResult mean here? Should it be body: DeleteInferenceEndpointResult ?

}
}
Loading