[Inference] Prompts: reasoning mode + ES|QL prompt#226616
[Inference] Prompts: reasoning mode + ES|QL prompt#226616dgieselaar merged 9 commits intoelastic:mainfrom
Conversation
80b76ba to
228d1b0
Compare
228d1b0 to
98f23d1
Compare
…bana into inference-prompt-reasoning
|
@elasticmachine merge upstream |
| fields: '*', | ||
| index_filter: { | ||
| bool: { | ||
| filter: rangeQuery(start, end), |
There was a problem hiding this comment.
Wonder if it would be beneficial to restrict this query to certain data tiers, or exclude frozen tiers here.
There was a problem hiding this comment.
the rangeQuery will do that, based on time. It will only hit frozen/cold/warm if the data is within range - ES will pre-filter shards for data streams based on time range. It might still hit frozen if it queries a wide time range, but that's maybe more of a feature - otherwise it cannot query frozen even if the user asks for it.
| const { fields, ...meta } = analysis; | ||
| const [nonEmptyFields, emptyFields] = partition(analysis.fields, (field) => !field.empty); | ||
|
|
||
| const sortedFields = [...shuffle(nonEmptyFields), ...shuffle(emptyFields)]; |
There was a problem hiding this comment.
Can you add a comment to note why we are calling shuffle() here?
There was a problem hiding this comment.
yes! it's to get a random-ish subset of fields, so you don't end up with a-f and drop everything on the floor. (i'll add this as a comment)
x-pack/platform/packages/shared/kbn-ai-tools/src/tools/esql/esql_task_description.text
Outdated
Show resolved
Hide resolved
x-pack/platform/packages/shared/kbn-ai-tools/src/tools/esql/esql_task_description.text
Show resolved
Hide resolved
…ql_task_description.text Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
qn895
left a comment
There was a problem hiding this comment.
LGTM as we can address the remaining comments in the follow up 🎉
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Public APIs missing exports
Unknown metric groupsAPI count
History
|
Adds a utility function that will execute a Prompt (system message, user message template and tool definitions), in a way that the LLM will reason about the task and its progress and execute tools autonomously until it feels confident enough to answer the question. As an example, a reference implementation was added for answering ES|QL related questions. The utility function (`executeAsReasoningAgent`) will be used in Streams for various LLM-based workflows. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Adds a utility function that will execute a Prompt (system message, user message template and tool definitions), in a way that the LLM will reason about the task and its progress and execute tools autonomously until it feels confident enough to answer the question. As an example, a reference implementation was added for answering ES|QL related questions. The utility function (`executeAsReasoningAgent`) will be used in Streams for various LLM-based workflows. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
5 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Adds a utility function that will execute a Prompt (system message, user message template and tool definitions), in a way that the LLM will reason about the task and its progress and execute tools autonomously until it feels confident enough to answer the question. As an example, a reference implementation was added for answering ES|QL related questions. The utility function (`executeAsReasoningAgent`) will be used in Streams for various LLM-based workflows. --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Quynh Nguyen (Quinn) <43350163+qn895@users.noreply.github.com>
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
9 similar comments
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
|
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Adds a utility function that will execute a Prompt (system message, user message template and tool definitions), in a way that the LLM will reason about the task and its progress and execute tools autonomously until it feels confident enough to answer the question. As an example, a reference implementation was added for answering ES|QL related questions.
The utility function (
executeAsReasoningAgent) will be used in Streams for various LLM-based workflows.