mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-20 19:32:15 +00:00
feat(OpenAI Node): Add a node to work with OpenAI (#4932)
* feat(OpenAI Node): Add a node to work with OpenAI * Added codex file for OpenAi node * Minor tweaks to Operation Image. * Minor tweaks to Resource Text. * Minor copy modification to Image:Create. * Removed "a Text" in Text operations names. * ⚡ Connect Response Format parameter and other improvements * ✨ Add "filter" postReceiveAction * ⚡ Rename operations and add spelling mistake again to example * ⚡ Rename another operation Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com> Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -265,7 +265,6 @@ export class RoutingNode {
|
||||
if (action.type === 'rootProperty') {
|
||||
try {
|
||||
return inputData.flatMap((item) => {
|
||||
// let itemContent = item.json[action.properties.property];
|
||||
let itemContent = get(item.json, action.properties.property);
|
||||
|
||||
if (!Array.isArray(itemContent)) {
|
||||
@@ -285,6 +284,28 @@ export class RoutingNode {
|
||||
});
|
||||
}
|
||||
}
|
||||
if (action.type === 'filter') {
|
||||
const passValue = action.properties.pass;
|
||||
|
||||
inputData = inputData.filter((item) => {
|
||||
// If the value is an expression resolve it
|
||||
return this.getParameterValue(
|
||||
passValue,
|
||||
itemIndex,
|
||||
runIndex,
|
||||
executeSingleFunctions.getExecuteData(),
|
||||
{
|
||||
$response: responseData,
|
||||
$responseItem: item.json,
|
||||
$value: parameterValue,
|
||||
$version: this.node.typeVersion,
|
||||
},
|
||||
false,
|
||||
) as boolean;
|
||||
});
|
||||
|
||||
return inputData;
|
||||
}
|
||||
if (action.type === 'limit') {
|
||||
const maxResults = this.getParameterValue(
|
||||
action.properties.maxResults,
|
||||
|
||||
Reference in New Issue
Block a user