early-shoe-82728
07/11/2024, 6:02 PMrich-battery-69172
07/11/2024, 7:31 PMprice is under {{workflow.price}}, which behind the scene will translate the prompt using GPT to a generator function that looks like AI Query generated successfully
{ query: { Price: { '$lt': 200 } },
generator: 'function (util, ...params) {
return {
// "price is under {params[0]}"
Price: { $lt: Number(params[0]) }
};
}' }
The reasoning behind this feature is to generate and cache the function, so that GPT isn't called every time you want to query the table with the same parameter types.
In your case, it's not possible to generate a generator function if the entire query is variable.
There's an alternative coming in about 2 weeks for this, but for now the only workaround is to use an execute code card and do something like this:
workflow.rows = await Data2Table.findRecords({
filter: AI.apply(this, [workflow.dynamicQuery] as any)
})
This forces the generation of a generator function every time.early-shoe-82728
07/11/2024, 9:12 PM