diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 3592a83865..e38c03b3eb 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -69811,6 +69811,9 @@ "inference._types:InferenceEndpoint": { "type": "object", "properties": { + "chunking_settings": { + "$ref": "#/components/schemas/inference._types:InferenceChunkingSettings" + }, "service": { "description": "The service type", "type": "string" @@ -69827,6 +69830,34 @@ "service_settings" ] }, + "inference._types:InferenceChunkingSettings": { + "allOf": [ + { + "$ref": "#/components/schemas/inference._types:InferenceEndpoint" + }, + { + "type": "object", + "properties": { + "max_chunk_size": { + "description": "Specifies the maximum size of a chunk in words\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy)", + "type": "number" + }, + "overlap": { + "description": "Specifies the number of overlapping words for chunks\nOnly for `word` chunking strategy\nThis value cannot be higher than the half of `max_chunk_size`", + "type": "number" + }, + "sentence_overlap": { + "description": "Specifies the number of overlapping sentences for chunks\nOnly for `sentence` chunking strategy\nIt can be either `1` or `0`", + "type": "number" + }, + "strategy": { + "description": "Specifies the chunking strategy\nIt could be either `sentence` or `word`", + "type": "string" + } + } + } + ] + }, "inference._types:ServiceSettings": { "type": "object" }, diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index f3ec2127ad..4437eecd76 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -45943,6 +45943,9 @@ "inference._types:InferenceEndpoint": { "type": "object", "properties": { + "chunking_settings": { + "$ref": "#/components/schemas/inference._types:InferenceChunkingSettings" + }, "service": { "description": "The service type", "type": "string" @@ -45959,6 +45962,34 @@ "service_settings" ] }, + "inference._types:InferenceChunkingSettings": { + "allOf": [ + { + "$ref": "#/components/schemas/inference._types:InferenceEndpoint" + }, + { + "type": "object", + "properties": { + "max_chunk_size": { + "description": "Specifies the maximum size of a chunk in words\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy)", + "type": "number" + }, + "overlap": { + "description": "Specifies the number of overlapping words for chunks\nOnly for `word` chunking strategy\nThis value cannot be higher than the half of `max_chunk_size`", + "type": "number" + }, + "sentence_overlap": { + "description": "Specifies the number of overlapping sentences for chunks\nOnly for `sentence` chunking strategy\nIt can be either `1` or `0`", + "type": "number" + }, + "strategy": { + "description": "Specifies the chunking strategy\nIt could be either `sentence` or `word`", + "type": "string" + } + } + } + ] + }, "inference._types:ServiceSettings": { "type": "object" }, diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index 9c4b2941fe..1947e2502f 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -94720,7 +94720,7 @@ "name": "ServiceSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L55-L55", + "specLocation": "inference/_types/Services.ts#L92-L92", "type": { "kind": "user_defined_value" } @@ -94758,7 +94758,7 @@ "name": "TaskSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L57-L57", + "specLocation": "inference/_types/Services.ts#L94-L94", "type": { "kind": "user_defined_value" } @@ -121215,7 +121215,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L41-L53" + "specLocation": "inference/_types/Services.ts#L46-L58" }, { "description": "Configuration options when storing the inference endpoint", @@ -121225,6 +121225,18 @@ "namespace": "inference._types" }, "properties": [ + { + "description": "Chunking configuration object", + "name": "chunking_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + } + } + }, { "description": "The service type", "name": "service", @@ -121262,7 +121274,76 @@ } } ], - "specLocation": "inference/_types/Services.ts#L23-L39" + "specLocation": "inference/_types/Services.ts#L24-L44" + }, + { + "description": "Chunking configuration object", + "inherits": { + "type": { + "name": "InferenceEndpoint", + "namespace": "inference._types" + } + }, + "kind": "interface", + "name": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "Specifies the maximum size of a chunk in words\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy)", + "name": "max_chunk_size", + "required": false, + "serverDefault": 250, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies the number of overlapping words for chunks\nOnly for `word` chunking strategy\nThis value cannot be higher than the half of `max_chunk_size`", + "name": "overlap", + "required": false, + "serverDefault": 100, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies the number of overlapping sentences for chunks\nOnly for `sentence` chunking strategy\nIt can be either `1` or `0`", + "name": "sentence_overlap", + "required": false, + "serverDefault": 1, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies the chunking strategy\nIt could be either `sentence` or `word`", + "name": "strategy", + "required": false, + "serverDefault": "sentence", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/_types/Services.ts#L60-L90" }, { "description": "InferenceResult is an aggregation of mutually exclusive variants", diff --git a/output/schema/schema.json b/output/schema/schema.json index 14d3c389d8..bc8a396e52 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -140735,6 +140735,75 @@ } } }, + { + "kind": "interface", + "description": "Chunking configuration object", + "inherits": { + "type": { + "name": "InferenceEndpoint", + "namespace": "inference._types" + } + }, + "name": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "Specifies the maximum size of a chunk in words\nThis value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy)", + "name": "max_chunk_size", + "required": false, + "serverDefault": 250, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies the number of overlapping words for chunks\nOnly for `word` chunking strategy\nThis value cannot be higher than the half of `max_chunk_size`", + "name": "overlap", + "required": false, + "serverDefault": 100, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies the number of overlapping sentences for chunks\nOnly for `sentence` chunking strategy\nIt can be either `1` or `0`", + "name": "sentence_overlap", + "required": false, + "serverDefault": 1, + "type": { + "kind": "instance_of", + "type": { + "name": "integer", + "namespace": "_types" + } + } + }, + { + "description": "Specifies the chunking strategy\nIt could be either `sentence` or `word`", + "name": "strategy", + "required": false, + "serverDefault": "sentence", + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/_types/Services.ts#L60-L90" + }, { "kind": "interface", "description": "Configuration options when storing the inference endpoint", @@ -140743,6 +140812,18 @@ "namespace": "inference._types" }, "properties": [ + { + "description": "Chunking configuration object", + "name": "chunking_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + } + } + }, { "description": "The service type", "name": "service", @@ -140780,7 +140861,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L23-L39" + "specLocation": "inference/_types/Services.ts#L24-L44" }, { "kind": "interface", @@ -140821,7 +140902,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L41-L53" + "specLocation": "inference/_types/Services.ts#L46-L58" }, { "kind": "interface", @@ -140957,7 +141038,7 @@ "name": "ServiceSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L55-L55", + "specLocation": "inference/_types/Services.ts#L92-L92", "type": { "kind": "user_defined_value" } @@ -141016,7 +141097,7 @@ "name": "TaskSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L57-L57", + "specLocation": "inference/_types/Services.ts#L94-L94", "type": { "kind": "user_defined_value" } diff --git a/output/typescript/types.ts b/output/typescript/types.ts index bef791de5a..5d5eced2d8 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -12700,7 +12700,15 @@ export type InferenceDenseByteVector = byte[] export type InferenceDenseVector = float[] +export interface InferenceInferenceChunkingSettings extends InferenceInferenceEndpoint { + max_chunk_size?: integer + overlap?: integer + sentence_overlap?: integer + strategy?: string +} + export interface InferenceInferenceEndpoint { + chunking_settings?: InferenceInferenceChunkingSettings service: string service_settings: InferenceServiceSettings task_settings?: InferenceTaskSettings diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index 52d3c9f7e4..53024633f5 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -18,12 +18,17 @@ */ import { UserDefinedValue } from '@spec_utils/UserDefinedValue' +import { integer } from '@_types/Numeric' import { TaskType } from '../_types/TaskType' /** * Configuration options when storing the inference endpoint */ export class InferenceEndpoint { + /** + * Chunking configuration object + */ + chunking_settings?: InferenceChunkingSettings /** * The service type */ @@ -52,6 +57,38 @@ export class InferenceEndpointInfo extends InferenceEndpoint { task_type: TaskType } +/** + * Chunking configuration object + */ +export class InferenceChunkingSettings extends InferenceEndpoint { + /** + * Specifies the maximum size of a chunk in words + * This value cannot be higher than `300` or lower than `20` (for `sentence` strategy) or `10` (for `word` strategy) + * @server_default 250 + */ + max_chunk_size?: integer + /** + * Specifies the number of overlapping words for chunks + * Only for `word` chunking strategy + * This value cannot be higher than the half of `max_chunk_size` + * @server_default 100 + */ + overlap?: integer + /** + * Specifies the number of overlapping sentences for chunks + * Only for `sentence` chunking strategy + * It can be either `1` or `0` + * @server_default 1 + */ + sentence_overlap?: integer + /** + * Specifies the chunking strategy + * It could be either `sentence` or `word` + * @server_default sentence + */ + strategy?: string +} + export type ServiceSettings = UserDefinedValue export type TaskSettings = UserDefinedValue