@@ -5,7 +5,8 @@ serverless: preview
55stack : 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
3548The command works with any LLM deployed to
3649the [Elasticsearch inference API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put)
3750and 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
4469ROW 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-
5478Summarizing 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