- Notifications
You must be signed in to change notification settings - Fork 25.5k
Closed
Labels
:SearchOrg/RelevanceLabel for the Search (solution/org) Relevance teamLabel for the Search (solution/org) Relevance teamfeature"" muted="" aria-describedby="MDU6TGFiZWwyMzE3Mg==-tooltip :R5b96b:">>featureES|QL-uiImpacts ES|QL UIImpacts ES|QL UIMetaTeam:Search - RelevanceThe Search organization Search Relevance teamThe Search organization Search Relevance teamTeam:SearchOrgMeta label for the Search Org (Enterprise Search)Meta label for the Search Org (Enterprise Search)priority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineersv9.0.0
Description
Tracked in #123043
The completion command will be used to execute a completion through an LLM using ES}QL.
Command grammar
| COMPLETION (<targetField>=)<prompt> WITH <inferenceId>
where
param | required | description |
---|---|---|
prompt | required | Provides the prompt to be executed for the row.The prompt can be built from a mix a constant and field values. |
inferenceId | required | Endpoint used to do the completion(can be optional when we will have a default LLM in EIS). |
targetField | optionaldefault: completion | Name of the result column. |
Usage example:
Row by row
FROM search-movies | WHERE match(plot, "Gandalf the grey") | EVAL prompt= CONCAT( "Extract movie genre:\n", "<title>", title, "</title>", "<actors>", MV_CONCAT(actors, ","), "</actors">, "<plot>", plot, "</plot" ) | COMPLETION completion=prompt WITH "openai-completion" AS genre | DROP prompt
Aggregated rows:
FROM business-news | WHERE industry:technology AND date:today | EVAL company_data = CONCAT( "<title>", title, "</title>", "<summary>", summary, "</summary"> "<article>", title, "</article" ) | STATS company_data = VALUES(company_data) BY company | EVAL prompt=CONCAT( Summarize important news for the copmany\n", "<company>", company, "</company>\n", MV_CONCAT(company_data, "\n") ) | COMPLETION completion=prompt WITH "openai-completion" AS company_news
Development
Tech preview scope
- Grammar and logical plan ([ES|QL] COMPLETION command grammar and logical plan #126319)
- Logical plan analysis ([ES|QL] COMPLETION command analysis. #126677)
- Logical plan optimization ([ES|QL] COMPLETION command logical plan optimizer #126763)
- Physical plan and mapping (([ES|QL] COMPLETION command physical plan #126766)
- CompletionOperator (based on an aync operator) ([ES|QL] COMPLETION command - Inference Operator implementation #127409)
- End to end tests ([ES|QL] COMPLETION command - Inference Operator implementation #127409)
- Add telemetry
- Tech available in non-snapshot builds ([ES|QL] Enable the completion command as a tech preview feature #128948)
- ES|QL Completion command syntax change #129189
- Doc
GA scope
- Cross cluster support
Metadata
Metadata
Assignees
Labels
:SearchOrg/RelevanceLabel for the Search (solution/org) Relevance teamLabel for the Search (solution/org) Relevance teamfeature"" muted="" aria-describedby="MDU6TGFiZWwyMzE3Mg==-tooltip :Ra5pmb:">>featureES|QL-uiImpacts ES|QL UIImpacts ES|QL UIMetaTeam:Search - RelevanceThe Search organization Search Relevance teamThe Search organization Search Relevance teamTeam:SearchOrgMeta label for the Search Org (Enterprise Search)Meta label for the Search Org (Enterprise Search)priority:normalA label for assessing bug priority to be used by ES engineersA label for assessing bug priority to be used by ES engineersv9.0.0