@n8n/n8n-nodes-langchain 1.90.0 → 1.91.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js +5 -1
  2. package/dist/nodes/agents/Agent/agents/ToolsAgent/execute.js.map +1 -1
  3. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js +14 -0
  4. package/dist/nodes/chains/TextClassifier/TextClassifier.node.js.map +1 -1
  5. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +5 -5
  6. package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
  7. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js +2 -1
  8. package/dist/nodes/memory/MemoryBufferWindow/MemoryBufferWindow.node.js.map +1 -1
  9. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js +2 -1
  10. package/dist/nodes/memory/MemoryMongoDbChat/MemoryMongoDbChat.node.js.map +1 -1
  11. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js +2 -1
  12. package/dist/nodes/memory/MemoryMotorhead/MemoryMotorhead.node.js.map +1 -1
  13. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js +2 -1
  14. package/dist/nodes/memory/MemoryPostgresChat/MemoryPostgresChat.node.js.map +1 -1
  15. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js +2 -1
  16. package/dist/nodes/memory/MemoryRedisChat/MemoryRedisChat.node.js.map +1 -1
  17. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js +2 -1
  18. package/dist/nodes/memory/MemoryXata/MemoryXata.node.js.map +1 -1
  19. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js +2 -1
  20. package/dist/nodes/memory/MemoryZep/MemoryZep.node.js.map +1 -1
  21. package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js +3 -1
  22. package/dist/nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.js.map +1 -1
  23. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js +64 -4
  24. package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +1 -1
  25. package/dist/nodes/vendors/OpenAi/methods/listSearch.js +1 -1
  26. package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -1
  27. package/dist/types/nodes.json +8 -8
  28. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../nodes/memory/MemoryZep/MemoryZep.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { BaseChatMemory } from '@langchain/community/dist/memory/chat_memory';\nimport { ZepMemory } from '@langchain/community/memory/zep';\nimport { ZepCloudMemory } from '@langchain/community/memory/zep_cloud';\nimport type { InputValues, MemoryVariables } from '@langchain/core/memory';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport {\n\tNodeConnectionTypes,\n\ttype ISupplyDataFunctions,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype SupplyData,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport { getSessionId } from '@utils/helpers';\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { expressionSessionKeyProperty, sessionIdOption, sessionKeyProperty } from '../descriptions';\n\n// Extend ZepCloudMemory to trim white space in messages.\nclass WhiteSpaceTrimmedZepCloudMemory extends ZepCloudMemory {\n\toverride async loadMemoryVariables(values: InputValues): Promise<MemoryVariables> {\n\t\tconst memoryVariables = await super.loadMemoryVariables(values);\n\t\tmemoryVariables.chat_history = memoryVariables.chat_history.filter((m: BaseMessage) =>\n\t\t\tm.content.toString().trim(),\n\t\t);\n\t\treturn memoryVariables;\n\t}\n}\n\nexport class MemoryZep implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Zep',\n\t\tname: 'memoryZep',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-icon-not-svg\n\t\ticon: 'file:zep.png',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdescription: 'Use Zep Memory',\n\t\tdefaults: {\n\t\t\tname: 'Zep',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Memory'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memoryzep/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiMemory],\n\t\toutputNames: ['Memory'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'zepApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Only works with Zep Cloud and Community edition <= v0.27.2',\n\t\t\t\tname: 'supportedVersions',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Session ID',\n\t\t\t\tname: 'sessionId',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Session ID',\n\t\t\t\tname: 'sessionId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '={{ $json.sessionId }}',\n\t\t\t\tdescription: 'The key to use to store the memory',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1.1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...sessionIdOption,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.2 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpressionSessionKeyProperty(1.3),\n\t\t\tsessionKeyProperty,\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst credentials = await this.getCredentials<{\n\t\t\tapiKey?: string;\n\t\t\tapiUrl?: string;\n\t\t\tcloud?: boolean;\n\t\t}>('zepApi');\n\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tlet sessionId;\n\n\t\tif (nodeVersion >= 1.2) {\n\t\t\tsessionId = getSessionId(this, itemIndex);\n\t\t} else {\n\t\t\tsessionId = this.getNodeParameter('sessionId', itemIndex) as string;\n\t\t}\n\n\t\tlet memory: BaseChatMemory;\n\n\t\tif (credentials.cloud) {\n\t\t\tif (!credentials.apiKey) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'API key is required to use Zep Cloud');\n\t\t\t}\n\t\t\tmemory = new WhiteSpaceTrimmedZepCloudMemory({\n\t\t\t\tsessionId,\n\t\t\t\tapiKey: credentials.apiKey,\n\t\t\t\tmemoryType: 'perpetual',\n\t\t\t\tmemoryKey: 'chat_history',\n\t\t\t\treturnMessages: true,\n\t\t\t\tinputKey: 'input',\n\t\t\t\toutputKey: 'output',\n\t\t\t\tseparateMessages: false,\n\t\t\t});\n\t\t} else {\n\t\t\tif (!credentials.apiUrl) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'API url is required to use Zep Open Source');\n\t\t\t}\n\t\t\tmemory = new ZepMemory({\n\t\t\t\tsessionId,\n\t\t\t\tbaseURL: credentials.apiUrl,\n\t\t\t\tapiKey: credentials.apiKey,\n\t\t\t\tmemoryKey: 'chat_history',\n\t\t\t\treturnMessages: true,\n\t\t\t\tinputKey: 'input',\n\t\t\t\toutputKey: 'output',\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\tresponse: logWrapper(memory, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAA0B;AAC1B,uBAA+B;AAG/B,0BAOO;AAEP,qBAA6B;AAC7B,wBAA2B;AAC3B,0BAA6C;AAE7C,0BAAkF;AAGlF,MAAM,wCAAwC,gCAAe;AAAA,EAC5D,MAAe,oBAAoB,QAA+C;AACjF,UAAM,kBAAkB,MAAM,MAAM,oBAAoB,MAAM;AAC9D,oBAAgB,eAAe,gBAAgB,aAAa;AAAA,MAAO,CAAC,MACnE,EAAE,QAAQ,SAAS,EAAE,KAAK;AAAA,IAC3B;AACA,WAAO;AAAA,EACR;AACD;AAEO,MAAM,UAA+B;AAAA,EAArC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA;AAAA,MAEN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,GAAG,KAAK,KAAK,GAAG;AAAA,MAC1B,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAAA,QACN,YAAY,CAAC,IAAI;AAAA,QACjB,eAAe;AAAA,UACd,IAAI,CAAC,QAAQ;AAAA,QACd;AAAA,QACA,WAAW;AAAA,UACV,sBAAsB;AAAA,YACrB;AAAA,cACC,KAAK;AAAA,YACN;AAAA,UACD;AAAA,QACD;AAAA,MACD;AAAA;AAAA,MAEA,QAAQ,CAAC;AAAA;AAAA,MAET,SAAS,CAAC,wCAAoB,QAAQ;AAAA,MACtC,aAAa,CAAC,QAAQ;AAAA,M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F;AACA,eAAS,IAAI,gCAAgC;AAAA,QAC5C;AAAA,QACA,QAAQ,YAAY;AAAA,QACpB,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,WAAW;AAAA,QACX,kBAAkB;AAAA,MACnB,CAAC;AAAA,IACF,OAAO;AACN,UAAI,CAAC,YAAY,QAAQ;AACxB,cAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,4CAA4C;AAAA,MAC1F;AACA,eAAS,IAAI,qBAAU;AAAA,QACtB;AAAA,QACA,SAAS,YAAY;AAAA,QACrB,QAAQ,YAAY;AAAA,QACpB,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,WAAW;AAAA,MACZ,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,MACN,cAAU,8BAAW,QAAQ,IAAI;AAAA,IAClC;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../nodes/memory/MemoryZep/MemoryZep.node.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-dirname-against-convention */\nimport type { BaseChatMemory } from '@langchain/community/dist/memory/chat_memory';\nimport { ZepMemory } from '@langchain/community/memory/zep';\nimport { ZepCloudMemory } from '@langchain/community/memory/zep_cloud';\nimport type { InputValues, MemoryVariables } from '@langchain/core/memory';\nimport type { BaseMessage } from '@langchain/core/messages';\nimport {\n\tNodeConnectionTypes,\n\ttype ISupplyDataFunctions,\n\ttype INodeType,\n\ttype INodeTypeDescription,\n\ttype SupplyData,\n\tNodeOperationError,\n} from 'n8n-workflow';\n\nimport { getSessionId } from '@utils/helpers';\nimport { logWrapper } from '@utils/logWrapper';\nimport { getConnectionHintNoticeField } from '@utils/sharedFields';\n\nimport { expressionSessionKeyProperty, sessionIdOption, sessionKeyProperty } from '../descriptions';\n\n// Extend ZepCloudMemory to trim white space in messages.\nclass WhiteSpaceTrimmedZepCloudMemory extends ZepCloudMemory {\n\toverride async loadMemoryVariables(values: InputValues): Promise<MemoryVariables> {\n\t\tconst memoryVariables = await super.loadMemoryVariables(values);\n\t\tmemoryVariables.chat_history = memoryVariables.chat_history.filter((m: BaseMessage) =>\n\t\t\tm.content.toString().trim(),\n\t\t);\n\t\treturn memoryVariables;\n\t}\n}\n\nexport class MemoryZep implements INodeType {\n\tdescription: INodeTypeDescription = {\n\t\tdisplayName: 'Zep',\n\t\tname: 'memoryZep',\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-icon-not-svg\n\t\ticon: 'file:zep.png',\n\t\tgroup: ['transform'],\n\t\tversion: [1, 1.1, 1.2, 1.3],\n\t\tdescription: 'Use Zep Memory',\n\t\tdefaults: {\n\t\t\tname: 'Zep',\n\t\t},\n\t\tcodex: {\n\t\t\tcategories: ['AI'],\n\t\t\tsubcategories: {\n\t\t\t\tAI: ['Memory'],\n\t\t\t\tMemory: ['Other memories'],\n\t\t\t},\n\t\t\tresources: {\n\t\t\t\tprimaryDocumentation: [\n\t\t\t\t\t{\n\t\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memoryzep/',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-inputs-wrong-regular-node\n\t\tinputs: [],\n\t\t// eslint-disable-next-line n8n-nodes-base/node-class-description-outputs-wrong\n\t\toutputs: [NodeConnectionTypes.AiMemory],\n\t\toutputNames: ['Memory'],\n\t\tcredentials: [\n\t\t\t{\n\t\t\t\tname: 'zepApi',\n\t\t\t\trequired: true,\n\t\t\t},\n\t\t],\n\t\tproperties: [\n\t\t\tgetConnectionHintNoticeField([NodeConnectionTypes.AiAgent]),\n\t\t\t{\n\t\t\t\tdisplayName: 'Only works with Zep Cloud and Community edition <= v0.27.2',\n\t\t\t\tname: 'supportedVersions',\n\t\t\t\ttype: 'notice',\n\t\t\t\tdefault: '',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Session ID',\n\t\t\t\tname: 'sessionId',\n\t\t\t\ttype: 'string',\n\t\t\t\trequired: true,\n\t\t\t\tdefault: '',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Session ID',\n\t\t\t\tname: 'sessionId',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: '={{ $json.sessionId }}',\n\t\t\t\tdescription: 'The key to use to store the memory',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [1.1],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t...sessionIdOption,\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.2 } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpressionSessionKeyProperty(1.3),\n\t\t\tsessionKeyProperty,\n\t\t],\n\t};\n\n\tasync supplyData(this: ISupplyDataFunctions, itemIndex: number): Promise<SupplyData> {\n\t\tconst credentials = await this.getCredentials<{\n\t\t\tapiKey?: string;\n\t\t\tapiUrl?: string;\n\t\t\tcloud?: boolean;\n\t\t}>('zepApi');\n\n\t\tconst nodeVersion = this.getNode().typeVersion;\n\n\t\tlet sessionId;\n\n\t\tif (nodeVersion >= 1.2) {\n\t\t\tsessionId = getSessionId(this, itemIndex);\n\t\t} else {\n\t\t\tsessionId = this.getNodeParameter('sessionId', itemIndex) as string;\n\t\t}\n\n\t\tlet memory: BaseChatMemory;\n\n\t\tif (credentials.cloud) {\n\t\t\tif (!credentials.apiKey) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'API key is required to use Zep Cloud');\n\t\t\t}\n\t\t\tmemory = new WhiteSpaceTrimmedZepCloudMemory({\n\t\t\t\tsessionId,\n\t\t\t\tapiKey: credentials.apiKey,\n\t\t\t\tmemoryType: 'perpetual',\n\t\t\t\tmemoryKey: 'chat_history',\n\t\t\t\treturnMessages: true,\n\t\t\t\tinputKey: 'input',\n\t\t\t\toutputKey: 'output',\n\t\t\t\tseparateMessages: false,\n\t\t\t});\n\t\t} else {\n\t\t\tif (!credentials.apiUrl) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'API url is required to use Zep Open Source');\n\t\t\t}\n\t\t\tmemory = new ZepMemory({\n\t\t\t\tsessionId,\n\t\t\t\tbaseURL: credentials.apiUrl,\n\t\t\t\tapiKey: credentials.apiKey,\n\t\t\t\tmemoryKey: 'chat_history',\n\t\t\t\treturnMessages: true,\n\t\t\t\tinputKey: 'input',\n\t\t\t\toutputKey: 'output',\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\tresponse: logWrapper(memory, this),\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAA0B;AAC1B,uBAA+B;AAG/B,0BAOO;AAEP,qBAA6B;AAC7B,wBAA2B;AAC3B,0BAA6C;AAE7C,0BAAkF;AAGlF,MAAM,wCAAwC,gCAAe;AAAA,EAC5D,MAAe,oBAAoB,QAA+C;AACjF,UAAM,kBAAkB,MAAM,MAAM,oBAAoB,MAAM;AAC9D,oBAAgB,eAAe,gBAAgB,aAAa;AAAA,MAAO,CAAC,MACnE,EAAE,QAAQ,SAAS,EAAE,KAAK;AAAA,IAC3B;AACA,WAAO;AAAA,EACR;AACD;AAEO,MAAM,UAA+B;AAAA,EAArC;AACN,uBAAoC;AAAA,MACnC,aAAa;AAAA,MACb,MAAM;AAAA;AAAA,MAEN,MAAM;AAAA,MACN,OAAO,CAAC,WAAW;AAAA,MACnB,SAAS,CAAC,GAAG,KAAK,KAAK,GAAG;AAAA,MAC1B,aAAa;AAAA,MACb,UAAU;AAAA,QACT,MAAM;AAAA,MACP;AAAA,MACA,OAAO;AAA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cAAc,MAAM,KAAK,eAI5B,QAAQ;AAEX,UAAM,cAAc,KAAK,QAAQ,EAAE;AAEnC,QAAI;AAEJ,QAAI,eAAe,KAAK;AACvB,sBAAY,6BAAa,MAAM,SAAS;AAAA,IACzC,OAAO;AACN,kBAAY,KAAK,iBAAiB,aAAa,SAAS;AAAA,IACzD;AAEA,QAAI;AAEJ,QAAI,YAAY,OAAO;AACtB,UAAI,CAAC,YAAY,QAAQ;AACxB,cAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,sCAAsC;AAAA,MACpF;AACA,eAAS,IAAI,gCAAgC;AAAA,QAC5C;AAAA,QACA,QAAQ,YAAY;AAAA,QACpB,YAAY;AAAA,QACZ,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,WAAW;AAAA,QACX,kBAAkB;AAAA,MACnB,CAAC;AAAA,IACF,OAAO;AACN,UAAI,CAAC,YAAY,QAAQ;AACxB,cAAM,IAAI,uCAAmB,KAAK,QAAQ,GAAG,4CAA4C;AAAA,MAC1F;AACA,eAAS,IAAI,qBAAU;AAAA,QACtB;AAAA,QACA,SAAS,YAAY;AAAA,QACrB,QAAQ,YAAY;AAAA,QACpB,WAAW;AAAA,QACX,gBAAgB;AAAA,QAChB,UAAU;AAAA,QACV,WAAW;AAAA,MACZ,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,MACN,cAAU,8BAAW,QAAQ,IAAI;AAAA,IAClC;AAAA,EACD;AACD;","names":[]}
@@ -26,7 +26,9 @@ async function loadSubWorkflowInputs() {
26
26
  const { fields, subworkflowInfo, dataMode } = await import_GenericFunctions.loadWorkflowInputMappings.bind(this)();
27
27
  let emptyFieldsNotice;
28
28
  if (fields.length === 0) {
29
- const subworkflowLink = subworkflowInfo?.id ? `<a href="/workflow/${subworkflowInfo?.id}" target="_blank">sub-workflow\u2019s trigger</a>` : "sub-workflow\u2019s trigger";
29
+ const { triggerId, workflowId } = subworkflowInfo ?? {};
30
+ const path = (workflowId ?? "") + (triggerId ? `/${triggerId.slice(0, 6)}` : "");
31
+ const subworkflowLink = workflowId ? `<a href="/workflow/${path}" target="_blank">sub-workflow\u2019s trigger</a>` : "sub-workflow\u2019s trigger";
30
32
  switch (dataMode) {
31
33
  case "passthrough":
32
34
  emptyFieldsNotice = `This sub-workflow is set up to receive all input data, without specific inputs the Agent will not be able to pass data to this tool. You can define specific inputs in the ${subworkflowLink}.`;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.ts"],"sourcesContent":["import { loadWorkflowInputMappings } from 'n8n-nodes-base/dist/utils/workflowInputsResourceMapping/GenericFunctions';\nimport type { ILocalLoadOptionsFunctions, ResourceMapperFields } from 'n8n-workflow';\n\nexport async function loadSubWorkflowInputs(\n\tthis: ILocalLoadOptionsFunctions,\n): Promise<ResourceMapperFields> {\n\tconst { fields, subworkflowInfo, dataMode } = await loadWorkflowInputMappings.bind(this)();\n\tlet emptyFieldsNotice: string | undefined;\n\tif (fields.length === 0) {\n\t\tconst subworkflowLink = subworkflowInfo?.id\n\t\t\t? `<a href=\"/workflow/${subworkflowInfo?.id}\" target=\"_blank\">sub-workflow’s trigger</a>`\n\t\t\t: 'sub-workflow’s trigger';\n\n\t\tswitch (dataMode) {\n\t\t\tcase 'passthrough':\n\t\t\t\temptyFieldsNotice = `This sub-workflow is set up to receive all input data, without specific inputs the Agent will not be able to pass data to this tool. You can define specific inputs in the ${subworkflowLink}.`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\temptyFieldsNotice = `This sub-workflow will not receive any input when called by your AI node. Define your expected input in the ${subworkflowLink}.`;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn { fields, emptyFieldsNotice };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA0C;AAG1C,eAAsB,wBAEW;AAChC,QAAM,EAAE,QAAQ,iBAAiB,SAAS,IAAI,MAAM,kDAA0B,KAAK,IAAI,EAAE;AACzF,MAAI;AACJ,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,kBAAkB,iBAAiB,KACtC,sBAAsB,iBAAiB,EAAE,sDACzC;AAEH,YAAQ,UAAU;AAAA,MACjB,KAAK;AACJ,4BAAoB,8KAA8K,eAAe;AACjN;AAAA,MACD;AACC,4BAAoB,+GAA+G,eAAe;AAClJ;AAAA,IACF;AAAA,EACD;AACA,SAAO,EAAE,QAAQ,kBAAkB;AACpC;","names":[]}
1
+ {"version":3,"sources":["../../../../../../nodes/tools/ToolWorkflow/v2/methods/localResourceMapping.ts"],"sourcesContent":["import { loadWorkflowInputMappings } from 'n8n-nodes-base/dist/utils/workflowInputsResourceMapping/GenericFunctions';\nimport type { ILocalLoadOptionsFunctions, ResourceMapperFields } from 'n8n-workflow';\n\nexport async function loadSubWorkflowInputs(\n\tthis: ILocalLoadOptionsFunctions,\n): Promise<ResourceMapperFields> {\n\tconst { fields, subworkflowInfo, dataMode } = await loadWorkflowInputMappings.bind(this)();\n\tlet emptyFieldsNotice: string | undefined;\n\tif (fields.length === 0) {\n\t\tconst { triggerId, workflowId } = subworkflowInfo ?? {};\n\t\tconst path = (workflowId ?? '') + (triggerId ? `/${triggerId.slice(0, 6)}` : '');\n\t\tconst subworkflowLink = workflowId\n\t\t\t? `<a href=\"/workflow/${path}\" target=\"_blank\">sub-workflow’s trigger</a>`\n\t\t\t: 'sub-workflow’s trigger';\n\n\t\tswitch (dataMode) {\n\t\t\tcase 'passthrough':\n\t\t\t\temptyFieldsNotice = `This sub-workflow is set up to receive all input data, without specific inputs the Agent will not be able to pass data to this tool. You can define specific inputs in the ${subworkflowLink}.`;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\temptyFieldsNotice = `This sub-workflow will not receive any input when called by your AI node. Define your expected input in the ${subworkflowLink}.`;\n\t\t\t\tbreak;\n\t\t}\n\t}\n\treturn { fields, emptyFieldsNotice };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAA0C;AAG1C,eAAsB,wBAEW;AAChC,QAAM,EAAE,QAAQ,iBAAiB,SAAS,IAAI,MAAM,kDAA0B,KAAK,IAAI,EAAE;AACzF,MAAI;AACJ,MAAI,OAAO,WAAW,GAAG;AACxB,UAAM,EAAE,WAAW,WAAW,IAAI,mBAAmB,CAAC;AACtD,UAAM,QAAQ,cAAc,OAAO,YAAY,IAAI,UAAU,MAAM,GAAG,CAAC,CAAC,KAAK;AAC7E,UAAM,kBAAkB,aACrB,sBAAsB,IAAI,sDAC1B;AAEH,YAAQ,UAAU;AAAA,MACjB,KAAK;AACJ,4BAAoB,8KAA8K,eAAe;AACjN;AAAA,MACD;AACC,4BAAoB,+GAA+G,eAAe;AAClJ;AAAA,IACF;AAAA,EACD;AACA,SAAO,EAAE,QAAQ,kBAAkB;AACpC;","names":[]}
@@ -33,12 +33,16 @@ const properties = [
33
33
  description: "The model to use for image generation",
34
34
  options: [
35
35
  {
36
- name: "DALL-E-2",
36
+ name: "DALL\xB7E 2",
37
37
  value: "dall-e-2"
38
38
  },
39
39
  {
40
- name: "DALL-E-3",
40
+ name: "DALL\xB7E 3",
41
41
  value: "dall-e-3"
42
+ },
43
+ {
44
+ name: "GPT Image 1",
45
+ value: "gpt-image-1"
42
46
  }
43
47
  ]
44
48
  },
@@ -78,7 +82,7 @@ const properties = [
78
82
  },
79
83
  {
80
84
  displayName: "Quality",
81
- name: "quality",
85
+ name: "dalleQuality",
82
86
  type: "options",
83
87
  description: "The quality of the image that will be generated, HD creates images with finer details and greater consistency across the image",
84
88
  options: [
@@ -98,6 +102,32 @@ const properties = [
98
102
  },
99
103
  default: "standard"
100
104
  },
105
+ {
106
+ displayName: "Quality",
107
+ name: "quality",
108
+ type: "options",
109
+ description: "The quality of the image that will be generated, High creates images with finer details and greater consistency across the image",
110
+ options: [
111
+ {
112
+ name: "High",
113
+ value: "high"
114
+ },
115
+ {
116
+ name: "Medium",
117
+ value: "medium"
118
+ },
119
+ {
120
+ name: "Low",
121
+ value: "low"
122
+ }
123
+ ],
124
+ displayOptions: {
125
+ show: {
126
+ "/model": ["gpt-image-1"]
127
+ }
128
+ },
129
+ default: "medium"
130
+ },
101
131
  {
102
132
  displayName: "Resolution",
103
133
  name: "size",
@@ -148,6 +178,31 @@ const properties = [
148
178
  },
149
179
  default: "1024x1024"
150
180
  },
181
+ {
182
+ displayName: "Resolution",
183
+ name: "size",
184
+ type: "options",
185
+ options: [
186
+ {
187
+ name: "1024x1024",
188
+ value: "1024x1024"
189
+ },
190
+ {
191
+ name: "1024x1536",
192
+ value: "1024x1536"
193
+ },
194
+ {
195
+ name: "1536x1024",
196
+ value: "1536x1024"
197
+ }
198
+ ],
199
+ displayOptions: {
200
+ show: {
201
+ "/model": ["gpt-image-1"]
202
+ }
203
+ },
204
+ default: "1024x1024"
205
+ },
151
206
  {
152
207
  displayName: "Style",
153
208
  name: "style",
@@ -213,11 +268,16 @@ async function execute(i) {
213
268
  binaryPropertyOutput = options.binaryPropertyOutput;
214
269
  delete options.binaryPropertyOutput;
215
270
  }
271
+ if (options.dalleQuality) {
272
+ options.quality = options.dalleQuality;
273
+ delete options.dalleQuality;
274
+ }
216
275
  delete options.returnImageUrls;
217
276
  const body = {
218
277
  prompt,
219
278
  model,
220
- response_format,
279
+ response_format: model !== "gpt-image-1" ? response_format : void 0,
280
+ // gpt-image-1 does not support response_format
221
281
  ...options
222
282
  };
223
283
  const { data } = await import_transport.apiRequest.call(this, "POST", "/images/generations", { body });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../nodes/vendors/OpenAi/actions/image/generate.operation.ts"],"sourcesContent":["import type {\n\tINodeProperties,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n} from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { apiRequest } from '../../transport';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Model',\n\t\tname: 'model',\n\t\ttype: 'options',\n\t\tdefault: 'dall-e-3',\n\t\tdescription: 'The model to use for image generation',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'DALL-E-2',\n\t\t\t\tvalue: 'dall-e-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'DALL-E-3',\n\t\t\t\tvalue: 'dall-e-3',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. A cute cat eating a dinosaur',\n\t\tdescription:\n\t\t\t'A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.',\n\t\tdefault: '',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\tplaceholder: 'Add Option',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Number of Images',\n\t\t\t\tname: 'n',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'Number of images to generate',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tmaxValue: 10,\n\t\t\t\t},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-2'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Quality',\n\t\t\t\tname: 'quality',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription:\n\t\t\t\t\t'The quality of the image that will be generated, HD creates images with finer details and greater consistency across the image',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'HD',\n\t\t\t\t\t\tvalue: 'hd',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Standard',\n\t\t\t\t\t\tvalue: 'standard',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-3'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'standard',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Resolution',\n\t\t\t\tname: 'size',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '256x256',\n\t\t\t\t\t\tvalue: '256x256',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '512x512',\n\t\t\t\t\t\tvalue: '512x512',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1024',\n\t\t\t\t\t\tvalue: '1024x1024',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-2'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '1024x1024',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Resolution',\n\t\t\t\tname: 'size',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1024',\n\t\t\t\t\t\tvalue: '1024x1024',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1792x1024',\n\t\t\t\t\t\tvalue: '1792x1024',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1792',\n\t\t\t\t\t\tvalue: '1024x1792',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-3'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '1024x1024',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Style',\n\t\t\t\tname: 'style',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Natural',\n\t\t\t\t\t\tvalue: 'natural',\n\t\t\t\t\t\tdescription: 'Produce more natural looking images',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Vivid',\n\t\t\t\t\t\tvalue: 'vivid',\n\t\t\t\t\t\tdescription: 'Lean towards generating hyper-real and dramatic images',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-3'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'vivid',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Respond with Image URL(s)',\n\t\t\t\tname: 'returnImageUrls',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: 'Whether to return image URL(s) instead of binary file(s)',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Put Output in Field',\n\t\t\t\tname: 'binaryPropertyOutput',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'data',\n\t\t\t\thint: 'The name of the output field to put the binary file data in',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\treturnImageUrls: [false],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['generate'],\n\t\tresource: ['image'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst model = this.getNodeParameter('model', i) as string;\n\tconst prompt = this.getNodeParameter('prompt', i) as string;\n\tconst options = this.getNodeParameter('options', i, {});\n\tlet response_format = 'b64_json';\n\tlet binaryPropertyOutput = 'data';\n\n\tif (options.returnImageUrls) {\n\t\tresponse_format = 'url';\n\t}\n\n\tif (options.binaryPropertyOutput) {\n\t\tbinaryPropertyOutput = options.binaryPropertyOutput as string;\n\t\tdelete options.binaryPropertyOutput;\n\t}\n\n\tdelete options.returnImageUrls;\n\n\tconst body: IDataObject = {\n\t\tprompt,\n\t\tmodel,\n\t\tresponse_format,\n\t\t...options,\n\t};\n\n\tconst { data } = await apiRequest.call(this, 'POST', '/images/generations', { body });\n\n\tif (response_format === 'url') {\n\t\treturn ((data as IDataObject[]) || []).map((entry) => ({\n\t\t\tjson: entry,\n\t\t\tpairedItem: { item: i },\n\t\t}));\n\t} else {\n\t\tconst returnData: INodeExecutionData[] = [];\n\n\t\tfor (const entry of data) {\n\t\t\tconst binaryData = await this.helpers.prepareBinaryData(\n\t\t\t\tBuffer.from(entry.b64_json as string, 'base64'),\n\t\t\t\t'data',\n\t\t\t);\n\t\t\treturnData.push({\n\t\t\t\tjson: Object.assign({}, binaryData, {\n\t\t\t\t\tdata: undefined,\n\t\t\t\t}),\n\t\t\t\tbinary: {\n\t\t\t\t\t[binaryPropertyOutput]: binaryData,\n\t\t\t\t},\n\t\t\t\tpairedItem: { item: i },\n\t\t\t});\n\t\t}\n\n\t\treturn returnData;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAAqC;AAErC,uBAA2B;AAE3B,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,IACD;AAAA,EACD;AAAA,EACA;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,IACb,aACC;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AU,CAAC;AAChD,QAAM,UAAU,KAAK,iBAAiB,WAAW,GAAG,CAAC,CAAC;AACtD,MAAI,kBAAkB;AACtB,MAAI,uBAAuB;AAE3B,MAAI,QAAQ,iBAAiB;AAC5B,sBAAkB;AAAA,EACnB;AAEA,MAAI,QAAQ,sBAAsB;AACjC,2BAAuB,QAAQ;AAC/B,WAAO,QAAQ;AAAA,EAChB;AAEA,SAAO,QAAQ;AAEf,QAAM,OAAoB;AAAA,IACzB;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACJ;AAEA,QAAM,EAAE,KAAK,IAAI,MAAM,4BAAW,KAAK,MAAM,QAAQ,uBAAuB,EAAE,KAAK,CAAC;AAEpF,MAAI,oBAAoB,OAAO;AAC9B,YAAS,QAA0B,CAAC,GAAG,IAAI,CAAC,WAAW;AAAA,MACtD,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB,EAAE;AAAA,EACH,OAAO;AACN,UAAM,aAAmC,CAAC;AAE1C,eAAW,SAAS,MAAM;AACzB,YAAM,aAAa,MAAM,KAAK,QAAQ;AAAA,QACrC,OAAO,KAAK,MAAM,UAAoB,QAAQ;AAAA,QAC9C;AAAA,MACD;AACA,iBAAW,KAAK;AAAA,QACf,MAAM,OAAO,OAAO,CAAC,GAAG,YAAY;AAAA,UACnC,MAAM;AAAA,QACP,CAAC;AAAA,QACD,QAAQ;AAAA,UACP,CAAC,oBAAoB,GAAG;AAAA,QACzB;AAAA,QACA,YAAY,EAAE,MAAM,EAAE;AAAA,MACvB,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../../nodes/vendors/OpenAi/actions/image/generate.operation.ts"],"sourcesContent":["import type {\n\tINodeProperties,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n} from 'n8n-workflow';\nimport { updateDisplayOptions } from 'n8n-workflow';\n\nimport { apiRequest } from '../../transport';\n\nconst properties: INodeProperties[] = [\n\t{\n\t\tdisplayName: 'Model',\n\t\tname: 'model',\n\t\ttype: 'options',\n\t\tdefault: 'dall-e-3',\n\t\tdescription: 'The model to use for image generation',\n\t\toptions: [\n\t\t\t{\n\t\t\t\tname: 'DALL·E 2',\n\t\t\t\tvalue: 'dall-e-2',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'DALL·E 3',\n\t\t\t\tvalue: 'dall-e-3',\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'GPT Image 1',\n\t\t\t\tvalue: 'gpt-image-1',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Prompt',\n\t\tname: 'prompt',\n\t\ttype: 'string',\n\t\tplaceholder: 'e.g. A cute cat eating a dinosaur',\n\t\tdescription:\n\t\t\t'A text description of the desired image(s). The maximum length is 1000 characters for dall-e-2 and 4000 characters for dall-e-3.',\n\t\tdefault: '',\n\t\ttypeOptions: {\n\t\t\trows: 2,\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Options',\n\t\tname: 'options',\n\t\tplaceholder: 'Add Option',\n\t\ttype: 'collection',\n\t\tdefault: {},\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Number of Images',\n\t\t\t\tname: 'n',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription: 'Number of images to generate',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tminValue: 1,\n\t\t\t\t\tmaxValue: 10,\n\t\t\t\t},\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-2'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Quality',\n\t\t\t\tname: 'dalleQuality',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription:\n\t\t\t\t\t'The quality of the image that will be generated, HD creates images with finer details and greater consistency across the image',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'HD',\n\t\t\t\t\t\tvalue: 'hd',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Standard',\n\t\t\t\t\t\tvalue: 'standard',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-3'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'standard',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Quality',\n\t\t\t\tname: 'quality',\n\t\t\t\ttype: 'options',\n\t\t\t\tdescription:\n\t\t\t\t\t'The quality of the image that will be generated, High creates images with finer details and greater consistency across the image',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'High',\n\t\t\t\t\t\tvalue: 'high',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Medium',\n\t\t\t\t\t\tvalue: 'medium',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Low',\n\t\t\t\t\t\tvalue: 'low',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['gpt-image-1'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'medium',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Resolution',\n\t\t\t\tname: 'size',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '256x256',\n\t\t\t\t\t\tvalue: '256x256',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '512x512',\n\t\t\t\t\t\tvalue: '512x512',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1024',\n\t\t\t\t\t\tvalue: '1024x1024',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-2'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '1024x1024',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Resolution',\n\t\t\t\tname: 'size',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1024',\n\t\t\t\t\t\tvalue: '1024x1024',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1792x1024',\n\t\t\t\t\t\tvalue: '1792x1024',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1792',\n\t\t\t\t\t\tvalue: '1024x1792',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-3'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '1024x1024',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Resolution',\n\t\t\t\tname: 'size',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1024',\n\t\t\t\t\t\tvalue: '1024x1024',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1024x1536',\n\t\t\t\t\t\tvalue: '1024x1536',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: '1536x1024',\n\t\t\t\t\t\tvalue: '1536x1024',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['gpt-image-1'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: '1024x1024',\n\t\t\t},\n\n\t\t\t{\n\t\t\t\tdisplayName: 'Style',\n\t\t\t\tname: 'style',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Natural',\n\t\t\t\t\t\tvalue: 'natural',\n\t\t\t\t\t\tdescription: 'Produce more natural looking images',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'Vivid',\n\t\t\t\t\t\tvalue: 'vivid',\n\t\t\t\t\t\tdescription: 'Lean towards generating hyper-real and dramatic images',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'/model': ['dall-e-3'],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tdefault: 'vivid',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Respond with Image URL(s)',\n\t\t\t\tname: 'returnImageUrls',\n\t\t\t\ttype: 'boolean',\n\t\t\t\tdefault: false,\n\t\t\t\tdescription: 'Whether to return image URL(s) instead of binary file(s)',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Put Output in Field',\n\t\t\t\tname: 'binaryPropertyOutput',\n\t\t\t\ttype: 'string',\n\t\t\t\tdefault: 'data',\n\t\t\t\thint: 'The name of the output field to put the binary file data in',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\treturnImageUrls: [false],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t},\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['generate'],\n\t\tresource: ['image'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst model = this.getNodeParameter('model', i) as string;\n\tconst prompt = this.getNodeParameter('prompt', i) as string;\n\tconst options = this.getNodeParameter('options', i, {});\n\tlet response_format = 'b64_json';\n\tlet binaryPropertyOutput = 'data';\n\n\tif (options.returnImageUrls) {\n\t\tresponse_format = 'url';\n\t}\n\n\tif (options.binaryPropertyOutput) {\n\t\tbinaryPropertyOutput = options.binaryPropertyOutput as string;\n\t\tdelete options.binaryPropertyOutput;\n\t}\n\n\tif (options.dalleQuality) {\n\t\toptions.quality = options.dalleQuality;\n\t\tdelete options.dalleQuality;\n\t}\n\n\tdelete options.returnImageUrls;\n\tconst body: IDataObject = {\n\t\tprompt,\n\t\tmodel,\n\t\tresponse_format: model !== 'gpt-image-1' ? response_format : undefined, // gpt-image-1 does not support response_format\n\t\t...options,\n\t};\n\n\tconst { data } = await apiRequest.call(this, 'POST', '/images/generations', { body });\n\tif (response_format === 'url') {\n\t\treturn ((data as IDataObject[]) || []).map((entry) => ({\n\t\t\tjson: entry,\n\t\t\tpairedItem: { item: i },\n\t\t}));\n\t} else {\n\t\tconst returnData: INodeExecutionData[] = [];\n\n\t\tfor (const entry of data) {\n\t\t\tconst binaryData = await this.helpers.prepareBinaryData(\n\t\t\t\tBuffer.from(entry.b64_json as string, 'base64'),\n\t\t\t\t'data',\n\t\t\t);\n\t\t\treturnData.push({\n\t\t\t\tjson: Object.assign({}, binaryData, {\n\t\t\t\t\tdata: undefined,\n\t\t\t\t}),\n\t\t\t\tbinary: {\n\t\t\t\t\t[binaryPropertyOutput]: binaryData,\n\t\t\t\t},\n\t\t\t\tpairedItem: { item: i },\n\t\t\t});\n\t\t}\n\n\t\treturn returnData;\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,0BAAqC;AAErC,uBAA2B;AAE3B,MAAM,aAAgC;AAAA,EACrC;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,aAAa;AAAA,IACb,SAAS;AAAA,MACR;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QACC,MAAM;AAAA,QACN,OAAO;AAAA,MACR;AAAA,MACA;AAAA,QAC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A,EAChB;AAEA,SAAO,QAAQ;AACf,QAAM,OAAoB;AAAA,IACzB;AAAA,IACA;AAAA,IACA,iBAAiB,UAAU,gBAAgB,kBAAkB;AAAA;AAAA,IAC7D,GAAG;AAAA,EACJ;AAEA,QAAM,EAAE,KAAK,IAAI,MAAM,4BAAW,KAAK,MAAM,QAAQ,uBAAuB,EAAE,KAAK,CAAC;AACpF,MAAI,oBAAoB,OAAO;AAC9B,YAAS,QAA0B,CAAC,GAAG,IAAI,CAAC,WAAW;AAAA,MACtD,MAAM;AAAA,MACN,YAAY,EAAE,MAAM,EAAE;AAAA,IACvB,EAAE;AAAA,EACH,OAAO;AACN,UAAM,aAAmC,CAAC;AAE1C,eAAW,SAAS,MAAM;AACzB,YAAM,aAAa,MAAM,KAAK,QAAQ;AAAA,QACrC,OAAO,KAAK,MAAM,UAAoB,QAAQ;AAAA,QAC9C;AAAA,MACD;AACA,iBAAW,KAAK;AAAA,QACf,MAAM,OAAO,OAAO,CAAC,GAAG,YAAY;AAAA,UACnC,MAAM;AAAA,QACP,CAAC;AAAA,QACD,QAAQ;AAAA,UACP,CAAC,oBAAoB,GAAG;AAAA,QACzB;AAAA,QACA,YAAY,EAAE,MAAM,EAAE;AAAA,MACvB,CAAC;AAAA,IACF;AAEA,WAAO;AAAA,EACR;AACD;","names":[]}
@@ -78,7 +78,7 @@ async function modelSearch(filter) {
78
78
  const url = credentials.url && new URL(credentials.url);
79
79
  const isCustomAPI = url && url.hostname !== "api.openai.com";
80
80
  return await getModelSearch(
81
- (model) => isCustomAPI || model.id.startsWith("gpt-") || model.id.startsWith("ft:") || model.id.startsWith("o1") || model.id.startsWith("o3")
81
+ (model) => !isCustomAPI && !(model.id.startsWith("babbage") || model.id.startsWith("davinci") || model.id.startsWith("computer-use") || model.id.startsWith("dall-e") || model.id.startsWith("text-embedding") || model.id.startsWith("tts") || model.id.startsWith("whisper") || model.id.startsWith("omni-moderation") || model.id.startsWith("gpt-") && model.id.includes("instruct"))
82
82
  )(this, filter);
83
83
  }
84
84
  async function imageModelSearch(filter) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../nodes/vendors/OpenAi/methods/listSearch.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tILoadOptionsFunctions,\n\tINodeListSearchItems,\n\tINodeListSearchResult,\n} from 'n8n-workflow';\nimport type { Assistant } from 'openai/resources/beta/assistants';\nimport type { Model } from 'openai/resources/models';\n\nimport { apiRequest } from '../transport';\n\nexport async function fileSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\tconst { data } = await apiRequest.call(this, 'GET', '/files');\n\n\tif (filter) {\n\t\tconst results: INodeListSearchItems[] = [];\n\n\t\tfor (const file of data || []) {\n\t\t\tif ((file.filename as string)?.toLowerCase().includes(filter.toLowerCase())) {\n\t\t\t\tresults.push({\n\t\t\t\t\tname: file.filename as string,\n\t\t\t\t\tvalue: file.id as string,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tresults,\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tresults: (data || []).map((file: IDataObject) => ({\n\t\t\t\tname: file.filename as string,\n\t\t\t\tvalue: file.id as string,\n\t\t\t})),\n\t\t};\n\t}\n}\n\nconst getModelSearch =\n\t(filterCondition: (model: Model) => boolean) =>\n\tasync (ctx: ILoadOptionsFunctions, filter?: string): Promise<INodeListSearchResult> => {\n\t\tlet { data } = (await apiRequest.call(ctx, 'GET', '/models')) as { data: Model[] };\n\n\t\tdata = data?.filter((model) => filterCondition(model));\n\n\t\tlet results: INodeListSearchItems[] = [];\n\n\t\tif (filter) {\n\t\t\tfor (const model of data || []) {\n\t\t\t\tif (model.id?.toLowerCase().includes(filter.toLowerCase())) {\n\t\t\t\t\tresults.push({\n\t\t\t\t\t\tname: model.id.toUpperCase(),\n\t\t\t\t\t\tvalue: model.id,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresults = (data || []).map((model) => ({\n\t\t\t\tname: model.id.toUpperCase(),\n\t\t\t\tvalue: model.id,\n\t\t\t}));\n\t\t}\n\n\t\tresults = results.sort((a, b) => a.name.localeCompare(b.name));\n\n\t\treturn {\n\t\t\tresults,\n\t\t};\n\t};\n\nexport async function modelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\tconst credentials = await this.getCredentials<{ url: string }>('openAiApi');\n\tconst url = credentials.url && new URL(credentials.url);\n\tconst isCustomAPI = url && url.hostname !== 'api.openai.com';\n\n\treturn await getModelSearch(\n\t\t(model) =>\n\t\t\tisCustomAPI ||\n\t\t\tmodel.id.startsWith('gpt-') ||\n\t\t\tmodel.id.startsWith('ft:') ||\n\t\t\tmodel.id.startsWith('o1') ||\n\t\t\tmodel.id.startsWith('o3'),\n\t)(this, filter);\n}\n\nexport async function imageModelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\treturn await getModelSearch(\n\t\t(model) => model.id.includes('vision') || model.id.includes('gpt-4o'),\n\t)(this, filter);\n}\n\nexport async function assistantSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n\tpaginationToken?: string,\n): Promise<INodeListSearchResult> {\n\tconst { data, has_more, last_id } = (await apiRequest.call(this, 'GET', '/assistants', {\n\t\theaders: {\n\t\t\t'OpenAI-Beta': 'assistants=v2',\n\t\t},\n\t\tqs: {\n\t\t\tlimit: 100,\n\t\t\tafter: paginationToken,\n\t\t},\n\t})) as {\n\t\tdata: Assistant[];\n\t\thas_more: boolean;\n\t\tlast_id: string;\n\t\tfirst_id: string;\n\t};\n\n\tif (has_more) {\n\t\tpaginationToken = last_id;\n\t} else {\n\t\tpaginationToken = undefined;\n\t}\n\n\tif (filter) {\n\t\tconst results: INodeListSearchItems[] = [];\n\n\t\tfor (const assistant of data || []) {\n\t\t\tif (assistant.name?.toLowerCase().includes(filter.toLowerCase())) {\n\t\t\t\tresults.push({\n\t\t\t\t\tname: assistant.name,\n\t\t\t\t\tvalue: assistant.id,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tresults,\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tresults: (data || []).map((assistant) => ({\n\t\t\t\tname: assistant.name ?? assistant.id,\n\t\t\t\tvalue: assistant.id,\n\t\t\t})),\n\t\t\tpaginationToken,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,uBAA2B;AAE3B,eAAsB,WAErB,QACiC;AACjC,QAAM,EAAE,KAAK,IAAI,MAAM,4BAAW,KAAK,MAAM,OAAO,QAAQ;AAE5D,MAAI,QAAQ;AACX,UAAM,UAAkC,CAAC;AAEzC,eAAW,QAAQ,QAAQ,CAAC,GAAG;AAC9B,UAAK,KAAK,UAAqB,YAAY,EAAE,SAAS,OAAO,YAAY,CAAC,GAAG;AAC5E,gBAAQ,KAAK;AAAA,UACZ,MAAM,KAAK;AAAA,UACX,OAAO,KAAK;AAAA,QACb,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD,OAAO;AACN,WAAO;AAAA,MACN,UAAU,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAuB;AAAA,QACjD,MAAM,KAAK;AAAA,QACX,OAAO,KAAK;AAAA,MACb,EAAE;AAAA,IACH;AAAA,EACD;AACD;AAEA,MAAM,iBACL,CAAC,oBACD,OAAO,KAA4B,WAAoD;AACtF,MAAI,EAAE,KAAK,IAAK,MAAM,4BAAW,KAAK,KAAK,OAAO,SAAS;AAE3D,SAAO,MAAM,OAAO,CAAC,UAAU,gBAAgB,KAAK,CAAC;AAErD,MAAI,UAAkC,CAAC;AAEvC,MAAI,QAAQ;AACX,eAAW,SAAS,QAAQ,CAAC,GAAG;AAC/B,UAAI,MAAM,IAAI,YAAY,EAAE,SAAS,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AkB;AAAA,EACnB;AAEA,MAAI,QAAQ;AACX,UAAM,UAAkC,CAAC;AAEzC,eAAW,aAAa,QAAQ,CAAC,GAAG;AACnC,UAAI,UAAU,MAAM,YAAY,EAAE,SAAS,OAAO,YAAY,CAAC,GAAG;AACjE,gBAAQ,KAAK;AAAA,UACZ,MAAM,UAAU;AAAA,UAChB,OAAO,UAAU;AAAA,QAClB,CAAC;AAAA,MACF;AAAA,IACD;AAEA,WAAO;AAAA,MACN;AAAA,IACD;AAAA,EACD,OAAO;AACN,WAAO;AAAA,MACN,UAAU,QAAQ,CAAC,GAAG,IAAI,CAAC,eAAe;AAAA,QACzC,MAAM,UAAU,QAAQ,UAAU;AAAA,QAClC,OAAO,UAAU;AAAA,MAClB,EAAE;AAAA,MACF;AAAA,IACD;AAAA,EACD;AACD;","names":[]}
1
+ {"version":3,"sources":["../../../../../nodes/vendors/OpenAi/methods/listSearch.ts"],"sourcesContent":["import type {\n\tIDataObject,\n\tILoadOptionsFunctions,\n\tINodeListSearchItems,\n\tINodeListSearchResult,\n} from 'n8n-workflow';\nimport type { Assistant } from 'openai/resources/beta/assistants';\nimport type { Model } from 'openai/resources/models';\n\nimport { apiRequest } from '../transport';\n\nexport async function fileSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\tconst { data } = await apiRequest.call(this, 'GET', '/files');\n\n\tif (filter) {\n\t\tconst results: INodeListSearchItems[] = [];\n\n\t\tfor (const file of data || []) {\n\t\t\tif ((file.filename as string)?.toLowerCase().includes(filter.toLowerCase())) {\n\t\t\t\tresults.push({\n\t\t\t\t\tname: file.filename as string,\n\t\t\t\t\tvalue: file.id as string,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tresults,\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tresults: (data || []).map((file: IDataObject) => ({\n\t\t\t\tname: file.filename as string,\n\t\t\t\tvalue: file.id as string,\n\t\t\t})),\n\t\t};\n\t}\n}\n\nconst getModelSearch =\n\t(filterCondition: (model: Model) => boolean) =>\n\tasync (ctx: ILoadOptionsFunctions, filter?: string): Promise<INodeListSearchResult> => {\n\t\tlet { data } = (await apiRequest.call(ctx, 'GET', '/models')) as { data: Model[] };\n\n\t\tdata = data?.filter((model) => filterCondition(model));\n\n\t\tlet results: INodeListSearchItems[] = [];\n\n\t\tif (filter) {\n\t\t\tfor (const model of data || []) {\n\t\t\t\tif (model.id?.toLowerCase().includes(filter.toLowerCase())) {\n\t\t\t\t\tresults.push({\n\t\t\t\t\t\tname: model.id.toUpperCase(),\n\t\t\t\t\t\tvalue: model.id,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tresults = (data || []).map((model) => ({\n\t\t\t\tname: model.id.toUpperCase(),\n\t\t\t\tvalue: model.id,\n\t\t\t}));\n\t\t}\n\n\t\tresults = results.sort((a, b) => a.name.localeCompare(b.name));\n\t\treturn {\n\t\t\tresults,\n\t\t};\n\t};\n\nexport async function modelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\tconst credentials = await this.getCredentials<{ url: string }>('openAiApi');\n\tconst url = credentials.url && new URL(credentials.url);\n\tconst isCustomAPI = url && url.hostname !== 'api.openai.com';\n\treturn await getModelSearch(\n\t\t(model) =>\n\t\t\t!isCustomAPI &&\n\t\t\t!(\n\t\t\t\tmodel.id.startsWith('babbage') ||\n\t\t\t\tmodel.id.startsWith('davinci') ||\n\t\t\t\tmodel.id.startsWith('computer-use') ||\n\t\t\t\tmodel.id.startsWith('dall-e') ||\n\t\t\t\tmodel.id.startsWith('text-embedding') ||\n\t\t\t\tmodel.id.startsWith('tts') ||\n\t\t\t\tmodel.id.startsWith('whisper') ||\n\t\t\t\tmodel.id.startsWith('omni-moderation') ||\n\t\t\t\t(model.id.startsWith('gpt-') && model.id.includes('instruct'))\n\t\t\t),\n\t)(this, filter);\n}\n\nexport async function imageModelSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n): Promise<INodeListSearchResult> {\n\treturn await getModelSearch(\n\t\t(model) => model.id.includes('vision') || model.id.includes('gpt-4o'),\n\t)(this, filter);\n}\n\nexport async function assistantSearch(\n\tthis: ILoadOptionsFunctions,\n\tfilter?: string,\n\tpaginationToken?: string,\n): Promise<INodeListSearchResult> {\n\tconst { data, has_more, last_id } = (await apiRequest.call(this, 'GET', '/assistants', {\n\t\theaders: {\n\t\t\t'OpenAI-Beta': 'assistants=v2',\n\t\t},\n\t\tqs: {\n\t\t\tlimit: 100,\n\t\t\tafter: paginationToken,\n\t\t},\n\t})) as {\n\t\tdata: Assistant[];\n\t\thas_more: boolean;\n\t\tlast_id: string;\n\t\tfirst_id: string;\n\t};\n\n\tif (has_more) {\n\t\tpaginationToken = last_id;\n\t} else {\n\t\tpaginationToken = undefined;\n\t}\n\n\tif (filter) {\n\t\tconst results: INodeListSearchItems[] = [];\n\n\t\tfor (const assistant of data || []) {\n\t\t\tif (assistant.name?.toLowerCase().includes(filter.toLowerCase())) {\n\t\t\t\tresults.push({\n\t\t\t\t\tname: assistant.name,\n\t\t\t\t\tvalue: assistant.id,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\tresults,\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tresults: (data || []).map((assistant) => ({\n\t\t\t\tname: assistant.name ?? assistant.id,\n\t\t\t\tvalue: assistant.id,\n\t\t\t})),\n\t\t\tpaginationToken,\n\t\t};\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,uBAA2B;AAE3B,eAAsB,WAErB,QACiC;AACjC,QAAM,EAAE,KAAK,IAAI,MAAM,4BAAW,KAAK,MAAM,OAAO,QAAQ;AAE5D,MAAI,QAAQ;AACX,UAAM,UAAkC,CAAC;AAEzC,eAAW,QAAQ,QAAQ,CAAC,GAAG;AAC9B,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