From a74a7779ad3a8aca007f723eabcc99f0e31b958a Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 28 Jul 2025 11:57:47 +0200 Subject: [PATCH 1/8] [DOCS] Add timeout warning to ESQL completion command --- .../_snippets/commands/layout/completion.md | 31 ++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 116247697036c..5c6d963b7c41c 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -46,9 +46,38 @@ including: **Requirements** To use this command, you must deploy your LLM model in Elasticsearch as -an [≈inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the +an [inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the task type `completion`. +**Timeouts** + +`COMPLETION` commands may time out when processing large datasets or complex prompts. + +::::{tab-set} +:::{tab-item} {{ess}} +* Timeouts can be increased through {{es}} settings in the [Elastic Cloud Console](docs-content://deploy-manage/deploy/elastic-cloud/edit-stack-settings.md) +* Adjust the `search.default_search_timeout` cluster setting +::: + +:::{tab-item} Self-managed +* Configure at the cluster level: + * Set `search.default_search_timeout` in `elasticsearch.yml` + * Or update via Cluster Settings API +* Alternatively, add timeout parameters to individual queries +::: + +:::{tab-item} {{serverless-full}} +* Requires a manual override from Elastic Support as users cannot modify timeout settings directly +::: +:::: + +**Workarounds:** + +* Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command +* Split complex operations into multiple simpler queries +* Configure your application to handle streaming responses where supported +* Contact Elastic Support to request timeout configuration adjustments in Serverless environments + **Examples** Use the default column name (results stored in `completion` column): From 7dc678659815bc7b64c51c819bfd9bd3c0078970 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 28 Jul 2025 12:01:41 +0200 Subject: [PATCH 2/8] Improve sequencing --- .../esql/_snippets/commands/layout/completion.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 5c6d963b7c41c..0e60090dbdcbd 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -51,7 +51,7 @@ task type `completion`. **Timeouts** -`COMPLETION` commands may time out when processing large datasets or complex prompts. +`COMPLETION` commands may time out when processing large datasets or complex prompts. To increase timeout limits for these operations, the configuration methods vary by deployment type: ::::{tab-set} :::{tab-item} {{ess}} @@ -67,16 +67,15 @@ task type `completion`. ::: :::{tab-item} {{serverless-full}} -* Requires a manual override from Elastic Support as users cannot modify timeout settings directly +Requires a manual override from Elastic Support as users cannot modify timeout settings directly. ::: :::: -**Workarounds:** +**Alternative workarounds:** * Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command * Split complex operations into multiple simpler queries * Configure your application to handle streaming responses where supported -* Contact Elastic Support to request timeout configuration adjustments in Serverless environments **Examples** From fa74f83d07471b08def543ad1de58e57038bc651 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 28 Jul 2025 12:09:50 +0200 Subject: [PATCH 3/8] add link to http client configuration page --- .../esql/_snippets/commands/layout/completion.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 0e60090dbdcbd..0f3644fa1ffe5 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -75,7 +75,7 @@ Requires a manual override from Elastic Support as users cannot modify timeout s * Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command * Split complex operations into multiple simpler queries -* Configure your application to handle streaming responses where supported +* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/configuration-reference/networking-settings.md#_http_client_configuration) **Examples** From 2abaefdd8e11a1b9c09922f3ebda71e759b82a11 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 28 Jul 2025 13:00:55 +0200 Subject: [PATCH 4/8] update link --- .../esql/_snippets/commands/layout/completion.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 0f3644fa1ffe5..7fa0b5187acd9 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -49,7 +49,7 @@ To use this command, you must deploy your LLM model in Elasticsearch as an [inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the task type `completion`. -**Timeouts** +**Handling timeouts** `COMPLETION` commands may time out when processing large datasets or complex prompts. To increase timeout limits for these operations, the configuration methods vary by deployment type: @@ -75,7 +75,7 @@ Requires a manual override from Elastic Support as users cannot modify timeout s * Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command * Split complex operations into multiple simpler queries -* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/configuration-reference/networking-settings.md#_http_client_configuration) +* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/configuration-reference/networking-settings.md#_http_client_configuration) **Examples** From c137c1c5217715918ec5ae205d3b577c8d8d490f Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 28 Jul 2025 13:04:49 +0200 Subject: [PATCH 5/8] use headings, fix link --- .../esql/_snippets/commands/layout/completion.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 7fa0b5187acd9..3edb3e60e17bc 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -7,13 +7,13 @@ stack: preview 9.1.0 The `COMPLETION` command allows you to send prompts and context to a Large Language Model (LLM) directly within your ES|QL queries, to perform text generation tasks. -**Syntax** +### Syntax ```esql COMPLETION [column =] prompt WITH inference_id ``` -**Parameters** +### Parameters `column` : (Optional) The name of the output column containing the LLM's response. @@ -28,7 +28,7 @@ COMPLETION [column =] prompt WITH inference_id : The ID of the [inference endpoint](docs-content://explore-analyze/elastic-inference/inference-api.md) to use for the task. The inference endpoint must be configured with the `completion` task type. -**Description** +## Description The `COMPLETION` command provides a general-purpose interface for text generation tasks using a Large Language Model (LLM) in ES|QL. @@ -43,13 +43,13 @@ including: - Content rewriting - Creative generation -**Requirements** +## Requirements To use this command, you must deploy your LLM model in Elasticsearch as an [inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the task type `completion`. -**Handling timeouts** +### Handling timeouts `COMPLETION` commands may time out when processing large datasets or complex prompts. To increase timeout limits for these operations, the configuration methods vary by deployment type: @@ -75,7 +75,7 @@ Requires a manual override from Elastic Support as users cannot modify timeout s * Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command * Split complex operations into multiple simpler queries -* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/configuration-reference/networking-settings.md#_http_client_configuration) +* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/elasticsearch/configuration-reference/networking-settings.md#_http_client_configuration) **Examples** From 6d3047c18635b6381d3200db67b71d488f5d6188 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Mon, 28 Jul 2025 13:05:29 +0200 Subject: [PATCH 6/8] fix heading levels --- .../esql/_snippets/commands/layout/completion.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 3edb3e60e17bc..797700fb73ae3 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -28,7 +28,7 @@ COMPLETION [column =] prompt WITH inference_id : The ID of the [inference endpoint](docs-content://explore-analyze/elastic-inference/inference-api.md) to use for the task. The inference endpoint must be configured with the `completion` task type. -## Description +### Description The `COMPLETION` command provides a general-purpose interface for text generation tasks using a Large Language Model (LLM) in ES|QL. @@ -43,13 +43,13 @@ including: - Content rewriting - Creative generation -## Requirements +### Requirements To use this command, you must deploy your LLM model in Elasticsearch as an [inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the task type `completion`. -### Handling timeouts +#### Handling timeouts `COMPLETION` commands may time out when processing large datasets or complex prompts. To increase timeout limits for these operations, the configuration methods vary by deployment type: From b3d76e015fc069a524b8d09b61b3a8a3f034304a Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Tue, 29 Jul 2025 09:54:21 +0200 Subject: [PATCH 7/8] Standardized headings to bold, clarified and expanded timeout instructions by deployment type, improved formatting, and added an external API doc link at the end. --- .../_snippets/commands/layout/completion.md | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 797700fb73ae3..34a2925e49378 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -7,13 +7,13 @@ stack: preview 9.1.0 The `COMPLETION` command allows you to send prompts and context to a Large Language Model (LLM) directly within your ES|QL queries, to perform text generation tasks. -### Syntax +**Syntax** ```esql COMPLETION [column =] prompt WITH inference_id ``` -### Parameters +**Parameters** `column` : (Optional) The name of the output column containing the LLM's response. @@ -28,7 +28,7 @@ COMPLETION [column =] prompt WITH inference_id : The ID of the [inference endpoint](docs-content://explore-analyze/elastic-inference/inference-api.md) to use for the task. The inference endpoint must be configured with the `completion` task type. -### Description +**Description** The `COMPLETION` command provides a general-purpose interface for text generation tasks using a Large Language Model (LLM) in ES|QL. @@ -43,7 +43,7 @@ including: - Content rewriting - Creative generation -### Requirements +**Requirements** To use this command, you must deploy your LLM model in Elasticsearch as an [inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the @@ -51,31 +51,36 @@ task type `completion`. #### Handling timeouts -`COMPLETION` commands may time out when processing large datasets or complex prompts. To increase timeout limits for these operations, the configuration methods vary by deployment type: +`COMPLETION` commands may time out when processing large datasets or complex prompts. The default timeout is 10 minutes, but you can increase this limit if necessary. + +How you increase the timeout depends on your deployment type: ::::{tab-set} -:::{tab-item} {{ess}} -* Timeouts can be increased through {{es}} settings in the [Elastic Cloud Console](docs-content://deploy-manage/deploy/elastic-cloud/edit-stack-settings.md) -* Adjust the `search.default_search_timeout` cluster setting +:::{tab-item} {{ech}} +* You can adjust {{es}} settings in the [Elastic Cloud Console](docs-content://deploy-manage/deploy/elastic-cloud/edit-stack-settings.md) +* You can also adjust the `search.default_search_timeout` cluster setting using [Kibana's Advanced settings](kibana://reference/advanced-settings.md#kibana-search-settings) +* The default timeout is 10 minutes ::: :::{tab-item} Self-managed -* Configure at the cluster level: - * Set `search.default_search_timeout` in `elasticsearch.yml` - * Or update via Cluster Settings API -* Alternatively, add timeout parameters to individual queries +* You can configure at the cluster level by setting `search.default_search_timeout` in `elasticsearch.yml` or updating via [Cluster Settings API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-settings) +* You can also adjust the `search:timeout` setting using [Kibana's Advanced settings](kibana://reference/advanced-settings.md#kibana-search-settings) +* Alternatively, you can add timeout parameters to individual queries +* The default timeout is 10 minutes ::: :::{tab-item} {{serverless-full}} -Requires a manual override from Elastic Support as users cannot modify timeout settings directly. +* The default timeout is 10 minutes +* Requires a manual override from Elastic Support because you cannot modify timeout settings directly ::: :::: -**Alternative workarounds:** +If you don't want to increase the timeout limit, try the following: * Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command * Split complex operations into multiple simpler queries -* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/elasticsearch/configuration-reference/networking-settings.md#_http_client_configuration) +* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/elasticsearch/configuration-reference/networking-settings.md#_http_client_configuration)) + **Examples** From bd0351290dec1b215968b9019374f60bee606bc2 Mon Sep 17 00:00:00 2001 From: Liam Thompson Date: Tue, 29 Jul 2025 11:46:50 +0200 Subject: [PATCH 8/8] delete repetition --- .../esql/_snippets/commands/layout/completion.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md index 34a2925e49378..95e789249344f 100644 --- a/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md +++ b/docs/reference/query-languages/esql/_snippets/commands/layout/completion.md @@ -59,18 +59,15 @@ How you increase the timeout depends on your deployment type: :::{tab-item} {{ech}} * You can adjust {{es}} settings in the [Elastic Cloud Console](docs-content://deploy-manage/deploy/elastic-cloud/edit-stack-settings.md) * You can also adjust the `search.default_search_timeout` cluster setting using [Kibana's Advanced settings](kibana://reference/advanced-settings.md#kibana-search-settings) -* The default timeout is 10 minutes ::: :::{tab-item} Self-managed * You can configure at the cluster level by setting `search.default_search_timeout` in `elasticsearch.yml` or updating via [Cluster Settings API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-settings) * You can also adjust the `search:timeout` setting using [Kibana's Advanced settings](kibana://reference/advanced-settings.md#kibana-search-settings) * Alternatively, you can add timeout parameters to individual queries -* The default timeout is 10 minutes ::: :::{tab-item} {{serverless-full}} -* The default timeout is 10 minutes * Requires a manual override from Elastic Support because you cannot modify timeout settings directly ::: ::::