Skip to content

Commit 0d0c8b0

Browse files
committed
Update completion command syntax (use = instead of AS)
1 parent a859f37 commit 0d0c8b0

File tree

14 files changed

+1993
-2000
lines changed

14 files changed

+1993
-2000
lines changed

x-pack/plugin/esql/qa/testFixtures/src/main/resources/completion.csv-spec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ completion using a ROW source operator
66
required_capability: completion
77

88
ROW prompt="Who is Victor Hugo?"
9-
| COMPLETION prompt WITH test_completion AS completion_output
9+
| COMPLETION completion_output = prompt WITH test_completion
1010
;
1111

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

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

2424
prompt:keyword | completion_output:keyword
@@ -34,7 +34,7 @@ FROM books METADATA _score
3434
| WHERE title:"war and peace" AND author:"Tolstoy"
3535
| SORT _score DESC
3636
| LIMIT 2
37-
| COMPLETION title WITH test_completion
37+
| COMPLETION completion=title WITH test_completion
3838
| KEEP title, completion
3939
;
4040

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

x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.tokens

Lines changed: 120 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugin/esql/src/main/antlr/EsqlBaseParser.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ rerankCommand
308308
;
309309

310310
completionCommand
311-
: COMPLETION prompt=primaryExpression WITH inferenceId=identifierOrParameter (AS targetField=qualifiedName)?
311+
: COMPLETION (targetField=qualifiedName ASSIGN)? prompt=primaryExpression WITH inferenceId=identifierOrParameter
312312
;
313313

314314
sampleCommand

0 commit comments

Comments
 (0)