-
Notifications
You must be signed in to change notification settings - Fork 129
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
data queries #965
data queries #965
Conversation
@@ -257,6 +257,7 @@ The `defData` function also supports functions to slice the input rows and colum | |||
- `sliceTail`, number of rows to include from the end | |||
- `sliceSample`, number of rows to pick at random | |||
- `distinct`, list of column names to deduplicate the data based on | |||
- `query`, a [jq](https://jqlang.github.io/jq/) query to filter the data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link to the jq documentation is missing a closing parenthesis. It should be https://jqlang.github.io/jq/
.
AI-generated content by pr-docs-review-commit
missing_jq_link
may be incorrect
LGTM 🚀 The changes in the Specifically:
Therefore, I approve of this PR. 😊
|
Investigator report
|
Here are the key enhancements introduced by the changes:
Introduction of JQ Support for Data Querying:
query
option to theDefDataOptions
interface, allowing users to specify a jq query to filter data before rendering. This enables more flexible and powerful data manipulation within prompts.Enhanced Public API Surface:
"packages/core/src/prompt_template.d.ts"
and"packages/core/src/prompt_type.ts"
. ThedefData
function now supports awaiting data, making it more versatile to handle asynchronous data sources.defData
.Improved Prompt Rendering:
renderDefDataNode
function. This change now dynamically handles different data structures and formats, ensuring that prompts are tailored accurately based on the provided data.Internal Logic Improvements:
resolvePromptNode
. Now, the system can more efficiently manage asynchronous data fetching and rendering.Documentation Update: