Skip to content

Commit

Permalink
Use endpoint instead of model in the inference API
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkyle committed Apr 25, 2024
1 parent b23616d commit 2c4718d
Show file tree
Hide file tree
Showing 15 changed files with 7,333 additions and 2,609 deletions.
258 changes: 136 additions & 122 deletions output/schema/schema.json

Large diffs are not rendered by default.

9,582 changes: 7,145 additions & 2,437 deletions output/schema/schema/schema.json

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.delete_model": {
"inference.delete": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/delete-inference-api.html",
"description": "Delete model in the Inference API"
"description": "Delete an inference endpoint"
},
"stability": "experimental",
"visibility": "public",
Expand Down Expand Up @@ -31,7 +31,7 @@
},
"inference_id": {
"type": "string",
"description": "The model Id"
"description": "The inference Id"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.get_model": {
"inference.get": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/get-inference-api.html",
"description": "Get a model in the Inference API"
"description": "Get an inference endpoint"
},
"stability": "experimental",
"visibility": "public",
Expand Down
2 changes: 1 addition & 1 deletion specification/_json_spec/inference.inference.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"inference.inference": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/post-inference-api.html",
"description": "Perform inference on a model"
"description": "Perform inference"
},
"stability": "experimental",
"visibility": "public",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"inference.put_model": {
"inference.put": {
"documentation": {
"url": "https://www.elastic.co/guide/en/elasticsearch/reference/master/put-inference-api.html",
"description": "Configure a model for use in the Inference API"
"description": "Configure an inference endpoint for use in the Inference API"
},
"stability": "experimental",
"visibility": "public",
Expand Down Expand Up @@ -39,7 +39,7 @@
]
},
"body": {
"description": "The model's task and service settings"
"description": "The endpoint's task and service settings"
}
}
}
16 changes: 8 additions & 8 deletions specification/inference/_types/Services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import { TaskType } from '../_types/TaskType'
import { UserDefinedValue } from '@spec_utils/UserDefinedValue'

/**
* Configuration options when storing the model config
* Configuration options when storing the inference endpoint
*/
export class ModelConfig {
export class InferenceEndpoint {
/**
* The service type
*/
Expand All @@ -33,21 +33,21 @@ export class ModelConfig {
*/
service_settings: ServiceSettings
/**
* Task settings specific to the service and model
* Task settings specific to the service and task type
*/
task_settings: TaskSettings
}

/**
* Represents a model as returned by the GET API
* Represents a infenence endpoint as returned by the GET API
*/
export class ModelConfigContainer extends ModelConfig {
export class InferenceEndpointContainer extends InferenceEndpoint {
/**
* The model Id
* The inference Id
*/
model_id: string
inference_id: string
/**
* The model's task type
* The task type
*/
task_type: TaskType
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { Id } from '@_types/common'
import { TaskType } from '@inference/_types/TaskType'

/**
* Delete an inference service model
* @rest_spec_name inference.delete_model
* Delete an inference endpoint
* @rest_spec_name inference.delete
* @availability stack since=8.11.0 stability=experimental visibility=public
* @availability serverless stability=experimental visibility=public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { Id } from '@_types/common'
import { TaskType } from '@inference/_types/TaskType'

/**
* Get an inference service model
* @rest_spec_name inference.get_model
* Get an inference endpoint
* @rest_spec_name inference.get
* @availability stack since=8.11.0 stability=experimental visibility=public
* @availability serverless stability=experimental visibility=public
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
* under the License.
*/

import { ModelConfigContainer } from '@inference/_types/Services'
import { InferenceEndpointContainer } from '@inference/_types/Services'

export class Response {
body: {
models: Array<ModelConfigContainer>
models?: Array<InferenceEndpointContainer>
endpoints?: Array<InferenceEndpointContainer>
}
}
2 changes: 1 addition & 1 deletion specification/inference/inference/InferenceRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface Request extends RequestBase {
*/
query?: string
/**
* Text input to the model.
* Inference input
* Either a string or an array of strings.
*/
input: string | Array<string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@

import { RequestBase } from '@_types/Base'
import { Id } from '@_types/common'
import { ModelConfig } from '@inference/_types/Services'
import { InferenceEndpoint } from '@inference/_types/Services'
import { TaskType } from '@inference/_types/TaskType'

/**
* Create an inference service model
* @rest_spec_name inference.put_model
* Create an inference endpoint
* @rest_spec_name inference.put
* @availability stack since=8.11.0 stability=experimental visibility=public
* @availability serverless stability=experimental visibility=public
*/
Expand All @@ -39,6 +39,6 @@ export interface Request extends RequestBase {
*/
inference_id: Id
}
/** @codegen_name model_config */
body: ModelConfig
/** @codegen_name inference_config */
body: InferenceEndpoint
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* under the License.
*/

import { ModelConfigContainer } from '@inference/_types/Services'
import { InferenceEndpointContainer } from '@inference/_types/Services'

export class Response {
body: ModelConfigContainer
body: InferenceEndpointContainer
}

0 comments on commit 2c4718d

Please sign in to comment.