Skip to content

[ES|QL] COMPLETION command analysis. #126677

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 11, 2025

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
9 tasks
@@ -3642,6 +3633,117 @@ public void testResolveRerankScoreField() {
}
}

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
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