Skip to content

Conversation

afoucret
Copy link
Contributor

@afoucret afoucret commented Apr 11, 2025

This PR implement resolution of expressions for the COMPLETION command in the Analyzer.

| COMPLETION <prompt> WITH <inferenceId> AS <targertField>
  • prompt: expression for the prompt to be send to the LLM, required
  • inferenceId: the inference id for the inference endpoint to be used, required
  • targetField: name of he output target field, optional default = completion

Work for the completion command is tracked in: #124405

PS: the command is available only for snapshot build.

@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Apr 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@afoucret afoucret mentioned this pull request Apr 11, 2025
11 tasks
}
}

public void testResolveCompletionInferenceId() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ The code that does the inference resolution is from the #123074 PR.

prompt = prompt.transformUp(UnresolvedAttribute.class, ua -> maybeResolveAttribute(ua, childrenOutput));
}

if (prompt.resolved() && DataType.isString(prompt.dataType()) == false) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ We support only text as prompt.

Copy link
Contributor

@ioanatia ioanatia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does what is says - looks good to me

@afoucret afoucret merged commit 3c29593 into elastic:main Apr 11, 2025
17 checks passed
afoucret added a commit to afoucret/elasticsearch that referenced this pull request Jun 4, 2025
* [ES|QL] COMPLETION command analysis.

* Moving prompt type test in postAnalysisVerification

* Test lint.
afoucret added a commit to afoucret/elasticsearch that referenced this pull request Jun 4, 2025
* [ES|QL] COMPLETION command analysis.

* Moving prompt type test in postAnalysisVerification

* Test lint.
@afoucret afoucret deleted the esql-completion-logical-plan-analyzer branch June 5, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL >non-issue Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants