From 65cb1199127b5a9b48cdd3f171a1821acfde06e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 10:58:26 +0200 Subject: [PATCH 01/17] Adds custom inference service docs. --- specification/inference/put_custom/PutCustomRequest.ts | 0 specification/inference/put_custom/PutCustomResponse.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 specification/inference/put_custom/PutCustomRequest.ts create mode 100644 specification/inference/put_custom/PutCustomResponse.ts diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/specification/inference/put_custom/PutCustomResponse.ts b/specification/inference/put_custom/PutCustomResponse.ts new file mode 100644 index 0000000000..e69de29bb2 From ac7739649726260fe803790d93a93813433700c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 11:35:36 +0200 Subject: [PATCH 02/17] Adds response documentation. --- specification/inference/_types/Services.ts | 34 ++++++++++++------- specification/inference/_types/TaskType.ts | 7 ++++ .../inference/put_custom/PutCustomResponse.ts | 25 ++++++++++++++ .../PutDeepSeekRequestExample1.yaml | 0 .../PutDeepSeekRequestExample2.yaml | 0 5 files changed, 54 insertions(+), 12 deletions(-) rename specification/inference/put_deepseek/{request => examples}/PutDeepSeekRequestExample1.yaml (100%) rename specification/inference/put_deepseek/{request => examples}/PutDeepSeekRequestExample2.yaml (100%) diff --git a/specification/inference/_types/Services.ts b/specification/inference/_types/Services.ts index 720dd9ea43..802db7decc 100644 --- a/specification/inference/_types/Services.ts +++ b/specification/inference/_types/Services.ts @@ -27,6 +27,7 @@ import { TaskTypeAzureAIStudio, TaskTypeAzureOpenAI, TaskTypeCohere, + TaskTypeCustom, TaskTypeDeepSeek, TaskTypeElasticsearch, TaskTypeELSER, @@ -75,18 +76,6 @@ export class InferenceEndpointInfo extends InferenceEndpoint { */ task_type: TaskType } - -export class InferenceEndpointInfoJinaAi extends InferenceEndpoint { - /** - * The inference Id - */ - inference_id: string - /** - * The task type - */ - task_type: TaskTypeJinaAi -} - export class InferenceEndpointInfoAlibabaCloudAI extends InferenceEndpoint { /** * The inference Id @@ -153,6 +142,16 @@ export class InferenceEndpointInfoCohere extends InferenceEndpoint { task_type: TaskTypeCohere } +export class InferenceEndpointInfoCustom extends InferenceEndpoint { + /** + * The inference Id + */ + inference_id: string + /** + * The task type + */ + task_type: TaskTypeCustom +} export class InferenceEndpointInfoDeepSeek extends InferenceEndpoint { /** * The inference Id @@ -219,6 +218,17 @@ export class InferenceEndpointInfoHuggingFace extends InferenceEndpoint { task_type: TaskTypeHuggingFace } +export class InferenceEndpointInfoJinaAi extends InferenceEndpoint { + /** + * The inference Id + */ + inference_id: string + /** + * The task type + */ + task_type: TaskTypeJinaAi +} + export class InferenceEndpointInfoMistral extends InferenceEndpoint { /** * The inference Id diff --git a/specification/inference/_types/TaskType.ts b/specification/inference/_types/TaskType.ts index 670dc3d3e5..6daed0d281 100644 --- a/specification/inference/_types/TaskType.ts +++ b/specification/inference/_types/TaskType.ts @@ -65,6 +65,13 @@ export enum TaskTypeCohere { completion } +export enum TaskTypeCustom { + text_embedding, + sparse_embedding, + rerank, + completion +} + export enum TaskTypeDeepSeek { completion, chat_completion diff --git a/specification/inference/put_custom/PutCustomResponse.ts b/specification/inference/put_custom/PutCustomResponse.ts index e69de29bb2..b691dd00c3 100644 --- a/specification/inference/put_custom/PutCustomResponse.ts +++ b/specification/inference/put_custom/PutCustomResponse.ts @@ -0,0 +1,25 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { InferenceEndpointInfoCustom } from '@inference/_types/Services' + +export class Response { + /** @codegen_name endpoint_info */ + body: InferenceEndpointInfoCustom +} \ No newline at end of file diff --git a/specification/inference/put_deepseek/request/PutDeepSeekRequestExample1.yaml b/specification/inference/put_deepseek/examples/PutDeepSeekRequestExample1.yaml similarity index 100% rename from specification/inference/put_deepseek/request/PutDeepSeekRequestExample1.yaml rename to specification/inference/put_deepseek/examples/PutDeepSeekRequestExample1.yaml diff --git a/specification/inference/put_deepseek/request/PutDeepSeekRequestExample2.yaml b/specification/inference/put_deepseek/examples/PutDeepSeekRequestExample2.yaml similarity index 100% rename from specification/inference/put_deepseek/request/PutDeepSeekRequestExample2.yaml rename to specification/inference/put_deepseek/examples/PutDeepSeekRequestExample2.yaml From 389ce57262ab9239037f3e9f81dbabb3c64296b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 14:16:40 +0200 Subject: [PATCH 03/17] Adds request params docs. --- specification/inference/_types/CommonTypes.ts | 130 ++++++++++++++++++ .../inference/put_custom/PutCustomRequest.ts | 78 +++++++++++ 2 files changed, 208 insertions(+) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index e097e0cd6a..bd3482bcb2 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -758,6 +758,136 @@ export class CohereTaskSettings { truncate?: CohereTruncateType } +export class CustomServiceSettings { + /** + * Specifies the HTTPS header parameters – such as `Authentication` or `Contet-Type` – that are required to access the custom service. + * For example: + * ``` + * "headers":{ + * "Authorization": "Bearer ${api_key}", + * "Content-Type": "application/json;charset=utf-8" + * } + * ``` + */ + headers?: object + /** + * The request configuration object. + */ + request: CustomRequestParams + /** + * The response configuration object. + */ + response: CustomResponseParams + /** + * Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service. + * For example: + * ``` + * "secret_parameters":{ + * "api_key":"" + * } + * ``` + */ + secret_parameters: object + /** + * The URL endpoint to use for the requests. + */ + url?: string +} + +export class CustomRequestParams { + /** + * The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body. + * For example: + * ``` + * "request":{ + * "content":"{\"input\":${input}}" + * } + * ``` + * > info + * > The content string needs to be a single line except using the Kibana console. + */ + content: string +} + +export class CustomResponseParams { + /** + * Specifies the path to the error message in the response from the custom service. + * For example: + * ``` + * "response": { + * "error_parser": { + * "path": "$.error.message" + * } + * } + * ``` + */ + error_parser: object + /** + * Specifies the JSON parser that is used to parse the response from the custom service. + * Different task types require different json_parser parameters. + * For example: + * ``` + * # text_embedding + * "response":{ + * "json_parser":{ + * "text_embeddings":"$.result.embeddings[*].embedding" + * } + * } + * + * # sparse_embedding + * "response":{ + * "json_parser":{ + * "token_path":"$.result[*].embeddings[*].token", + * "weight_path":"$.result[*].embeddings[*].weight" + * } + * } + * + * # rerank + * "response":{ + * "json_parser":{ + * "reranked_index":"$.result.scores[*].index", // optional + * "relevance_score":"$.result.scores[*].score", + * "document_text":"xxx" // optional + * } + * } + * + * # completion + * "response":{ + * "json_parser":{ + * "completion_result":"$.result.text" + * } + * } + */ + json_parser: object +} + +export enum CustomTaskType { + text_embedding, + sparse_embedding, + rerank, + completion +} + +export enum CustomServiceType { + custom +} + +export class CustomTaskSettings { + /** + * Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses. + * For example: + * ``` + * "task_settings":{ + * "parameters":{ + * "input_type":"query", + * "return_token":true + * } + * } + * ``` + */ + parameters?: object +} + export class EisServiceSettings { /** * The name of the model to use for the inference task. diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts index e69de29bb2..f1cbe279ab 100644 --- a/specification/inference/put_custom/PutCustomRequest.ts +++ b/specification/inference/put_custom/PutCustomRequest.ts @@ -0,0 +1,78 @@ +/* + * Licensed to Elasticsearch B.V. under one or more contributor + * license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright + * ownership. Elasticsearch B.V. licenses this file to you under + * the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { RequestBase } from '@_types/Base' +import { Id } from '@_types/common' +import { + CustomServiceSettings, + CustomServiceType, + CustomTaskSettings, + CustomTaskType +} from '@inference/_types/CommonTypes' +import { InferenceChunkingSettings } from '@inference/_types/Services' + +/** + * Create a custom inference endpoint. + * + * You can create an inference endpoint to perform an inference task with a custom model that supports the HTTP format. + * @rest_spec_name inference.put_custom + * @availability stack since=8.13.0 stability=stable visibility=public + * @availability serverless stability=stable visibility=public + * @cluster_privileges manage_inference + * @doc_id inference-api-put-custom + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_inference/{task_type}/{custom_inference_id}' + methods: ['PUT'] + } + ] + path_parts: { + /** + * The type of the inference task that the model will perform. + */ + task_type: CustomTaskType + /** + * The unique identifier of the inference endpoint. + */ + custom_inference_id: Id + } + body: { + /** + * The chunking configuration object. + * @ext_doc_id inference-chunking + */ + chunking_settings?: InferenceChunkingSettings + /** + * The type of service supported for the specified task type. In this case, `custom`. + */ + service: CustomServiceType + /** + * Settings used to install the inference model. + * These settings are specific to the `custom` service. + */ + service_settings: CustomServiceSettings + /** + * Settings to configure the inference task. + * These settings are specific to the task type you specified. + */ + task_settings?: CustomTaskSettings + } +} \ No newline at end of file From 3c4eb3f703ddecf2654e6b17e12386dff5f5c0bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 14:44:55 +0200 Subject: [PATCH 04/17] Fixes code style. --- specification/inference/_types/CommonTypes.ts | 10 +++++----- specification/inference/put_custom/PutCustomRequest.ts | 2 +- .../inference/put_custom/PutCustomResponse.ts | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index bd3482bcb2..17cc8c6291 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -807,7 +807,7 @@ export class CustomRequestParams { * > The content string needs to be a single line except using the Kibana console. */ content: string -} +} export class CustomResponseParams { /** @@ -822,7 +822,7 @@ export class CustomResponseParams { * ``` */ error_parser: object - /** + /** * Specifies the JSON parser that is used to parse the response from the custom service. * Different task types require different json_parser parameters. * For example: @@ -833,7 +833,7 @@ export class CustomResponseParams { * "text_embeddings":"$.result.embeddings[*].embedding" * } * } - * + * * # sparse_embedding * "response":{ * "json_parser":{ @@ -841,7 +841,7 @@ export class CustomResponseParams { * "weight_path":"$.result[*].embeddings[*].weight" * } * } - * + * * # rerank * "response":{ * "json_parser":{ @@ -850,7 +850,7 @@ export class CustomResponseParams { * "document_text":"xxx" // optional * } * } - * + * * # completion * "response":{ * "json_parser":{ diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts index f1cbe279ab..fab798391a 100644 --- a/specification/inference/put_custom/PutCustomRequest.ts +++ b/specification/inference/put_custom/PutCustomRequest.ts @@ -75,4 +75,4 @@ export interface Request extends RequestBase { */ task_settings?: CustomTaskSettings } -} \ No newline at end of file +} diff --git a/specification/inference/put_custom/PutCustomResponse.ts b/specification/inference/put_custom/PutCustomResponse.ts index b691dd00c3..c09467c944 100644 --- a/specification/inference/put_custom/PutCustomResponse.ts +++ b/specification/inference/put_custom/PutCustomResponse.ts @@ -22,4 +22,4 @@ import { InferenceEndpointInfoCustom } from '@inference/_types/Services' export class Response { /** @codegen_name endpoint_info */ body: InferenceEndpointInfoCustom -} \ No newline at end of file +} From bc663289e07b072be2d5c6eae19da47caeed6faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 15:01:15 +0200 Subject: [PATCH 05/17] Fixes data type. --- specification/inference/_types/CommonTypes.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index 17cc8c6291..c4799c1705 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -769,7 +769,7 @@ export class CustomServiceSettings { * } * ``` */ - headers?: object + headers?: UserDefinedValue /** * The request configuration object. */ @@ -787,7 +787,7 @@ export class CustomServiceSettings { * } * ``` */ - secret_parameters: object + secret_parameters: UserDefinedValue /** * The URL endpoint to use for the requests. */ @@ -821,7 +821,7 @@ export class CustomResponseParams { * } * ``` */ - error_parser: object + error_parser: UserDefinedValue /** * Specifies the JSON parser that is used to parse the response from the custom service. * Different task types require different json_parser parameters. @@ -858,7 +858,7 @@ export class CustomResponseParams { * } * } */ - json_parser: object + json_parser: UserDefinedValue } export enum CustomTaskType { @@ -885,7 +885,7 @@ export class CustomTaskSettings { * } * ``` */ - parameters?: object + parameters?: UserDefinedValue } export class EisServiceSettings { From 1b3fe33579ed42cd08eadbf43ca86f8c28423c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 15:58:29 +0200 Subject: [PATCH 06/17] Adds json_spec. --- .../_json_spec/inference.put_custom.json | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 specification/_json_spec/inference.put_custom.json diff --git a/specification/_json_spec/inference.put_custom.json b/specification/_json_spec/inference.put_custom.json new file mode 100644 index 0000000000..a006e60e56 --- /dev/null +++ b/specification/_json_spec/inference.put_custom.json @@ -0,0 +1,35 @@ +{ + "inference.put_cohere": { + "documentation": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-custom.html", + "description": "Configure a custom inference endpoint" + }, + "stability": "stable", + "visibility": "public", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_inference/{task_type}/{custom_inference_id}", + "methods": ["PUT"], + "parts": { + "task_type": { + "type": "string", + "description": "The task type" + }, + "custom_inference_id": { + "type": "string", + "description": "The inference Id" + } + } + } + ] + }, + "body": { + "description": "The inference endpoint's task and service settings" + } + } + } \ No newline at end of file From fab50c4400264781f4b2c0479fd44cda1b968e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 16:00:42 +0200 Subject: [PATCH 07/17] Fixes typo. --- specification/_json_spec/inference.put_custom.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/_json_spec/inference.put_custom.json b/specification/_json_spec/inference.put_custom.json index a006e60e56..d3a92937f2 100644 --- a/specification/_json_spec/inference.put_custom.json +++ b/specification/_json_spec/inference.put_custom.json @@ -1,5 +1,5 @@ { - "inference.put_cohere": { + "inference.put_custom": { "documentation": { "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-custom.html", "description": "Configure a custom inference endpoint" From e185149edcc5ac457559a033659f0220fa33d3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 16:36:27 +0200 Subject: [PATCH 08/17] Adds doc_id to the table.csv file. --- specification/_doc_ids/table.csv | 1 + specification/_json_spec/inference.put_custom.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index d1a95d8747..d1606d1e33 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -356,6 +356,7 @@ inference-api-put-anthropic,https://www.elastic.co/docs/api/doc/elasticsearch/op inference-api-put-azureaistudio,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureaistudio,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-azure-ai-studio.html, inference-api-put-azureopenai,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-azureopenai,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-azure-openai.html, inference-api-put-cohere,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-cohere,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-cohere.html, +inference-api-put-custom,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom,https://www.elastic.co/guide/en/elasticsearch/reference/8.19/infer-service-custom.html, inference-api-put-deepseek,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-deepseek,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-deepseek.html, inference-api-put-eis,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-eis,, inference-api-put-elasticsearch,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-elasticsearch,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/infer-service-elasticsearch.html, diff --git a/specification/_json_spec/inference.put_custom.json b/specification/_json_spec/inference.put_custom.json index d3a92937f2..dc9df4bea4 100644 --- a/specification/_json_spec/inference.put_custom.json +++ b/specification/_json_spec/inference.put_custom.json @@ -1,7 +1,7 @@ { "inference.put_custom": { "documentation": { - "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/infer-service-custom.html", + "url": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom", "description": "Configure a custom inference endpoint" }, "stability": "stable", From 80510830795a4a4a962bd96dee89f3b19c44d84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Wed, 9 Jul 2025 17:48:54 +0200 Subject: [PATCH 09/17] Makes it prettier. --- .../_json_spec/inference.put_custom.json | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/specification/_json_spec/inference.put_custom.json b/specification/_json_spec/inference.put_custom.json index dc9df4bea4..c12108683d 100644 --- a/specification/_json_spec/inference.put_custom.json +++ b/specification/_json_spec/inference.put_custom.json @@ -1,35 +1,35 @@ { - "inference.put_custom": { - "documentation": { - "url": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom", - "description": "Configure a custom inference endpoint" - }, - "stability": "stable", - "visibility": "public", - "headers": { - "accept": ["application/json"], - "content_type": ["application/json"] - }, - "url": { - "paths": [ - { - "path": "/_inference/{task_type}/{custom_inference_id}", - "methods": ["PUT"], - "parts": { - "task_type": { - "type": "string", - "description": "The task type" - }, - "custom_inference_id": { - "type": "string", - "description": "The inference Id" - } + "inference.put_custom": { + "documentation": { + "url": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom", + "description": "Configure a custom inference endpoint" + }, + "stability": "stable", + "visibility": "public", + "headers": { + "accept": ["application/json"], + "content_type": ["application/json"] + }, + "url": { + "paths": [ + { + "path": "/_inference/{task_type}/{custom_inference_id}", + "methods": ["PUT"], + "parts": { + "task_type": { + "type": "string", + "description": "The task type" + }, + "custom_inference_id": { + "type": "string", + "description": "The inference Id" } } - ] - }, - "body": { - "description": "The inference endpoint's task and service settings" - } + } + ] + }, + "body": { + "description": "The inference endpoint's task and service settings" } - } \ No newline at end of file + } +} From e0963ae109b6ce36ec5f064f1312d2b798a9d378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Thu, 10 Jul 2025 13:38:25 +0200 Subject: [PATCH 10/17] Adds examples. --- .../examples/PutCustomRequestExample1.yaml | 24 ++++++++++++++ .../examples/PutCustomRequestExample2.yaml | 25 +++++++++++++++ .../examples/PutCustomRequestExample3.yaml | 31 +++++++++++++++++++ .../examples/PutCustomRequestExample4.yaml | 25 +++++++++++++++ .../examples/PutCustomRequestExample5.yaml | 24 ++++++++++++++ 5 files changed, 129 insertions(+) create mode 100644 specification/inference/put_custom/examples/PutCustomRequestExample1.yaml create mode 100644 specification/inference/put_custom/examples/PutCustomRequestExample2.yaml create mode 100644 specification/inference/put_custom/examples/PutCustomRequestExample3.yaml create mode 100644 specification/inference/put_custom/examples/PutCustomRequestExample4.yaml create mode 100644 specification/inference/put_custom/examples/PutCustomRequestExample5.yaml diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml new file mode 100644 index 0000000000..c042c109dd --- /dev/null +++ b/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml @@ -0,0 +1,24 @@ +summary: Custom text embedding task (OpenAI) +description: Run `PUT _inference/text_embedding/custom-embeddings` to create an inference endpoint that performs a text embedding task. +method_request: 'PUT _inference/text_embedding/custom-embeddings' +# type: "request" +value: |- + { + "service": "custom", + "service_settings": { + "secret_parameters": { + "api_key": "" + }, + "url": "https://api.openai.com/v1/embeddings", + "headers": { + "Authorization": "Bearer ${api_key}", + "Content-Type": "application/json;charset=utf-8" + }, + "request": "{\"input\": ${input}, \"model\": \"text-embedding-3-small\"}", + "response": { + "json_parser": { + "text_embeddings": "$.data[*].embedding[*]" + } + } + } + } \ No newline at end of file diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample2.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample2.yaml new file mode 100644 index 0000000000..1fb61b58c1 --- /dev/null +++ b/specification/inference/put_custom/examples/PutCustomRequestExample2.yaml @@ -0,0 +1,25 @@ +summary: Custom rerank task (Cohere APIv2) +description: Run `PUT _inference/rerank/custom-rerank` to create an inference endpoint that performs a rerank task. +method_request: 'PUT _inference/rerank/custom-rerank' +# type: "request" +value: |- + { + "service": "custom", + "service_settings": { + "secret_parameters": { + "api_key": "" + }, + "url": "https://api.cohere.com/v2/rerank", + "headers": { + "Authorization": "bearer ${api_key}", + "Content-Type": "application/json" + }, + "request": "{\"documents\": ${input}, \"query\": ${query}, \"model\": \"rerank-v3.5\"}", + "response": { + "json_parser": { + "reranked_index":"$.results[*].index", + "relevance_score":"$.results[*].relevance_score" + } + } + } + } diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml new file mode 100644 index 0000000000..e5d4f35ed8 --- /dev/null +++ b/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml @@ -0,0 +1,31 @@ +summary: Custom text embedding task (Cohere APIv2) +description: Run `PUT _inference/text_embedding/custom-text-embedding` to create an inference endpoint that performs a text embedding task. +method_request: 'PUT _inference/text_embedding/custom-text-embedding' +# type: "request" +value: |- + { + "service": "custom", + "service_settings": { + "secret_parameters": { + "api_key": "" + }, + "url": "https://api.cohere.com/v2/embed", + "headers": { + "Authorization": "bearer ${api_key}", + "Content-Type": "application/json" + }, + "request": "{\"texts\": ${input}, \"model\": \"embed-v4.0\", \"input_type\": ${input_type}}", + "response": { + "json_parser": { + "text_embeddings":"$.embeddings.float[*]" + } + }, + "input_type": { + "translation": { + "ingest": "search_document", + "search": "search_query" + }, + "default": "search_document" + } + } + } \ No newline at end of file diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml new file mode 100644 index 0000000000..2a754d342d --- /dev/null +++ b/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml @@ -0,0 +1,25 @@ +summary: Custom rerank task (Jina AI) +description: Run `PUT _inference/rerank/custom-rerank-jina` to create an inference endpoint that performs a rerank task. +method_request: 'PUT _inference/rerank/custom-rerank-jina' +# type: "request" +value: |- + { + "service": "custom", + "service_settings": { + "secret_parameters": { + "api_key": "" + }, + "url": "https://api.jina.ai/v1/rerank", + "headers": { + "Content-Type": "application/json", + "Authorization": "Bearer ${api_key}" + }, + "request": "{\"model\": \"jina-reranker-v2-base-multilingual\",\"query\": ${query},\"documents\":${input}}", + "response": { + "json_parser": { + "relevance_score": "$.results[*].relevance_score", + "reranked_index": "$.results[*].index" + } + } + } + } \ No newline at end of file diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml new file mode 100644 index 0000000000..427c92927d --- /dev/null +++ b/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml @@ -0,0 +1,24 @@ +summary: Custom text embedding task (Hugging Face) +description: Run `PUT _inference/text_embedding/custom-text-embedding-hf` to create an inference endpoint that performs a text embedding task by using the Qwen/Qwen3-Embedding-8B model. +method_request: 'PUT _inference/text_embedding/custom-text-embedding-hf' +# type: "request" +value: |- + { + "service": "custom", + "service_settings": { + "secret_parameters": { + "api_key": "" + }, + "url": "/v1/embeddings", + "headers": { + "Authorization": "Bearer ${api_key}", + "Content-Type": "application/json" + }, + "request": "{\"input\": ${input}}", + "response": { + "json_parser": { + "text_embeddings":"$.data[*].embedding[*]" + } + } + } + } \ No newline at end of file From d568234476db26ac2b720864c86d4dd9aa5923eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Thu, 10 Jul 2025 13:40:44 +0200 Subject: [PATCH 11/17] Format fix. --- .../inference/put_custom/examples/PutCustomRequestExample1.yaml | 2 +- .../inference/put_custom/examples/PutCustomRequestExample3.yaml | 2 +- .../inference/put_custom/examples/PutCustomRequestExample4.yaml | 2 +- .../inference/put_custom/examples/PutCustomRequestExample5.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml index c042c109dd..dabe71ed86 100644 --- a/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml +++ b/specification/inference/put_custom/examples/PutCustomRequestExample1.yaml @@ -21,4 +21,4 @@ value: |- } } } - } \ No newline at end of file + } diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml index e5d4f35ed8..70e5609051 100644 --- a/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml +++ b/specification/inference/put_custom/examples/PutCustomRequestExample3.yaml @@ -28,4 +28,4 @@ value: |- "default": "search_document" } } - } \ No newline at end of file + } diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml index 2a754d342d..4ecaaf020b 100644 --- a/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml +++ b/specification/inference/put_custom/examples/PutCustomRequestExample4.yaml @@ -22,4 +22,4 @@ value: |- } } } - } \ No newline at end of file + } diff --git a/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml b/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml index 427c92927d..c9f86dad8d 100644 --- a/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml +++ b/specification/inference/put_custom/examples/PutCustomRequestExample5.yaml @@ -21,4 +21,4 @@ value: |- } } } - } \ No newline at end of file + } From b4c99e61322432f1ccd17c0976f22998165ca983 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 21 Jul 2025 12:00:33 +0200 Subject: [PATCH 12/17] Addresses feedback. --- specification/inference/_types/CommonTypes.ts | 16 +--------------- .../inference/put_custom/PutCustomRequest.ts | 3 ++- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index c4799c1705..867cfbb243 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -799,9 +799,7 @@ export class CustomRequestParams { * The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body. * For example: * ``` - * "request":{ - * "content":"{\"input\":${input}}" - * } + * "request": "{\"input\":${input}}" * ``` * > info * > The content string needs to be a single line except using the Kibana console. @@ -810,18 +808,6 @@ export class CustomRequestParams { } export class CustomResponseParams { - /** - * Specifies the path to the error message in the response from the custom service. - * For example: - * ``` - * "response": { - * "error_parser": { - * "path": "$.error.message" - * } - * } - * ``` - */ - error_parser: UserDefinedValue /** * Specifies the JSON parser that is used to parse the response from the custom service. * Different task types require different json_parser parameters. diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts index fab798391a..8c19e2a72c 100644 --- a/specification/inference/put_custom/PutCustomRequest.ts +++ b/specification/inference/put_custom/PutCustomRequest.ts @@ -30,7 +30,8 @@ import { InferenceChunkingSettings } from '@inference/_types/Services' /** * Create a custom inference endpoint. * - * You can create an inference endpoint to perform an inference task with a custom model that supports the HTTP format. + * The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations. + * The custom service gives you the ability to define the headers, url, query parameters, request body, and secrets. * @rest_spec_name inference.put_custom * @availability stack since=8.13.0 stability=stable visibility=public * @availability serverless stability=stable visibility=public From 9dfe0ef20b38dc11304facb8e1c77d4f11a144f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 21 Jul 2025 12:28:19 +0200 Subject: [PATCH 13/17] Adds more parameters and explanations. --- specification/inference/_types/CommonTypes.ts | 11 ++++++ .../inference/put_custom/PutCustomRequest.ts | 38 +++++++++++++++++++ 2 files changed, 49 insertions(+) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index 867cfbb243..1cee460070 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -770,6 +770,17 @@ export class CustomServiceSettings { * ``` */ headers?: UserDefinedValue + /** + * Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value. + * For example: + * ``` + * "query_parameters":[ + * ["param_key", "some_value"], + * ["param_key", "another_value"] + * ] + * ``` + */ + query_parameters?: UserDefinedValue /** * The request configuration object. */ diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts index 8c19e2a72c..50dd302802 100644 --- a/specification/inference/put_custom/PutCustomRequest.ts +++ b/specification/inference/put_custom/PutCustomRequest.ts @@ -32,6 +32,44 @@ import { InferenceChunkingSettings } from '@inference/_types/Services' * * The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations. * The custom service gives you the ability to define the headers, url, query parameters, request body, and secrets. + * The custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the contents of a value that defines that key. + * Templates are portions of a string that start with `${` and end with `}`. + * The parameters `secret_parameters` and `task_settings` are checked for keys for template replacement. Template replacement is supported in the `request`, `headers`, `url`, and `query_parameters`. + * If the definition (key) is not found for a template, an error message is returned. + * In case of an endpoint definition like the following: + * ``` + * PUT _inference/text_embedding/test-text-embedding + * { + * "service": "custom", + * "service_settings": { + * "secret_parameters": { + * "api_key": "" + * }, + * "url": "...endpoints.huggingface.cloud/v1/embeddings", + * "headers": { + * "Authorization": "Bearer ${api_key}", + * "Content-Type": "application/json" + * }, + * "request": "{\"input\": ${input}}", + * "response": { + * "json_parser": { + * "text_embeddings":"$.data[*].embedding[*]" + * } + * } + * } + * } + * ``` + * To replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`. + * + * > info + * > Templates should not be surrounded by quotes. + * + * Pre-defined templates: + * * `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests. + * * `${input_type}` refers to the input type translation values. + * * `${query}` refers to the query field used specifically for reranking tasks. + * * `${top_n}` refers to the `top_n` field available when performing rerank requests. + * * `${return_documents}` refers to the `return_documents` field available when performing rerank requests. * @rest_spec_name inference.put_custom * @availability stack since=8.13.0 stability=stable visibility=public * @availability serverless stability=stable visibility=public From 3961f12c7226074b00f3ee3a058e318bbedbe959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 21 Jul 2025 14:14:29 +0200 Subject: [PATCH 14/17] Completes json_parser. --- specification/inference/_types/CommonTypes.ts | 108 +++++++++++++++++- 1 file changed, 104 insertions(+), 4 deletions(-) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index 1cee460070..4b07424f53 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -825,21 +825,97 @@ export class CustomResponseParams { * For example: * ``` * # text_embedding + * # For a response like this: + * + * { + * "object": "list", + * "data": [ + * { + * "object": "embedding", + * "index": 0, + * "embedding": [ + * 0.014539449, + * -0.015288644 + * ] + * } + * ], + * "model": "text-embedding-ada-002-v2", + * "usage": { + * "prompt_tokens": 8, + * "total_tokens": 8 + * } + * } + * + * # the json_parser definition should look like this: + * * "response":{ * "json_parser":{ - * "text_embeddings":"$.result.embeddings[*].embedding" + * "text_embeddings":"$.data[*].embedding[*]" * } * } * * # sparse_embedding + * # For a response like this: + * + * { + * "request_id": "75C50B5B-E79E-4930-****-F48DBB392231", + * "latency": 22, + * "usage": { + * "token_count": 11 + * }, + * "result": { + * "sparse_embeddings": [ + * { + * "index": 0, + * "embedding": [ + * { + * "token_id": 6, + * "weight": 0.101 + * }, + * { + * "token_id": 163040, + * "weight": 0.28417 + * } + * ] + * } + * ] + * } + * } + * + * # the json_parser definition should look like this: + * * "response":{ * "json_parser":{ - * "token_path":"$.result[*].embeddings[*].token", - * "weight_path":"$.result[*].embeddings[*].weight" + * "token_path":"$.result.sparse_embeddings[*].embedding[*].token_id", + * "weight_path":"$.result.sparse_embeddings[*].embedding[*].weight" * } * } * * # rerank + * # For a response like this: + * + * { + * "results": [ + * { + * "index": 3, + * "relevance_score": 0.999071, + * "document": "abc" + * }, + * { + * "index": 4, + * "relevance_score": 0.7867867, + * "document": "123" + * }, + * { + * "index": 0, + * "relevance_score": 0.32713068, + * "document": "super" + * } + * ], + * } + * + * # the json_parser definition should look like this: + * * "response":{ * "json_parser":{ * "reranked_index":"$.result.scores[*].index", // optional @@ -849,9 +925,33 @@ export class CustomResponseParams { * } * * # completion + * # For a response like this: + * + * { + * "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT", + * "object": "chat.completion", + * "created": 1741569952, + * "model": "gpt-4.1-2025-04-14", + * "choices": [ + * { + * "index": 0, + * "message": { + * "role": "assistant", + * "content": "Hello! How can I assist you today?", + * "refusal": null, + * "annotations": [] + * }, + * "logprobs": null, + * "finish_reason": "stop" + * } + * ] + * } + * + * # the json_parser definition should look like this: + * * "response":{ * "json_parser":{ - * "completion_result":"$.result.text" + * "completion_result":"$.choices[*].message.content" * } * } */ From a0baab6b32005ea6c8ead777485791314a00db24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 21 Jul 2025 14:51:33 +0200 Subject: [PATCH 15/17] Addresses feedback. --- specification/inference/_types/CommonTypes.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index 4b07424f53..e9525fa59f 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -770,6 +770,27 @@ export class CustomServiceSettings { * ``` */ headers?: UserDefinedValue + /** + * Specifies the input type translation values that are used to replace the `${input_type}` template in the request body. + * For example: + * ``` + * "input_type": { + * "translation": { + * "ingest": "do_ingest", + * "search": "do_search" + * }, + * "default": "a_default" + * }, + * ``` + * If the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`. + * If it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used. + * `transition` can be: + * * `classification` + * * `clustering` + * * `ingest` + * * `search` + */ + input_type?: UserDefinedValue /** * Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value. * For example: From d63c4d7329f8b3e5af5fe20e82b1bfee11918f86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 21 Jul 2025 14:52:37 +0200 Subject: [PATCH 16/17] Format fix. --- specification/inference/_types/CommonTypes.ts | 44 +++++++++---------- .../inference/put_custom/PutCustomRequest.ts | 4 +- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index e9525fa59f..215553bd0e 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -774,20 +774,20 @@ export class CustomServiceSettings { * Specifies the input type translation values that are used to replace the `${input_type}` template in the request body. * For example: * ``` - * "input_type": { - * "translation": { - * "ingest": "do_ingest", - * "search": "do_search" - * }, - * "default": "a_default" + * "input_type": { + * "translation": { + * "ingest": "do_ingest", + * "search": "do_search" + * }, + * "default": "a_default" * }, * ``` * If the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`. * If it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used. * `transition` can be: - * * `classification` - * * `clustering` - * * `ingest` + * * `classification` + * * `clustering` + * * `ingest` * * `search` */ input_type?: UserDefinedValue @@ -847,7 +847,7 @@ export class CustomResponseParams { * ``` * # text_embedding * # For a response like this: - * + * * { * "object": "list", * "data": [ @@ -866,9 +866,9 @@ export class CustomResponseParams { * "total_tokens": 8 * } * } - * + * * # the json_parser definition should look like this: - * + * * "response":{ * "json_parser":{ * "text_embeddings":"$.data[*].embedding[*]" @@ -877,7 +877,7 @@ export class CustomResponseParams { * * # sparse_embedding * # For a response like this: - * + * * { * "request_id": "75C50B5B-E79E-4930-****-F48DBB392231", * "latency": 22, @@ -902,9 +902,9 @@ export class CustomResponseParams { * ] * } * } - * + * * # the json_parser definition should look like this: - * + * * "response":{ * "json_parser":{ * "token_path":"$.result.sparse_embeddings[*].embedding[*].token_id", @@ -914,7 +914,7 @@ export class CustomResponseParams { * * # rerank * # For a response like this: - * + * * { * "results": [ * { @@ -934,9 +934,9 @@ export class CustomResponseParams { * } * ], * } - * - * # the json_parser definition should look like this: - * + * + * # the json_parser definition should look like this: + * * "response":{ * "json_parser":{ * "reranked_index":"$.result.scores[*].index", // optional @@ -947,7 +947,7 @@ export class CustomResponseParams { * * # completion * # For a response like this: - * + * * { * "id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT", * "object": "chat.completion", @@ -967,9 +967,9 @@ export class CustomResponseParams { * } * ] * } - * + * * # the json_parser definition should look like this: - * + * * "response":{ * "json_parser":{ * "completion_result":"$.choices[*].message.content" diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts index 50dd302802..80f7038fe1 100644 --- a/specification/inference/put_custom/PutCustomRequest.ts +++ b/specification/inference/put_custom/PutCustomRequest.ts @@ -60,10 +60,10 @@ import { InferenceChunkingSettings } from '@inference/_types/Services' * } * ``` * To replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`. - * + * * > info * > Templates should not be surrounded by quotes. - * + * * Pre-defined templates: * * `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests. * * `${input_type}` refers to the input type translation values. From 52c19aa3437ddf26b82b1512da38fe073aa088de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Zolt=C3=A1n=20Szab=C3=B3?= Date: Mon, 21 Jul 2025 17:15:22 +0200 Subject: [PATCH 17/17] Addresses more feedback. --- specification/inference/_types/CommonTypes.ts | 8 +++++--- specification/inference/put_custom/PutCustomRequest.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/specification/inference/_types/CommonTypes.ts b/specification/inference/_types/CommonTypes.ts index f533423f4b..4941cb9210 100644 --- a/specification/inference/_types/CommonTypes.ts +++ b/specification/inference/_types/CommonTypes.ts @@ -782,7 +782,7 @@ export class CustomServiceSettings { * ``` * If the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`. * If it comes from the ingest context `do_ingest` is used. If it's a different context that is not specified, the default value will be used. If no default is specified an empty string is used. - * `transition` can be: + * `translation` can be: * * `classification` * * `clustering` * * `ingest` @@ -795,9 +795,11 @@ export class CustomServiceSettings { * ``` * "query_parameters":[ * ["param_key", "some_value"], - * ["param_key", "another_value"] + * ["param_key", "another_value"], + * ["other_key", "other_value"] * ] * ``` + * If the base url is `https://www.elastic.co` it results in: `https://www.elastic.co?param_key=some_value¶m_key=another_value&other_key=other_value`. */ query_parameters?: UserDefinedValue /** @@ -832,7 +834,7 @@ export class CustomRequestParams { * "request": "{\"input\":${input}}" * ``` * > info - * > The content string needs to be a single line except using the Kibana console. + * > The content string needs to be a single line except when using the Kibana console. */ content: string } diff --git a/specification/inference/put_custom/PutCustomRequest.ts b/specification/inference/put_custom/PutCustomRequest.ts index 80f7038fe1..04d1e056a8 100644 --- a/specification/inference/put_custom/PutCustomRequest.ts +++ b/specification/inference/put_custom/PutCustomRequest.ts @@ -32,7 +32,7 @@ import { InferenceChunkingSettings } from '@inference/_types/Services' * * The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations. * The custom service gives you the ability to define the headers, url, query parameters, request body, and secrets. - * The custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the contents of a value that defines that key. + * The custom service supports the template replacement functionality, which enables you to define a template that can be replaced with the value associated with that key. * Templates are portions of a string that start with `${` and end with `}`. * The parameters `secret_parameters` and `task_settings` are checked for keys for template replacement. Template replacement is supported in the `request`, `headers`, `url`, and `query_parameters`. * If the definition (key) is not found for a template, an error message is returned.