You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Standardized headings to bold, clarified and expanded timeout instructions by deployment type, improved formatting, and added an external API doc link at the end.
Copy file name to clipboardExpand all lines: docs/reference/query-languages/esql/_snippets/commands/layout/completion.md
+20-15Lines changed: 20 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,13 @@ stack: preview 9.1.0
7
7
8
8
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.
9
9
10
-
### Syntax
10
+
**Syntax**
11
11
12
12
```esql
13
13
COMPLETION [column =] prompt WITH inference_id
14
14
```
15
15
16
-
### Parameters
16
+
**Parameters**
17
17
18
18
`column`
19
19
: (Optional) The name of the output column containing the LLM's response.
@@ -28,7 +28,7 @@ COMPLETION [column =] prompt WITH inference_id
28
28
: The ID of the [inference endpoint](docs-content://explore-analyze/elastic-inference/inference-api.md) to use for the task.
29
29
The inference endpoint must be configured with the `completion` task type.
30
30
31
-
### Description
31
+
**Description**
32
32
33
33
The `COMPLETION` command provides a general-purpose interface for
34
34
text generation tasks using a Large Language Model (LLM) in ES|QL.
@@ -43,39 +43,44 @@ including:
43
43
- Content rewriting
44
44
- Creative generation
45
45
46
-
### Requirements
46
+
**Requirements**
47
47
48
48
To use this command, you must deploy your LLM model in Elasticsearch as
49
49
an [inference endpoint](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put) with the
50
50
task type `completion`.
51
51
52
52
#### Handling timeouts
53
53
54
-
`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:
54
+
`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.
55
+
56
+
How you increase the timeout depends on your deployment type:
55
57
56
58
::::{tab-set}
57
-
:::{tab-item} {{ess}}
58
-
* Timeouts can be increased through {{es}} settings in the [Elastic Cloud Console](docs-content://deploy-manage/deploy/elastic-cloud/edit-stack-settings.md)
59
-
* Adjust the `search.default_search_timeout` cluster setting
59
+
:::{tab-item} {{ech}}
60
+
* You can adjust {{es}} settings in the [Elastic Cloud Console](docs-content://deploy-manage/deploy/elastic-cloud/edit-stack-settings.md)
61
+
* You can also adjust the `search.default_search_timeout` cluster setting using [Kibana's Advanced settings](kibana://reference/advanced-settings.md#kibana-search-settings)
62
+
* The default timeout is 10 minutes
60
63
:::
61
64
62
65
:::{tab-item} Self-managed
63
-
* Configure at the cluster level:
64
-
* Set `search.default_search_timeout` in `elasticsearch.yml`
65
-
* Or update via Cluster Settings API
66
-
* Alternatively, add timeout parameters to individual queries
66
+
* 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)
67
+
* You can also adjust the `search:timeout` setting using [Kibana's Advanced settings](kibana://reference/advanced-settings.md#kibana-search-settings)
68
+
* Alternatively, you can add timeout parameters to individual queries
69
+
* The default timeout is 10 minutes
67
70
:::
68
71
69
72
:::{tab-item} {{serverless-full}}
70
-
Requires a manual override from Elastic Support as users cannot modify timeout settings directly.
73
+
* The default timeout is 10 minutes
74
+
* Requires a manual override from Elastic Support because you cannot modify timeout settings directly
71
75
:::
72
76
::::
73
77
74
-
**Alternative workarounds:**
78
+
If you don't want to increase the timeout limit, try the following:
75
79
76
80
* Reduce data volume with `LIMIT` or more selective filters before the `COMPLETION` command
77
81
* Split complex operations into multiple simpler queries
78
-
* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/elasticsearch/configuration-reference/networking-settings.md#_http_client_configuration)
82
+
* Configure your HTTP client's response timeout (Refer to [HTTP client configuration](/reference/elasticsearch/configuration-reference/networking-settings.md#_http_client_configuration))
0 commit comments