diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index 8879466eb3..16250c1159 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -23,7 +23,7 @@ import { Message } from '@inference/chat_completion_unified/UnifiedRequest' import { RequestBase } from '@_types/Base' -import { float, long } from '@_types/Numeric' +import { float, integer, long } from '@_types/Numeric' export interface RequestChatCompletionBase extends RequestBase { /** @@ -59,3 +59,22 @@ export interface RequestChatCompletionBase extends RequestBase { */ top_p?: float } + +export class AdaptiveAllocations { + /** + * Turn on `adaptive_allocations`. + * @server_default false + */ + enabled?: boolean + /** + * The maximum number of allocations to scale to. + * If set, it must be greater than or equal to `min_number_of_allocations`. + */ + max_number_of_allocations?: integer + /** + * The minimum number of allocations to scale to. + * If set, it must be greater than or equal to 0. + * If not defined, the deployment scales to 0. + */ + min_number_of_allocations?: integer +} diff --git a/specification/inference/put_elasticsearch/PutElasticsearchRequest.ts b/specification/inference/put_elasticsearch/PutElasticsearchRequest.ts index 5430ebb8e7..0c8794d9f4 100644 --- a/specification/inference/put_elasticsearch/PutElasticsearchRequest.ts +++ b/specification/inference/put_elasticsearch/PutElasticsearchRequest.ts @@ -17,6 +17,7 @@ * under the License. */ +import { AdaptiveAllocations } from '@inference/_types/CommonTypes' import { InferenceChunkingSettings } from '@inference/_types/Services' import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' @@ -95,25 +96,6 @@ export enum ServiceType { elasticsearch } -export class AdaptiveAllocations { - /** - * Turn on `adaptive_allocations`. - * @server_default false - */ - enabled?: boolean - /** - * The maximum number of allocations to scale to. - * If set, it must be greater than or equal to `min_number_of_allocations`. - */ - max_number_of_allocations?: integer - /** - * The minimum number of allocations to scale to. - * If set, it must be greater than or equal to 0. - * If not defined, the deployment scales to 0. - */ - min_number_of_allocations?: integer -} - export class ElasticsearchServiceSettings { /** * Adaptive allocations configuration details. diff --git a/specification/inference/put_elser/PutElserRequest.ts b/specification/inference/put_elser/PutElserRequest.ts index 3a21e01df3..1b03f03bed 100644 --- a/specification/inference/put_elser/PutElserRequest.ts +++ b/specification/inference/put_elser/PutElserRequest.ts @@ -17,6 +17,7 @@ * under the License. */ +import { AdaptiveAllocations } from '@inference/_types/CommonTypes' import { InferenceChunkingSettings } from '@inference/_types/Services' import { RequestBase } from '@_types/Base' import { Id } from '@_types/common' @@ -89,25 +90,6 @@ export enum ServiceType { elser } -export class AdaptiveAllocations { - /** - * Turn on `adaptive_allocations`. - * @server_default false - */ - enabled?: boolean - /** - * The maximum number of allocations to scale to. - * If set, it must be greater than or equal to `min_number_of_allocations`. - */ - max_number_of_allocations?: integer - /** - * The minimum number of allocations to scale to. - * If set, it must be greater than or equal to 0. - * If not defined, the deployment scales to 0. - */ - min_number_of_allocations?: integer -} - export class ElserServiceSettings { /** * Adaptive allocations configuration details.