From c7826602c118f5dc101e11e7129f885d5d6daaf2 Mon Sep 17 00:00:00 2001 From: ketkee-aryamane Date: Tue, 22 Jul 2025 20:42:21 +0200 Subject: [PATCH 1/2] Update transform example update (#4998) Co-authored-by: lcawl (cherry picked from commit 9d40112d30f06edfb26d7f852272f10cafceacf5) --- .../UpdateTransformRequestExample1.yaml | 55 +++++++++---------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/specification/transform/update_transform/examples/request/UpdateTransformRequestExample1.yaml b/specification/transform/update_transform/examples/request/UpdateTransformRequestExample1.yaml index 03d19e5da9..7d3f85d99a 100644 --- a/specification/transform/update_transform/examples/request/UpdateTransformRequestExample1.yaml +++ b/specification/transform/update_transform/examples/request/UpdateTransformRequestExample1.yaml @@ -2,33 +2,28 @@ method_request: POST _transform/simple-kibana-ecomm-pivot/_update description: Run `POST _transform/simple-kibana-ecomm-pivot/_update` to update a transform that uses the pivot method. # type: request -value: - source: - index: kibana_sample_data_ecommerce - query: - term: - geoip.continent_name: - value: Asia - pivot: - group_by: - customer_id: - terms: - field: customer_id - missing_bucket: true - aggregations: - max_price: - max: - field: taxful_total_price - description: Maximum priced ecommerce data by customer_id in Asia - dest: - index: kibana_sample_data_ecommerce_transform1 - pipeline: add_timestamp_pipeline - frequency: 5m - sync: - time: - field: order_date - delay: 60s - retention_policy: - time: - field: order_date - max_age: 30d +value: |- + { + "source": { + "index": "kibana_sample_data_ecommerce", + "query": { + "term": { + "geoip.continent_name": { + "value": "Asia" + } + } + } + }, + "description": "Maximum priced ecommerce data by customer_id in Asia", + "dest": { + "index": "kibana_sample_data_ecommerce_transform_v2", + "pipeline": "add_timestamp_pipeline" + }, + "frequency": "15m", + "sync": { + "time": { + "field": "order_date", + "delay": "120s" + } + } + } From 82d7053f788cab29ff89d3216c0ae23d7f4be749 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 22 Jul 2025 11:59:49 -0700 Subject: [PATCH 2/2] Generate output --- output/openapi/elasticsearch-openapi.json | 210 +++++- .../elasticsearch-serverless-openapi.json | 210 +++++- output/schema/schema.json | 636 +++++++++++++++--- output/typescript/types.ts | 49 +- 4 files changed, 990 insertions(+), 115 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 21aaef4c9d..30702ac97b 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -21187,6 +21187,11 @@ "summary": "A rerank task", "description": "Run `PUT _inference/rerank/cohere-rerank` to create an inference endpoint that performs a rerank task.", "value": "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" + }, + "PutCohereRequestExample3": { + "summary": "A completion task", + "description": "Run `PUT _inference/completion/cohere-completion` to create an inference endpoint that performs a completion task.", + "value": "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n}" } } } @@ -21213,6 +21218,86 @@ ] } }, + "/_inference/{task_type}/{custom_inference_id}": { + "put": { + "tags": [ + "inference" + ], + "summary": "Create a custom inference endpoint", + "description": "The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations.\nThe custom service gives you the ability to define the headers, url, query parameters, request body, and secrets.\nThe 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.\nTemplates are portions of a string that start with `${` and end with `}`.\nThe 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`.\nIf the definition (key) is not found for a template, an error message is returned.\nIn case of an endpoint definition like the following:\n```\nPUT _inference/text_embedding/test-text-embedding\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"...endpoints.huggingface.cloud/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}\n```\nTo replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`.\n\n> info\n> Templates should not be surrounded by quotes.\n\nPre-defined templates:\n* `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests.\n* `${input_type}` refers to the input type translation values.\n* `${query}` refers to the query field used specifically for reranking tasks.\n* `${top_n}` refers to the `top_n` field available when performing rerank requests.\n* `${return_documents}` refers to the `return_documents` field available when performing rerank requests.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n", + "operationId": "inference-put-custom", + "parameters": [ + { + "in": "path", + "name": "task_type", + "description": "The type of the inference task that the model will perform.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/inference._types.CustomTaskType" + }, + "style": "simple" + }, + { + "in": "path", + "name": "custom_inference_id", + "description": "The unique identifier of the inference endpoint.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chunking_settings": { + "$ref": "#/components/schemas/inference._types.InferenceChunkingSettings" + }, + "service": { + "$ref": "#/components/schemas/inference._types.CustomServiceType" + }, + "service_settings": { + "$ref": "#/components/schemas/inference._types.CustomServiceSettings" + }, + "task_settings": { + "$ref": "#/components/schemas/inference._types.CustomTaskSettings" + } + }, + "required": [ + "service", + "service_settings" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inference._types.InferenceEndpointInfoCustom" + } + } + } + } + }, + "x-state": "Generally available; Added in 8.13.0", + "x-metaTags": [ + { + "content": "elasticsearch, machine-learning", + "name": "x-product-feature" + } + ] + } + }, "/_inference/{task_type}/{deepseek_inference_id}": { "put": { "tags": [ @@ -48239,7 +48324,7 @@ "examples": { "UpdateTransformRequestExample1": { "description": "Run `POST _transform/simple-kibana-ecomm-pivot/_update` to update a transform that uses the pivot method.", - "value": "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" + "value": "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n}" } } } @@ -52989,7 +53074,12 @@ "$ref": "#/components/schemas/_types.aggregations.MultiBucketBase" }, { - "type": "object" + "type": "object", + "properties": { + "key": { + "type": "string" + } + } } ] }, @@ -88863,6 +88953,122 @@ "completion" ] }, + "inference._types.CustomTaskType": { + "type": "string", + "enum": [ + "text_embedding", + "sparse_embedding", + "rerank", + "completion" + ] + }, + "inference._types.CustomServiceType": { + "type": "string", + "enum": [ + "custom" + ] + }, + "inference._types.CustomServiceSettings": { + "type": "object", + "properties": { + "headers": { + "description": "Specifies the HTTPS header parameters – such as `Authentication` or `Contet-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\":{\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", + "type": "object" + }, + "input_type": { + "description": "Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n\"input_type\": {\n \"translation\": {\n \"ingest\": \"do_ingest\",\n \"search\": \"do_search\"\n },\n \"default\": \"a_default\"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf 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.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`", + "type": "object" + }, + "query_parameters": { + "description": "Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n\"query_parameters\":[\n [\"param_key\", \"some_value\"],\n [\"param_key\", \"another_value\"],\n [\"other_key\", \"other_value\"]\n]\n```\nIf 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`.", + "type": "object" + }, + "request": { + "$ref": "#/components/schemas/inference._types.CustomRequestParams" + }, + "response": { + "$ref": "#/components/schemas/inference._types.CustomResponseParams" + }, + "secret_parameters": { + "description": "Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n\"secret_parameters\":{\n \"api_key\":\"\"\n}\n```", + "type": "object" + }, + "url": { + "description": "The URL endpoint to use for the requests.", + "type": "string" + } + }, + "required": [ + "request", + "response", + "secret_parameters" + ] + }, + "inference._types.CustomRequestParams": { + "type": "object", + "properties": { + "content": { + "description": "The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.\nFor example:\n```\n\"request\": \"{\\\"input\\\":${input}}\"\n```\n> info\n> The content string needs to be a single line except when using the Kibana console.", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "inference._types.CustomResponseParams": { + "type": "object", + "properties": { + "json_parser": { + "description": "Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"index\": 0,\n \"embedding\": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n \"model\": \"text-embedding-ada-002-v2\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n}\n\n# sparse_embedding\n# For a response like this:\n\n{\n \"request_id\": \"75C50B5B-E79E-4930-****-F48DBB392231\",\n \"latency\": 22,\n \"usage\": {\n \"token_count\": 11\n },\n \"result\": {\n \"sparse_embeddings\": [\n {\n \"index\": 0,\n \"embedding\": [\n {\n \"token_id\": 6,\n \"weight\": 0.101\n },\n {\n \"token_id\": 163040,\n \"weight\": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"token_path\":\"$.result.sparse_embeddings[*].embedding[*].token_id\",\n \"weight_path\":\"$.result.sparse_embeddings[*].embedding[*].weight\"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n \"results\": [\n {\n \"index\": 3,\n \"relevance_score\": 0.999071,\n \"document\": \"abc\"\n },\n {\n \"index\": 4,\n \"relevance_score\": 0.7867867,\n \"document\": \"123\"\n },\n {\n \"index\": 0,\n \"relevance_score\": 0.32713068,\n \"document\": \"super\"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"reranked_index\":\"$.result.scores[*].index\", // optional\n \"relevance_score\":\"$.result.scores[*].score\",\n \"document_text\":\"xxx\" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"completion_result\":\"$.choices[*].message.content\"\n }\n}", + "type": "object" + } + }, + "required": [ + "json_parser" + ] + }, + "inference._types.CustomTaskSettings": { + "type": "object", + "properties": { + "parameters": { + "description": "Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n\"task_settings\":{\n \"parameters\":{\n \"input_type\":\"query\",\n \"return_token\":true\n }\n}\n```", + "type": "object" + } + } + }, + "inference._types.InferenceEndpointInfoCustom": { + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.InferenceEndpoint" + }, + { + "type": "object", + "properties": { + "inference_id": { + "description": "The inference Id", + "type": "string" + }, + "task_type": { + "$ref": "#/components/schemas/inference._types.TaskTypeCustom" + } + }, + "required": [ + "inference_id", + "task_type" + ] + } + ] + }, + "inference._types.TaskTypeCustom": { + "type": "string", + "enum": [ + "text_embedding", + "sparse_embedding", + "rerank", + "completion" + ] + }, "inference._types.TaskTypeDeepSeek": { "type": "string", "enum": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index c01c8cb5b1..9e31108b5e 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -12006,6 +12006,11 @@ "summary": "A rerank task", "description": "Run `PUT _inference/rerank/cohere-rerank` to create an inference endpoint that performs a rerank task.", "value": "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" + }, + "PutCohereRequestExample3": { + "summary": "A completion task", + "description": "Run `PUT _inference/completion/cohere-completion` to create an inference endpoint that performs a completion task.", + "value": "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n}" } } } @@ -12032,6 +12037,86 @@ ] } }, + "/_inference/{task_type}/{custom_inference_id}": { + "put": { + "tags": [ + "inference" + ], + "summary": "Create a custom inference endpoint", + "description": "The custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations.\nThe custom service gives you the ability to define the headers, url, query parameters, request body, and secrets.\nThe 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.\nTemplates are portions of a string that start with `${` and end with `}`.\nThe 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`.\nIf the definition (key) is not found for a template, an error message is returned.\nIn case of an endpoint definition like the following:\n```\nPUT _inference/text_embedding/test-text-embedding\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"...endpoints.huggingface.cloud/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}\n```\nTo replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`.\n\n> info\n> Templates should not be surrounded by quotes.\n\nPre-defined templates:\n* `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests.\n* `${input_type}` refers to the input type translation values.\n* `${query}` refers to the query field used specifically for reranking tasks.\n* `${top_n}` refers to the `top_n` field available when performing rerank requests.\n* `${return_documents}` refers to the `return_documents` field available when performing rerank requests.\n\n## Required authorization\n\n* Cluster privileges: `manage_inference`\n", + "operationId": "inference-put-custom", + "parameters": [ + { + "in": "path", + "name": "task_type", + "description": "The type of the inference task that the model will perform.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/inference._types.CustomTaskType" + }, + "style": "simple" + }, + { + "in": "path", + "name": "custom_inference_id", + "description": "The unique identifier of the inference endpoint.", + "required": true, + "deprecated": false, + "schema": { + "$ref": "#/components/schemas/_types.Id" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "chunking_settings": { + "$ref": "#/components/schemas/inference._types.InferenceChunkingSettings" + }, + "service": { + "$ref": "#/components/schemas/inference._types.CustomServiceType" + }, + "service_settings": { + "$ref": "#/components/schemas/inference._types.CustomServiceSettings" + }, + "task_settings": { + "$ref": "#/components/schemas/inference._types.CustomTaskSettings" + } + }, + "required": [ + "service", + "service_settings" + ] + } + } + } + }, + "responses": { + "200": { + "description": "", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/inference._types.InferenceEndpointInfoCustom" + } + } + } + } + }, + "x-state": "Generally available", + "x-metaTags": [ + { + "content": "elasticsearch, machine-learning", + "name": "x-product-feature" + } + ] + } + }, "/_inference/{task_type}/{deepseek_inference_id}": { "put": { "tags": [ @@ -26220,7 +26305,7 @@ "examples": { "UpdateTransformRequestExample1": { "description": "Run `POST _transform/simple-kibana-ecomm-pivot/_update` to update a transform that uses the pivot method.", - "value": "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" + "value": "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n}" } } } @@ -29645,7 +29730,12 @@ "$ref": "#/components/schemas/_types.aggregations.MultiBucketBase" }, { - "type": "object" + "type": "object", + "properties": { + "key": { + "type": "string" + } + } } ] }, @@ -56209,6 +56299,122 @@ "completion" ] }, + "inference._types.CustomTaskType": { + "type": "string", + "enum": [ + "text_embedding", + "sparse_embedding", + "rerank", + "completion" + ] + }, + "inference._types.CustomServiceType": { + "type": "string", + "enum": [ + "custom" + ] + }, + "inference._types.CustomServiceSettings": { + "type": "object", + "properties": { + "headers": { + "description": "Specifies the HTTPS header parameters – such as `Authentication` or `Contet-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\":{\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", + "type": "object" + }, + "input_type": { + "description": "Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n\"input_type\": {\n \"translation\": {\n \"ingest\": \"do_ingest\",\n \"search\": \"do_search\"\n },\n \"default\": \"a_default\"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf 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.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`", + "type": "object" + }, + "query_parameters": { + "description": "Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n\"query_parameters\":[\n [\"param_key\", \"some_value\"],\n [\"param_key\", \"another_value\"],\n [\"other_key\", \"other_value\"]\n]\n```\nIf 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`.", + "type": "object" + }, + "request": { + "$ref": "#/components/schemas/inference._types.CustomRequestParams" + }, + "response": { + "$ref": "#/components/schemas/inference._types.CustomResponseParams" + }, + "secret_parameters": { + "description": "Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n\"secret_parameters\":{\n \"api_key\":\"\"\n}\n```", + "type": "object" + }, + "url": { + "description": "The URL endpoint to use for the requests.", + "type": "string" + } + }, + "required": [ + "request", + "response", + "secret_parameters" + ] + }, + "inference._types.CustomRequestParams": { + "type": "object", + "properties": { + "content": { + "description": "The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.\nFor example:\n```\n\"request\": \"{\\\"input\\\":${input}}\"\n```\n> info\n> The content string needs to be a single line except when using the Kibana console.", + "type": "string" + } + }, + "required": [ + "content" + ] + }, + "inference._types.CustomResponseParams": { + "type": "object", + "properties": { + "json_parser": { + "description": "Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"index\": 0,\n \"embedding\": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n \"model\": \"text-embedding-ada-002-v2\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n}\n\n# sparse_embedding\n# For a response like this:\n\n{\n \"request_id\": \"75C50B5B-E79E-4930-****-F48DBB392231\",\n \"latency\": 22,\n \"usage\": {\n \"token_count\": 11\n },\n \"result\": {\n \"sparse_embeddings\": [\n {\n \"index\": 0,\n \"embedding\": [\n {\n \"token_id\": 6,\n \"weight\": 0.101\n },\n {\n \"token_id\": 163040,\n \"weight\": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"token_path\":\"$.result.sparse_embeddings[*].embedding[*].token_id\",\n \"weight_path\":\"$.result.sparse_embeddings[*].embedding[*].weight\"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n \"results\": [\n {\n \"index\": 3,\n \"relevance_score\": 0.999071,\n \"document\": \"abc\"\n },\n {\n \"index\": 4,\n \"relevance_score\": 0.7867867,\n \"document\": \"123\"\n },\n {\n \"index\": 0,\n \"relevance_score\": 0.32713068,\n \"document\": \"super\"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"reranked_index\":\"$.result.scores[*].index\", // optional\n \"relevance_score\":\"$.result.scores[*].score\",\n \"document_text\":\"xxx\" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"completion_result\":\"$.choices[*].message.content\"\n }\n}", + "type": "object" + } + }, + "required": [ + "json_parser" + ] + }, + "inference._types.CustomTaskSettings": { + "type": "object", + "properties": { + "parameters": { + "description": "Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n\"task_settings\":{\n \"parameters\":{\n \"input_type\":\"query\",\n \"return_token\":true\n }\n}\n```", + "type": "object" + } + } + }, + "inference._types.InferenceEndpointInfoCustom": { + "allOf": [ + { + "$ref": "#/components/schemas/inference._types.InferenceEndpoint" + }, + { + "type": "object", + "properties": { + "inference_id": { + "description": "The inference Id", + "type": "string" + }, + "task_type": { + "$ref": "#/components/schemas/inference._types.TaskTypeCustom" + } + }, + "required": [ + "inference_id", + "task_type" + ] + } + ] + }, + "inference._types.TaskTypeCustom": { + "type": "string", + "enum": [ + "text_embedding", + "sparse_embedding", + "rerank", + "completion" + ] + }, "inference._types.TaskTypeDeepSeek": { "type": "string", "enum": [ diff --git a/output/schema/schema.json b/output/schema/schema.json index a01195dc83..aa588d2c31 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -10178,6 +10178,52 @@ } ] }, + { + "availability": { + "serverless": { + "stability": "stable", + "visibility": "public" + }, + "stack": { + "since": "8.13.0", + "stability": "stable", + "visibility": "public" + } + }, + "description": "Create a custom inference endpoint.\n\nThe custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations.\nThe custom service gives you the ability to define the headers, url, query parameters, request body, and secrets.\nThe 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.\nTemplates are portions of a string that start with `${` and end with `}`.\nThe 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`.\nIf the definition (key) is not found for a template, an error message is returned.\nIn case of an endpoint definition like the following:\n```\nPUT _inference/text_embedding/test-text-embedding\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"...endpoints.huggingface.cloud/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}\n```\nTo replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`.\n\n> info\n> Templates should not be surrounded by quotes.\n\nPre-defined templates:\n* `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests.\n* `${input_type}` refers to the input type translation values.\n* `${query}` refers to the query field used specifically for reranking tasks.\n* `${top_n}` refers to the `top_n` field available when performing rerank requests.\n* `${return_documents}` refers to the `return_documents` field available when performing rerank requests.", + "docId": "inference-api-put-custom", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put-custom", + "extPreviousVersionDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/8.19/infer-service-custom.html", + "name": "inference.put_custom", + "privileges": { + "cluster": [ + "manage_inference" + ] + }, + "request": { + "name": "Request", + "namespace": "inference.put_custom" + }, + "requestBodyRequired": false, + "requestMediaType": [ + "application/json" + ], + "response": { + "name": "Response", + "namespace": "inference.put_custom" + }, + "responseMediaType": [ + "application/json" + ], + "urls": [ + { + "methods": [ + "PUT" + ], + "path": "/_inference/{task_type}/{custom_inference_id}" + } + ] + }, { "availability": { "serverless": { @@ -58988,7 +59034,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L647-L652", + "specLocation": "_types/aggregations/Aggregate.ts#L649-L654", "variantName": "adjacency_matrix" }, { @@ -59070,7 +59116,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L654-L656" + "specLocation": "_types/aggregations/Aggregate.ts#L656-L658" }, { "kind": "type_alias", @@ -61354,7 +61400,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L806-L825", + "specLocation": "_types/aggregations/Aggregate.ts#L808-L827", "variantName": "boxplot" }, { @@ -62299,7 +62345,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L888-L892", + "specLocation": "_types/aggregations/Aggregate.ts#L890-L894", "variantName": "children" }, { @@ -62364,7 +62410,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L698-L703", + "specLocation": "_types/aggregations/Aggregate.ts#L700-L705", "variantName": "composite" }, { @@ -62626,7 +62672,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L705-L707" + "specLocation": "_types/aggregations/Aggregate.ts#L707-L709" }, { "kind": "interface", @@ -62818,7 +62864,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L856-L864", + "specLocation": "_types/aggregations/Aggregate.ts#L858-L866", "variantName": "simple_long_value" }, { @@ -64157,8 +64203,20 @@ "name": "FiltersBucket", "namespace": "_types.aggregations" }, - "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L645-L645" + "properties": [ + { + "name": "key", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "_types/aggregations/Aggregate.ts#L645-L647" }, { "kind": "interface", @@ -64236,7 +64294,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L722-L723", + "specLocation": "_types/aggregations/Aggregate.ts#L724-L725", "variantName": "frequent_item_sets" }, { @@ -64370,7 +64428,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L725-L728" + "specLocation": "_types/aggregations/Aggregate.ts#L727-L730" }, { "kind": "interface", @@ -64914,7 +64972,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L902-L912", + "specLocation": "_types/aggregations/Aggregate.ts#L904-L914", "variantName": "geo_line" }, { @@ -65880,7 +65938,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L755-L770", + "specLocation": "_types/aggregations/Aggregate.ts#L757-L772", "variantName": "inference" }, { @@ -65953,7 +66011,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L784-L787" + "specLocation": "_types/aggregations/Aggregate.ts#L786-L789" }, { "kind": "interface", @@ -66036,7 +66094,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L778-L782" + "specLocation": "_types/aggregations/Aggregate.ts#L780-L784" }, { "kind": "interface", @@ -66079,7 +66137,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L772-L776" + "specLocation": "_types/aggregations/Aggregate.ts#L774-L778" }, { "kind": "interface", @@ -66105,7 +66163,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L709-L713", + "specLocation": "_types/aggregations/Aggregate.ts#L711-L715", "variantName": "ip_prefix" }, { @@ -66260,7 +66318,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L715-L720" + "specLocation": "_types/aggregations/Aggregate.ts#L717-L722" }, { "kind": "interface", @@ -66760,7 +66818,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L866-L873", + "specLocation": "_types/aggregations/Aggregate.ts#L868-L875", "variantName": "matrix_stats" }, { @@ -66910,7 +66968,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L875-L884" + "specLocation": "_types/aggregations/Aggregate.ts#L877-L886" }, { "kind": "interface", @@ -67972,7 +68030,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L894-L898", + "specLocation": "_types/aggregations/Aggregate.ts#L896-L900", "variantName": "parent" }, { @@ -68706,7 +68764,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L847-L854", + "specLocation": "_types/aggregations/Aggregate.ts#L849-L856", "variantName": "rate" }, { @@ -68933,7 +68991,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L739-L745", + "specLocation": "_types/aggregations/Aggregate.ts#L741-L747", "variantName": "scripted_metric" }, { @@ -69071,7 +69129,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L668-L670", + "specLocation": "_types/aggregations/Aggregate.ts#L670-L672", "variantName": "siglterms" }, { @@ -69113,7 +69171,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L677-L680" + "specLocation": "_types/aggregations/Aggregate.ts#L679-L682" }, { "kind": "interface", @@ -69137,7 +69195,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L682-L684", + "specLocation": "_types/aggregations/Aggregate.ts#L684-L686", "variantName": "sigsterms" }, { @@ -69168,7 +69226,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L686-L688" + "specLocation": "_types/aggregations/Aggregate.ts#L688-L690" }, { "kind": "interface", @@ -69223,7 +69281,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L658-L666" + "specLocation": "_types/aggregations/Aggregate.ts#L660-L668" }, { "kind": "interface", @@ -69463,7 +69521,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L672-L675" + "specLocation": "_types/aggregations/Aggregate.ts#L674-L677" }, { "kind": "interface", @@ -70516,7 +70574,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L793-L804", + "specLocation": "_types/aggregations/Aggregate.ts#L795-L806", "variantName": "string_stats" }, { @@ -70788,7 +70846,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L838-L845", + "specLocation": "_types/aggregations/Aggregate.ts#L840-L847", "variantName": "t_test" }, { @@ -71386,7 +71444,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L730-L731", + "specLocation": "_types/aggregations/Aggregate.ts#L732-L733", "variantName": "time_series" }, { @@ -71471,7 +71529,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L733-L735" + "specLocation": "_types/aggregations/Aggregate.ts#L735-L737" }, { "kind": "interface", @@ -71505,7 +71563,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L747-L753", + "specLocation": "_types/aggregations/Aggregate.ts#L749-L755", "variantName": "top_hits" }, { @@ -71770,7 +71828,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L832-L836" + "specLocation": "_types/aggregations/Aggregate.ts#L834-L838" }, { "kind": "interface", @@ -71800,7 +71858,7 @@ } } ], - "specLocation": "_types/aggregations/Aggregate.ts#L827-L830", + "specLocation": "_types/aggregations/Aggregate.ts#L829-L832", "variantName": "top_metrics" }, { @@ -71963,7 +72021,7 @@ "namespace": "_types.aggregations" }, "properties": [], - "specLocation": "_types/aggregations/Aggregate.ts#L690-L696", + "specLocation": "_types/aggregations/Aggregate.ts#L692-L698", "variantName": "umsigterms" }, { @@ -168082,6 +168140,177 @@ ], "specLocation": "inference/_types/CommonTypes.ts#L123-L135" }, + { + "kind": "interface", + "name": { + "name": "CustomRequestParams", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "The body structure of the request. It requires passing in the string-escaped result of the JSON format HTTP request body.\nFor example:\n```\n\"request\": \"{\\\"input\\\":${input}}\"\n```\n> info\n> The content string needs to be a single line except when using the Kibana console.", + "name": "content", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L831-L842" + }, + { + "kind": "interface", + "name": { + "name": "CustomResponseParams", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "Specifies the JSON parser that is used to parse the response from the custom service.\nDifferent task types require different json_parser parameters.\nFor example:\n```\n# text_embedding\n# For a response like this:\n\n{\n \"object\": \"list\",\n \"data\": [\n {\n \"object\": \"embedding\",\n \"index\": 0,\n \"embedding\": [\n 0.014539449,\n -0.015288644\n ]\n }\n ],\n \"model\": \"text-embedding-ada-002-v2\",\n \"usage\": {\n \"prompt_tokens\": 8,\n \"total_tokens\": 8\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n}\n\n# sparse_embedding\n# For a response like this:\n\n{\n \"request_id\": \"75C50B5B-E79E-4930-****-F48DBB392231\",\n \"latency\": 22,\n \"usage\": {\n \"token_count\": 11\n },\n \"result\": {\n \"sparse_embeddings\": [\n {\n \"index\": 0,\n \"embedding\": [\n {\n \"token_id\": 6,\n \"weight\": 0.101\n },\n {\n \"token_id\": 163040,\n \"weight\": 0.28417\n }\n ]\n }\n ]\n }\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"token_path\":\"$.result.sparse_embeddings[*].embedding[*].token_id\",\n \"weight_path\":\"$.result.sparse_embeddings[*].embedding[*].weight\"\n }\n}\n\n# rerank\n# For a response like this:\n\n{\n \"results\": [\n {\n \"index\": 3,\n \"relevance_score\": 0.999071,\n \"document\": \"abc\"\n },\n {\n \"index\": 4,\n \"relevance_score\": 0.7867867,\n \"document\": \"123\"\n },\n {\n \"index\": 0,\n \"relevance_score\": 0.32713068,\n \"document\": \"super\"\n }\n ],\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"reranked_index\":\"$.result.scores[*].index\", // optional\n \"relevance_score\":\"$.result.scores[*].score\",\n \"document_text\":\"xxx\" // optional\n }\n}\n\n# completion\n# For a response like this:\n\n{\n \"id\": \"chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT\",\n \"object\": \"chat.completion\",\n \"created\": 1741569952,\n \"model\": \"gpt-4.1-2025-04-14\",\n \"choices\": [\n {\n \"index\": 0,\n \"message\": {\n \"role\": \"assistant\",\n \"content\": \"Hello! How can I assist you today?\",\n \"refusal\": null,\n \"annotations\": []\n },\n \"logprobs\": null,\n \"finish_reason\": \"stop\"\n }\n ]\n}\n\n# the json_parser definition should look like this:\n\n\"response\":{\n \"json_parser\":{\n \"completion_result\":\"$.choices[*].message.content\"\n }\n}", + "name": "json_parser", + "required": true, + "type": { + "kind": "user_defined_value" + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L844-L982" + }, + { + "kind": "interface", + "name": { + "name": "CustomServiceSettings", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "Specifies the HTTPS header parameters – such as `Authentication` or `Contet-Type` – that are required to access the custom service.\nFor example:\n```\n\"headers\":{\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json;charset=utf-8\"\n}\n```", + "name": "headers", + "required": false, + "type": { + "kind": "user_defined_value" + } + }, + { + "description": "Specifies the input type translation values that are used to replace the `${input_type}` template in the request body.\nFor example:\n```\n\"input_type\": {\n \"translation\": {\n \"ingest\": \"do_ingest\",\n \"search\": \"do_search\"\n },\n \"default\": \"a_default\"\n},\n```\nIf the subsequent inference requests come from a search context, the `search` key will be used and the template will be replaced with `do_search`.\nIf 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.\n`translation` can be:\n* `classification`\n* `clustering`\n* `ingest`\n* `search`", + "name": "input_type", + "required": false, + "type": { + "kind": "user_defined_value" + } + }, + { + "description": "Specifies the query parameters as a list of tuples. The arrays inside the `query_parameters` must have two items, a key and a value.\nFor example:\n```\n\"query_parameters\":[\n [\"param_key\", \"some_value\"],\n [\"param_key\", \"another_value\"],\n [\"other_key\", \"other_value\"]\n]\n```\nIf 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`.", + "name": "query_parameters", + "required": false, + "type": { + "kind": "user_defined_value" + } + }, + { + "description": "The request configuration object.", + "name": "request", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "CustomRequestParams", + "namespace": "inference._types" + } + } + }, + { + "description": "The response configuration object.", + "name": "response", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "CustomResponseParams", + "namespace": "inference._types" + } + } + }, + { + "description": "Specifies secret parameters, like `api_key` or `api_token`, that are required to access the custom service.\nFor example:\n```\n\"secret_parameters\":{\n \"api_key\":\"\"\n}\n```", + "name": "secret_parameters", + "required": true, + "type": { + "kind": "user_defined_value" + } + }, + { + "description": "The URL endpoint to use for the requests.", + "name": "url", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L761-L829" + }, + { + "kind": "enum", + "members": [ + { + "name": "custom" + } + ], + "name": { + "name": "CustomServiceType", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/CommonTypes.ts#L991-L993" + }, + { + "kind": "interface", + "name": { + "name": "CustomTaskSettings", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "Specifies parameters that are required to run the custom service. The parameters depend on the model your custom service uses.\nFor example:\n```\n\"task_settings\":{\n \"parameters\":{\n \"input_type\":\"query\",\n \"return_token\":true\n }\n}\n```", + "name": "parameters", + "required": false, + "type": { + "kind": "user_defined_value" + } + } + ], + "specLocation": "inference/_types/CommonTypes.ts#L995-L1009" + }, + { + "kind": "enum", + "members": [ + { + "name": "text_embedding" + }, + { + "name": "sparse_embedding" + }, + { + "name": "rerank" + }, + { + "name": "completion" + } + ], + "name": { + "name": "CustomTaskType", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/CommonTypes.ts#L984-L989" + }, { "kind": "interface", "name": { @@ -168128,7 +168357,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L773-L795" + "specLocation": "inference/_types/CommonTypes.ts#L1023-L1045" }, { "kind": "enum", @@ -168141,7 +168370,7 @@ "name": "DeepSeekServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L797-L799" + "specLocation": "inference/_types/CommonTypes.ts#L1047-L1049" }, { "kind": "interface", @@ -168282,7 +168511,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L822-L856" + "specLocation": "inference/_types/CommonTypes.ts#L1072-L1106" }, { "kind": "enum", @@ -168295,7 +168524,7 @@ "name": "ElasticsearchServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L872-L874" + "specLocation": "inference/_types/CommonTypes.ts#L1122-L1124" }, { "kind": "interface", @@ -168318,7 +168547,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L858-L864" + "specLocation": "inference/_types/CommonTypes.ts#L1108-L1114" }, { "kind": "enum", @@ -168337,7 +168566,7 @@ "name": "ElasticsearchTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L866-L870" + "specLocation": "inference/_types/CommonTypes.ts#L1116-L1120" }, { "kind": "interface", @@ -168383,7 +168612,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L876-L902" + "specLocation": "inference/_types/CommonTypes.ts#L1126-L1152" }, { "kind": "enum", @@ -168396,7 +168625,7 @@ "name": "ElserServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L908-L910" + "specLocation": "inference/_types/CommonTypes.ts#L1158-L1160" }, { "kind": "enum", @@ -168409,7 +168638,7 @@ "name": "ElserTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L904-L906" + "specLocation": "inference/_types/CommonTypes.ts#L1154-L1156" }, { "kind": "enum", @@ -168422,7 +168651,7 @@ "name": "GoogleAiServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L935-L937" + "specLocation": "inference/_types/CommonTypes.ts#L1185-L1187" }, { "kind": "interface", @@ -168470,7 +168699,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L912-L928" + "specLocation": "inference/_types/CommonTypes.ts#L1162-L1178" }, { "kind": "enum", @@ -168486,7 +168715,7 @@ "name": "GoogleAiStudioTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L930-L933" + "specLocation": "inference/_types/CommonTypes.ts#L1180-L1183" }, { "kind": "interface", @@ -168560,7 +168789,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L939-L965" + "specLocation": "inference/_types/CommonTypes.ts#L1189-L1215" }, { "kind": "enum", @@ -168573,7 +168802,7 @@ "name": "GoogleVertexAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L985-L987" + "specLocation": "inference/_types/CommonTypes.ts#L1235-L1237" }, { "kind": "interface", @@ -168607,7 +168836,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L967-L976" + "specLocation": "inference/_types/CommonTypes.ts#L1217-L1226" }, { "kind": "enum", @@ -168629,7 +168858,7 @@ "name": "GoogleVertexAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L978-L983" + "specLocation": "inference/_types/CommonTypes.ts#L1228-L1233" }, { "kind": "interface", @@ -168691,7 +168920,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L989-L1021" + "specLocation": "inference/_types/CommonTypes.ts#L1239-L1271" }, { "kind": "enum", @@ -168704,7 +168933,7 @@ "name": "HuggingFaceServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1042-L1044" + "specLocation": "inference/_types/CommonTypes.ts#L1292-L1294" }, { "kind": "interface", @@ -168738,7 +168967,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1023-L1033" + "specLocation": "inference/_types/CommonTypes.ts#L1273-L1283" }, { "kind": "enum", @@ -168760,7 +168989,7 @@ "name": "HuggingFaceTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1035-L1040" + "specLocation": "inference/_types/CommonTypes.ts#L1285-L1290" }, { "kind": "interface", @@ -168823,7 +169052,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L266-L295" + "specLocation": "inference/_types/Services.ts#L276-L305" }, { "kind": "interface", @@ -168882,7 +169111,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L43-L63" + "specLocation": "inference/_types/Services.ts#L44-L64" }, { "kind": "interface", @@ -168923,7 +169152,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L65-L77" + "specLocation": "inference/_types/Services.ts#L66-L78" }, { "kind": "interface", @@ -168963,7 +169192,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L90-L99" + "specLocation": "inference/_types/Services.ts#L79-L88" }, { "kind": "interface", @@ -169003,7 +169232,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L101-L110" + "specLocation": "inference/_types/Services.ts#L90-L99" }, { "kind": "interface", @@ -169043,7 +169272,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L112-L121" + "specLocation": "inference/_types/Services.ts#L101-L110" }, { "kind": "interface", @@ -169083,7 +169312,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L123-L132" + "specLocation": "inference/_types/Services.ts#L112-L121" }, { "kind": "interface", @@ -169123,7 +169352,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L134-L143" + "specLocation": "inference/_types/Services.ts#L123-L132" }, { "kind": "interface", @@ -169163,6 +169392,46 @@ } } ], + "specLocation": "inference/_types/Services.ts#L134-L143" + }, + { + "kind": "interface", + "inherits": { + "type": { + "name": "InferenceEndpoint", + "namespace": "inference._types" + } + }, + "name": { + "name": "InferenceEndpointInfoCustom", + "namespace": "inference._types" + }, + "properties": [ + { + "description": "The inference Id", + "name": "inference_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "string", + "namespace": "_builtins" + } + } + }, + { + "description": "The task type", + "name": "task_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "TaskTypeCustom", + "namespace": "inference._types" + } + } + } + ], "specLocation": "inference/_types/Services.ts#L145-L154" }, { @@ -169203,7 +169472,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L156-L165" + "specLocation": "inference/_types/Services.ts#L155-L164" }, { "kind": "interface", @@ -169243,7 +169512,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L178-L187" + "specLocation": "inference/_types/Services.ts#L177-L186" }, { "kind": "interface", @@ -169283,7 +169552,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L167-L176" + "specLocation": "inference/_types/Services.ts#L166-L175" }, { "kind": "interface", @@ -169323,7 +169592,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L189-L198" + "specLocation": "inference/_types/Services.ts#L188-L197" }, { "kind": "interface", @@ -169363,7 +169632,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L200-L209" + "specLocation": "inference/_types/Services.ts#L199-L208" }, { "kind": "interface", @@ -169403,7 +169672,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L211-L220" + "specLocation": "inference/_types/Services.ts#L210-L219" }, { "kind": "interface", @@ -169443,7 +169712,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L79-L88" + "specLocation": "inference/_types/Services.ts#L221-L230" }, { "kind": "interface", @@ -169483,7 +169752,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L222-L231" + "specLocation": "inference/_types/Services.ts#L232-L241" }, { "kind": "interface", @@ -169523,7 +169792,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L233-L242" + "specLocation": "inference/_types/Services.ts#L243-L252" }, { "kind": "interface", @@ -169563,7 +169832,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L244-L253" + "specLocation": "inference/_types/Services.ts#L254-L263" }, { "kind": "interface", @@ -169603,7 +169872,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L255-L264" + "specLocation": "inference/_types/Services.ts#L265-L274" }, { "kind": "interface", @@ -169763,7 +170032,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1046-L1075" + "specLocation": "inference/_types/CommonTypes.ts#L1296-L1325" }, { "kind": "enum", @@ -169776,7 +170045,7 @@ "name": "JinaAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1105-L1107" + "specLocation": "inference/_types/CommonTypes.ts#L1355-L1357" }, { "kind": "enum", @@ -169795,7 +170064,7 @@ "name": "JinaAISimilarityType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1109-L1113" + "specLocation": "inference/_types/CommonTypes.ts#L1359-L1363" }, { "kind": "interface", @@ -169841,7 +170110,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1077-L1098" + "specLocation": "inference/_types/CommonTypes.ts#L1327-L1348" }, { "kind": "enum", @@ -169857,7 +170126,7 @@ "name": "JinaAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1100-L1103" + "specLocation": "inference/_types/CommonTypes.ts#L1350-L1353" }, { "kind": "enum", @@ -169879,7 +170148,7 @@ "name": "JinaAITextEmbeddingTask", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1115-L1120" + "specLocation": "inference/_types/CommonTypes.ts#L1365-L1370" }, { "kind": "interface", @@ -170037,7 +170306,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1122-L1149" + "specLocation": "inference/_types/CommonTypes.ts#L1372-L1399" }, { "kind": "enum", @@ -170050,7 +170319,7 @@ "name": "MistralServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1157-L1159" + "specLocation": "inference/_types/CommonTypes.ts#L1407-L1409" }, { "kind": "enum", @@ -170069,7 +170338,7 @@ "name": "MistralTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1151-L1155" + "specLocation": "inference/_types/CommonTypes.ts#L1401-L1405" }, { "kind": "interface", @@ -170156,7 +170425,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1161-L1203" + "specLocation": "inference/_types/CommonTypes.ts#L1411-L1453" }, { "kind": "enum", @@ -170169,7 +170438,7 @@ "name": "OpenAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1219-L1221" + "specLocation": "inference/_types/CommonTypes.ts#L1469-L1471" }, { "kind": "interface", @@ -170191,7 +170460,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1205-L1211" + "specLocation": "inference/_types/CommonTypes.ts#L1455-L1461" }, { "kind": "enum", @@ -170210,7 +170479,7 @@ "name": "OpenAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1213-L1217" + "specLocation": "inference/_types/CommonTypes.ts#L1463-L1467" }, { "kind": "interface", @@ -170277,7 +170546,7 @@ } } ], - "specLocation": "inference/_types/Services.ts#L301-L327" + "specLocation": "inference/_types/Services.ts#L311-L337" }, { "kind": "interface", @@ -170425,7 +170694,7 @@ "name": "ServiceSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L297-L297", + "specLocation": "inference/_types/Services.ts#L307-L307", "type": { "kind": "user_defined_value" } @@ -170509,7 +170778,7 @@ "name": "TaskSettings", "namespace": "inference._types" }, - "specLocation": "inference/_types/Services.ts#L299-L299", + "specLocation": "inference/_types/Services.ts#L309-L309", "type": { "kind": "user_defined_value" } @@ -170641,6 +170910,28 @@ }, "specLocation": "inference/_types/TaskType.ts#L62-L66" }, + { + "kind": "enum", + "members": [ + { + "name": "text_embedding" + }, + { + "name": "sparse_embedding" + }, + { + "name": "rerank" + }, + { + "name": "completion" + } + ], + "name": { + "name": "TaskTypeCustom", + "namespace": "inference._types" + }, + "specLocation": "inference/_types/TaskType.ts#L68-L73" + }, { "kind": "enum", "members": [ @@ -170655,7 +170946,7 @@ "name": "TaskTypeDeepSeek", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L68-L71" + "specLocation": "inference/_types/TaskType.ts#L75-L78" }, { "kind": "enum", @@ -170668,7 +170959,7 @@ "name": "TaskTypeELSER", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L79-L81" + "specLocation": "inference/_types/TaskType.ts#L86-L88" }, { "kind": "enum", @@ -170687,7 +170978,7 @@ "name": "TaskTypeElasticsearch", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L73-L77" + "specLocation": "inference/_types/TaskType.ts#L80-L84" }, { "kind": "enum", @@ -170703,7 +170994,7 @@ "name": "TaskTypeGoogleAIStudio", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L83-L86" + "specLocation": "inference/_types/TaskType.ts#L90-L93" }, { "kind": "enum", @@ -170719,7 +171010,7 @@ "name": "TaskTypeGoogleVertexAI", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L88-L91" + "specLocation": "inference/_types/TaskType.ts#L95-L98" }, { "kind": "enum", @@ -170741,7 +171032,7 @@ "name": "TaskTypeHuggingFace", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L93-L98" + "specLocation": "inference/_types/TaskType.ts#L100-L105" }, { "kind": "enum", @@ -170776,7 +171067,7 @@ "name": "TaskTypeMistral", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L100-L104" + "specLocation": "inference/_types/TaskType.ts#L107-L111" }, { "kind": "enum", @@ -170795,7 +171086,7 @@ "name": "TaskTypeOpenAI", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L106-L110" + "specLocation": "inference/_types/TaskType.ts#L113-L117" }, { "kind": "enum", @@ -170811,7 +171102,7 @@ "name": "TaskTypeVoyageAI", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L112-L115" + "specLocation": "inference/_types/TaskType.ts#L119-L122" }, { "kind": "enum", @@ -170830,7 +171121,7 @@ "name": "TaskTypeWatsonx", "namespace": "inference._types" }, - "specLocation": "inference/_types/TaskType.ts#L117-L121" + "specLocation": "inference/_types/TaskType.ts#L124-L128" }, { "kind": "interface", @@ -171076,7 +171367,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1223-L1254" + "specLocation": "inference/_types/CommonTypes.ts#L1473-L1504" }, { "kind": "enum", @@ -171089,7 +171380,7 @@ "name": "VoyageAIServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1287-L1289" + "specLocation": "inference/_types/CommonTypes.ts#L1537-L1539" }, { "kind": "interface", @@ -171149,7 +171440,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1256-L1280" + "specLocation": "inference/_types/CommonTypes.ts#L1506-L1530" }, { "kind": "enum", @@ -171165,7 +171456,7 @@ "name": "VoyageAITaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1282-L1285" + "specLocation": "inference/_types/CommonTypes.ts#L1532-L1535" }, { "kind": "interface", @@ -171253,7 +171544,7 @@ } } ], - "specLocation": "inference/_types/CommonTypes.ts#L1291-L1329" + "specLocation": "inference/_types/CommonTypes.ts#L1541-L1579" }, { "kind": "enum", @@ -171266,7 +171557,7 @@ "name": "WatsonxServiceType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1337-L1339" + "specLocation": "inference/_types/CommonTypes.ts#L1587-L1589" }, { "kind": "enum", @@ -171285,7 +171576,7 @@ "name": "WatsonxTaskType", "namespace": "inference._types" }, - "specLocation": "inference/_types/CommonTypes.ts#L1331-L1335" + "specLocation": "inference/_types/CommonTypes.ts#L1581-L1585" }, { "kind": "request", @@ -173269,6 +173560,12 @@ "method_request": "PUT _inference/rerank/cohere-rerank", "summary": "A rerank task", "value": "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"rerank-english-v3.0\"\n },\n \"task_settings\": {\n \"top_n\": 10,\n \"return_documents\": true\n }\n}" + }, + "PutCohereRequestExample3": { + "description": "Run `PUT _inference/completion/cohere-completion` to create an inference endpoint that performs a completion task.", + "method_request": "PUT _inference/completion/cohere-completion", + "summary": "A completion task", + "value": "{\n \"service\": \"cohere\",\n \"service_settings\": {\n \"api_key\": \"Cohere-API-key\",\n \"model_id\": \"command-a-03-2025\"\n }\n}" } }, "inherits": { @@ -173343,6 +173640,125 @@ }, "specLocation": "inference/put_cohere/PutCohereResponse.ts#L22-L25" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "properties", + "properties": [ + { + "description": "The chunking configuration object.", + "extDocId": "inference-chunking", + "extDocUrl": "https://www.elastic.co/docs/explore-analyze/elastic-inference/inference-api#infer-chunking-config", + "name": "chunking_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "InferenceChunkingSettings", + "namespace": "inference._types" + } + } + }, + { + "description": "The type of service supported for the specified task type. In this case, `custom`.", + "name": "service", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "CustomServiceType", + "namespace": "inference._types" + } + } + }, + { + "description": "Settings used to install the inference model.\nThese settings are specific to the `custom` service.", + "name": "service_settings", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "CustomServiceSettings", + "namespace": "inference._types" + } + } + }, + { + "description": "Settings to configure the inference task.\nThese settings are specific to the task type you specified.", + "name": "task_settings", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "CustomTaskSettings", + "namespace": "inference._types" + } + } + } + ] + }, + "description": "Create a custom inference endpoint.\n\nThe custom service gives more control over how to interact with external inference services that aren't explicitly supported through dedicated integrations.\nThe custom service gives you the ability to define the headers, url, query parameters, request body, and secrets.\nThe 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.\nTemplates are portions of a string that start with `${` and end with `}`.\nThe 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`.\nIf the definition (key) is not found for a template, an error message is returned.\nIn case of an endpoint definition like the following:\n```\nPUT _inference/text_embedding/test-text-embedding\n{\n \"service\": \"custom\",\n \"service_settings\": {\n \"secret_parameters\": {\n \"api_key\": \"\"\n },\n \"url\": \"...endpoints.huggingface.cloud/v1/embeddings\",\n \"headers\": {\n \"Authorization\": \"Bearer ${api_key}\",\n \"Content-Type\": \"application/json\"\n },\n \"request\": \"{\\\"input\\\": ${input}}\",\n \"response\": {\n \"json_parser\": {\n \"text_embeddings\":\"$.data[*].embedding[*]\"\n }\n }\n }\n}\n```\nTo replace `${api_key}` the `secret_parameters` and `task_settings` are checked for a key named `api_key`.\n\n> info\n> Templates should not be surrounded by quotes.\n\nPre-defined templates:\n* `${input}` refers to the array of input strings that comes from the `input` field of the subsequent inference requests.\n* `${input_type}` refers to the input type translation values.\n* `${query}` refers to the query field used specifically for reranking tasks.\n* `${top_n}` refers to the `top_n` field available when performing rerank requests.\n* `${return_documents}` refers to the `return_documents` field available when performing rerank requests.", + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "inference.put_custom" + }, + "path": [ + { + "description": "The type of the inference task that the model will perform.", + "name": "task_type", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "CustomTaskType", + "namespace": "inference._types" + } + } + }, + { + "description": "The unique identifier of the inference endpoint.", + "name": "custom_inference_id", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Id", + "namespace": "_types" + } + } + } + ], + "query": [], + "specLocation": "inference/put_custom/PutCustomRequest.ts#L30-L117" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "endpoint_info", + "value": { + "kind": "instance_of", + "type": { + "name": "InferenceEndpointInfoCustom", + "namespace": "inference._types" + } + } + }, + "name": { + "name": "Response", + "namespace": "inference.put_custom" + }, + "specLocation": "inference/put_custom/PutCustomResponse.ts#L22-L25" + }, { "kind": "request", "attachedBehaviors": [ @@ -261746,7 +262162,7 @@ ], "description": "Run `POST _transform/simple-kibana-ecomm-pivot/_update` to update a transform that uses the pivot method.", "method_request": "POST _transform/simple-kibana-ecomm-pivot/_update", - "value": "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"pivot\": {\n \"group_by\": {\n \"customer_id\": {\n \"terms\": {\n \"field\": \"customer_id\",\n \"missing_bucket\": true\n }\n }\n },\n \"aggregations\": {\n \"max_price\": {\n \"max\": {\n \"field\": \"taxful_total_price\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform1\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"5m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"60s\"\n }\n },\n \"retention_policy\": {\n \"time\": {\n \"field\": \"order_date\",\n \"max_age\": \"30d\"\n }\n }\n}" + "value": "{\n \"source\": {\n \"index\": \"kibana_sample_data_ecommerce\",\n \"query\": {\n \"term\": {\n \"geoip.continent_name\": {\n \"value\": \"Asia\"\n }\n }\n }\n },\n \"description\": \"Maximum priced ecommerce data by customer_id in Asia\",\n \"dest\": {\n \"index\": \"kibana_sample_data_ecommerce_transform_v2\",\n \"pipeline\": \"add_timestamp_pipeline\"\n },\n \"frequency\": \"15m\",\n \"sync\": {\n \"time\": {\n \"field\": \"order_date\",\n \"delay\": \"120s\"\n }\n }\n}" } }, "inherits": { diff --git a/output/typescript/types.ts b/output/typescript/types.ts index b8007248c3..724a36b60a 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -3570,9 +3570,10 @@ export interface AggregationsFiltersAggregation extends AggregationsBucketAggreg } export interface AggregationsFiltersBucketKeys extends AggregationsMultiBucketBase { + key?: string } export type AggregationsFiltersBucket = AggregationsFiltersBucketKeys - & { [property: string]: AggregationsAggregate | long } + & { [property: string]: AggregationsAggregate | string | long } export interface AggregationsFormatMetricAggregationBase extends AggregationsMetricAggregationBase { format?: string @@ -13835,6 +13836,32 @@ export interface InferenceContentObject { type: string } +export interface InferenceCustomRequestParams { + content: string +} + +export interface InferenceCustomResponseParams { + json_parser: any +} + +export interface InferenceCustomServiceSettings { + headers?: any + input_type?: any + query_parameters?: any + request: InferenceCustomRequestParams + response: InferenceCustomResponseParams + secret_parameters: any + url?: string +} + +export type InferenceCustomServiceType = 'custom' + +export interface InferenceCustomTaskSettings { + parameters?: any +} + +export type InferenceCustomTaskType = 'text_embedding' | 'sparse_embedding' | 'rerank' | 'completion' + export interface InferenceDeepSeekServiceSettings { api_key: string model_id: string @@ -13969,6 +13996,11 @@ export interface InferenceInferenceEndpointInfoCohere extends InferenceInference task_type: InferenceTaskTypeCohere } +export interface InferenceInferenceEndpointInfoCustom extends InferenceInferenceEndpoint { + inference_id: string + task_type: InferenceTaskTypeCustom +} + export interface InferenceInferenceEndpointInfoDeepSeek extends InferenceInferenceEndpoint { inference_id: string task_type: InferenceTaskTypeDeepSeek @@ -14144,6 +14176,8 @@ export type InferenceTaskTypeAzureOpenAI = 'text_embedding' | 'completion' export type InferenceTaskTypeCohere = 'text_embedding' | 'rerank' | 'completion' +export type InferenceTaskTypeCustom = 'text_embedding' | 'sparse_embedding' | 'rerank' | 'completion' + export type InferenceTaskTypeDeepSeek = 'completion' | 'chat_completion' export type InferenceTaskTypeELSER = 'sparse_embedding' @@ -14366,6 +14400,19 @@ export interface InferencePutCohereRequest extends RequestBase { export type InferencePutCohereResponse = InferenceInferenceEndpointInfoCohere +export interface InferencePutCustomRequest extends RequestBase { + task_type: InferenceCustomTaskType + custom_inference_id: Id + body?: { + chunking_settings?: InferenceInferenceChunkingSettings + service: InferenceCustomServiceType + service_settings: InferenceCustomServiceSettings + task_settings?: InferenceCustomTaskSettings + } +} + +export type InferencePutCustomResponse = InferenceInferenceEndpointInfoCustom + export interface InferencePutDeepseekRequest extends RequestBase { task_type: InferenceTaskTypeDeepSeek deepseek_inference_id: Id