Skip to content

Commit 409be85

Browse files
committed
Addressing PR reviews.
1 parent 5f7c6ba commit 409be85

File tree

1 file changed

+28
-5
lines changed
  • docs/reference/query-languages/esql/_snippets/commands/layout

1 file changed

+28
-5
lines changed

docs/reference/query-languages/esql/_snippets/commands/layout/completion.md

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ serverless: preview
55
stack: preview 9.1.0
66
```
77
8-
The `COMPLETION` processing command generates text completions using a specified LLM (Large Language Model).
8+
The `COMPLETION` processing command provides a general-purpose interface for
9+
text generation using a Large Language Model (LLM) in ES|QL.
910

1011
**Syntax**
1112

@@ -30,15 +31,39 @@ COMPLETION [column =] prompt WITH inference_id
3031

3132
**Description**
3233

33-
The `COMPLETION` command uses a machine learning model to generate text completions based on the provided prompt.
34+
The `COMPLETION` processing command provides a general-purpose interface for
35+
text generation using a Large Language Model (LLM) in ES|QL.
36+
37+
`COMPLETION`supports a wide range of text generation tasks. Depending on your
38+
prompt and the model you use, you can perform arbitrary text generation,
39+
including:
40+
41+
- Question answering
42+
- Summarization
43+
- Translation
44+
- Content rewriting
45+
- Creative generation
46+
- ...
3447

3548
The command works with any LLM deployed to
3649
the [Elasticsearch inference API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put)
3750
and can be chained with other ES|QL commands for further processing.
3851

3952
**Examples**
4053

41-
Basic completion with an inline prompt:
54+
Using default column name (results stored in `completion` column):
55+
56+
```esql
57+
ROW question = "What is Elasticsearch?"
58+
| COMPLETION question WITH test_completion_model
59+
| KEEP question, completion
60+
```
61+
62+
| question:keyword | completion:keyword |
63+
|------------------------|-------------------------------------------|
64+
| What is Elasticsearch? | A distributed search and analytics engine |
65+
66+
Specifying the output column (results stored in `answer` column):
4267

4368
```esql
4469
ROW question = "What is Elasticsearch?"
@@ -50,7 +75,6 @@ ROW question = "What is Elasticsearch?"
5075
| --- | --- |
5176
| What is Elasticsearch? | A distributed search and analytics engine |
5277

53-
5478
Summarizing the top 10 highest-rated movies using a prompt:
5579

5680
```esql
@@ -80,4 +104,3 @@ FROM movies
80104
| Parasite | Class conflict between two families. | 8.6 |
81105
| Interstellar | A team explores space to save humanity. | 8.6 |
82106
| The Prestige | Rival magicians engage in dangerous competition. | 8.5 |
83-

0 commit comments

Comments
 (0)