Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ completion using a ROW source operator
required_capability: completion

ROW prompt="Who is Victor Hugo?"
| COMPLETION prompt WITH test_completion AS completion_output
| COMPLETION completion_output = prompt WITH test_completion
;

prompt:keyword | completion_output:keyword
Expand All @@ -18,7 +18,7 @@ completion using a ROW source operator and prompt is a multi-valued field
required_capability: completion

ROW prompt=["Answer the following question:", "Who is Victor Hugo?"]
| COMPLETION prompt WITH test_completion AS completion_output
| COMPLETION completion_output = prompt WITH test_completion
;

prompt:keyword | completion_output:keyword
Expand All @@ -34,7 +34,7 @@ FROM books METADATA _score
| WHERE title:"war and peace" AND author:"Tolstoy"
| SORT _score DESC
| LIMIT 2
| COMPLETION title WITH test_completion
| COMPLETION completion=title WITH test_completion
| KEEP title, completion
;

Expand All @@ -51,7 +51,7 @@ FROM books METADATA _score
| WHERE title:"war and peace" AND author:"Tolstoy"
| SORT _score DESC
| LIMIT 2
| COMPLETION CONCAT("This is a prompt: ", title) WITH test_completion
| COMPLETION completion=CONCAT("This is a prompt: ", title) WITH test_completion
| KEEP title, completion
;

Expand Down
240 changes: 120 additions & 120 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ rerankCommand
;

completionCommand
: COMPLETION prompt=primaryExpression WITH inferenceId=identifierOrParameter (AS targetField=qualifiedName)?
: COMPLETION (targetField=qualifiedName ASSIGN)? prompt=primaryExpression WITH inferenceId=identifierOrParameter
;

sampleCommand
Expand Down
Loading