@n8n/n8n-nodes-langchain 1.115.1 → 1.116.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.
- package/dist/credentials/AnthropicApi.credentials.js +39 -8
- package/dist/credentials/AnthropicApi.credentials.js.map +1 -1
- package/dist/credentials/LemonadeApi.credentials.js +70 -0
- package/dist/credentials/LemonadeApi.credentials.js.map +1 -0
- package/dist/known/credentials.json +9 -0
- package/dist/known/nodes.json +12 -0
- package/dist/nodes/agents/Agent/Agent.node.js +1 -2
- package/dist/nodes/agents/Agent/Agent.node.js.map +1 -1
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js +2 -0
- package/dist/nodes/agents/Agent/V1/AgentV1.node.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js +13 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/description.js.map +1 -1
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js +49 -30
- package/dist/nodes/agents/Agent/agents/ToolsAgent/V3/execute.js.map +1 -1
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js +3 -0
- package/dist/nodes/chains/ChainLLM/methods/chainExecutor.js.map +1 -1
- package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js +87 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/EmbeddingsLemonade.node.js.map +1 -0
- package/dist/nodes/embeddings/EmbeddingsLemonade/lemonade.svg +53 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js +17 -0
- package/dist/nodes/embeddings/EmbeddingsOpenAI/EmbeddingsOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js +12 -8
- package/dist/nodes/llms/LMChatAnthropic/LmChatAnthropic.node.js.map +1 -1
- package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js +106 -0
- package/dist/nodes/llms/LMChatLemonade/LmChatLemonade.node.js.map +1 -0
- package/dist/nodes/llms/LMChatLemonade/lemonade.svg +53 -0
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js +6 -5
- package/dist/nodes/llms/LMChatOpenAi/methods/loadModels.js.map +1 -1
- package/dist/nodes/llms/LMLemonade/LmLemonade.node.js +107 -0
- package/dist/nodes/llms/LMLemonade/LmLemonade.node.js.map +1 -0
- package/dist/nodes/llms/LMLemonade/description.js +147 -0
- package/dist/nodes/llms/LMLemonade/description.js.map +1 -0
- package/dist/nodes/llms/LMLemonade/lemonade.svg +53 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js +3 -0
- package/dist/nodes/llms/LmChatAzureOpenAi/LmChatAzureOpenAi.node.js.map +1 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js +14 -1
- package/dist/nodes/llms/LmChatMistralCloud/LmChatMistralCloud.node.js.map +1 -1
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js +107 -47
- package/dist/nodes/mcp/McpClientTool/McpClientTool.node.js.map +1 -1
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js +2 -1
- package/dist/nodes/tools/ToolWorkflow/v2/utils/WorkflowToolService.js.map +1 -1
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js +43 -4
- package/dist/nodes/vector_store/VectorStoreQdrant/VectorStoreQdrant.node.js.map +1 -1
- package/dist/nodes/vendors/Anthropic/transport/index.js +9 -5
- package/dist/nodes/vendors/Anthropic/transport/index.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js +50 -11
- package/dist/nodes/vendors/OpenAi/OpenAi.node.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/helpers/binary-data.js +3 -3
- package/dist/nodes/vendors/OpenAi/helpers/binary-data.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/helpers/description.js +75 -0
- package/dist/nodes/vendors/OpenAi/helpers/description.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/interfaces.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js +34 -0
- package/dist/nodes/vendors/OpenAi/helpers/modelFiltering.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/polling.js +52 -0
- package/dist/nodes/vendors/OpenAi/helpers/polling.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js +27 -0
- package/dist/nodes/vendors/OpenAi/helpers/utils.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js +10 -6
- package/dist/nodes/vendors/OpenAi/methods/listSearch.js.map +1 -1
- package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js +110 -0
- package/dist/nodes/vendors/OpenAi/v1/OpenAiV1.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/create.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/deleteAssistant.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/deleteAssistant.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/list.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/message.operation.js +5 -5
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/update.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/assistant/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/generate.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/transcribe.operation.js +2 -2
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/translate.operation.js +2 -2
- package/dist/nodes/vendors/OpenAi/v1/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/deleteFile.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/list.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/upload.operation.js +2 -2
- package/dist/nodes/vendors/OpenAi/v1/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/analyze.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/generate.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/router.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/classify.operation.js +1 -1
- package/dist/nodes/vendors/OpenAi/v1/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v1/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/message.operation.js +4 -4
- package/dist/nodes/vendors/OpenAi/v1/actions/text/message.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js +116 -0
- package/dist/nodes/vendors/OpenAi/v2/OpenAiV2.node.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js +197 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js +96 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js +121 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/transcribe.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/audio/translate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js +120 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/create.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js +60 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/get.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js +94 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js +60 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/remove.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js +75 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js +279 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/descriptions.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/deleteFile.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js +92 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/list.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js +130 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/file/upload.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js +211 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/analyze.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js +464 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/edit.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js +319 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js +84 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/image/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js +17 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/node.type.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/router.js +111 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/router.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js +102 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/classify.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js +277 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/helpers/responses.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js +75 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/index.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js +774 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/text/response.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js +199 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/generate.operation.js.map +1 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js +64 -0
- package/dist/nodes/vendors/OpenAi/v2/actions/video/index.js.map +1 -0
- package/dist/types/credentials.json +2 -1
- package/dist/types/nodes.json +10 -6
- package/dist/utils/helpers.js +22 -2
- package/dist/utils/helpers.js.map +1 -1
- package/package.json +14 -10
- package/dist/nodes/vendors/OpenAi/actions/assistant/create.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/deleteAssistant.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/list.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/message.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/generate.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/transcribe.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/audio/translate.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/descriptions.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/deleteFile.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/list.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/file/upload.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/image/analyze.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/image/generate.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/image/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/node.type.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/router.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/text/classify.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/text/index.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/text/message.operation.js.map +0 -1
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js +0 -160
- package/dist/nodes/vendors/OpenAi/actions/versionDescription.js.map +0 -1
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/assistant/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/audio/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/descriptions.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/file/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/image/index.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/node.type.js +0 -0
- /package/dist/nodes/vendors/OpenAi/{actions → v1/actions}/text/index.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../nodes/vendors/OpenAi/actions/text/message.operation.ts"],"sourcesContent":["import type { Tool } from '@langchain/core/tools';\nimport _omit from 'lodash/omit';\nimport type {\n\tINodeProperties,\n\tIExecuteFunctions,\n\tINodeExecutionData,\n\tIDataObject,\n} from 'n8n-workflow';\nimport { jsonParse, updateDisplayOptions } from 'n8n-workflow';\n\nimport { getConnectedTools } from '@utils/helpers';\n\nimport { MODELS_NOT_SUPPORT_FUNCTION_CALLS } from '../../helpers/constants';\nimport type { ChatCompletion } from '../../helpers/interfaces';\nimport { formatToOpenAIAssistantTool } from '../../helpers/utils';\nimport { apiRequest } from '../../transport';\nimport { modelRLC } from '../descriptions';\n\nconst properties: INodeProperties[] = [\n\tmodelRLC('modelSearch'),\n\t{\n\t\tdisplayName: 'Messages',\n\t\tname: 'messages',\n\t\ttype: 'fixedCollection',\n\t\ttypeOptions: {\n\t\t\tsortable: true,\n\t\t\tmultipleValues: true,\n\t\t},\n\t\tplaceholder: 'Add Message',\n\t\tdefault: { values: [{ content: '' }] },\n\t\toptions: [\n\t\t\t{\n\t\t\t\tdisplayName: 'Values',\n\t\t\t\tname: 'values',\n\t\t\t\tvalues: [\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Prompt',\n\t\t\t\t\t\tname: 'content',\n\t\t\t\t\t\ttype: 'string',\n\t\t\t\t\t\tdescription: 'The content of the message to be send',\n\t\t\t\t\t\tdefault: '',\n\t\t\t\t\t\tplaceholder: 'e.g. Hello, how can you help me?',\n\t\t\t\t\t\ttypeOptions: {\n\t\t\t\t\t\t\trows: 2,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tdisplayName: 'Role',\n\t\t\t\t\t\tname: 'role',\n\t\t\t\t\t\ttype: 'options',\n\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\"Role in shaping the model's response, it tells the model how it should behave and interact with the user\",\n\t\t\t\t\t\toptions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'User',\n\t\t\t\t\t\t\t\tvalue: 'user',\n\t\t\t\t\t\t\t\tdescription: 'Send a message as a user and get a response from the model',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'Assistant',\n\t\t\t\t\t\t\t\tvalue: 'assistant',\n\t\t\t\t\t\t\t\tdescription: 'Tell the model to adopt a specific tone or personality',\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tname: 'System',\n\t\t\t\t\t\t\t\tvalue: 'system',\n\t\t\t\t\t\t\t\tdescription:\n\t\t\t\t\t\t\t\t\t\"Usually used to set the model's behavior or context for the next user message\",\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t],\n\t\t\t\t\t\tdefault: 'user',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tdisplayName: 'Simplify Output',\n\t\tname: 'simplify',\n\t\ttype: 'boolean',\n\t\tdefault: true,\n\t\tdescription: 'Whether to return a simplified version of the response instead of the raw data',\n\t},\n\t{\n\t\tdisplayName: 'Output Content as JSON',\n\t\tname: 'jsonOutput',\n\t\ttype: 'boolean',\n\t\tdescription:\n\t\t\t'Whether to attempt to return the response in JSON format. Compatible with GPT-4 Turbo and all GPT-3.5 Turbo models newer than gpt-3.5-turbo-1106.',\n\t\tdefault: false,\n\t},\n\t{\n\t\tdisplayName: 'Hide Tools',\n\t\tname: 'hideTools',\n\t\ttype: 'hidden',\n\t\tdefault: 'hide',\n\t\tdisplayOptions: {\n\t\t\tshow: {\n\t\t\t\tmodelId: MODELS_NOT_SUPPORT_FUNCTION_CALLS,\n\t\t\t\t'@version': [{ _cnd: { gte: 1.2 } }],\n\t\t\t},\n\t\t},\n\t},\n\t{\n\t\tdisplayName: 'Connect your own custom n8n tools to this node on the canvas',\n\t\tname: 'noticeTools',\n\t\ttype: 'notice',\n\t\tdefault: '',\n\t\tdisplayOptions: {\n\t\t\thide: {\n\t\t\t\thideTools: ['hide'],\n\t\t\t},\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: 'Frequency Penalty',\n\t\t\t\tname: 'frequency_penalty',\n\t\t\t\tdefault: 0,\n\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\tdescription:\n\t\t\t\t\t\"Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim\",\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Maximum Number of Tokens',\n\t\t\t\tname: 'maxTokens',\n\t\t\t\tdefault: 16,\n\t\t\t\tdescription:\n\t\t\t\t\t'The maximum number of tokens to generate in the completion. Most models have a context length of 2048 tokens (except for the newest models, which support 32,768).',\n\t\t\t\ttype: 'number',\n\t\t\t\ttypeOptions: {\n\t\t\t\t\tmaxValue: 32768,\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Number of Completions',\n\t\t\t\tname: 'n',\n\t\t\t\tdefault: 1,\n\t\t\t\tdescription:\n\t\t\t\t\t'How many completions to generate for each prompt. Note: Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.',\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Presence Penalty',\n\t\t\t\tname: 'presence_penalty',\n\t\t\t\tdefault: 0,\n\t\t\t\ttypeOptions: { maxValue: 2, minValue: -2, numberPrecision: 1 },\n\t\t\t\tdescription:\n\t\t\t\t\t\"Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics\",\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Temperature)',\n\t\t\t\tname: 'temperature',\n\t\t\t\tdefault: 1,\n\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\tdescription:\n\t\t\t\t\t'Controls randomness: Lowering results in less random completions. As the temperature approaches zero, the model will become deterministic and repetitive. We generally recommend altering this or temperature but not both.',\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Output Randomness (Top P)',\n\t\t\t\tname: 'topP',\n\t\t\t\tdefault: 1,\n\t\t\t\ttypeOptions: { maxValue: 1, minValue: 0, numberPrecision: 1 },\n\t\t\t\tdescription:\n\t\t\t\t\t'An alternative to sampling with temperature, controls diversity via nucleus sampling: 0.5 means half of all likelihood-weighted options are considered. We generally recommend altering this or temperature but not both.',\n\t\t\t\ttype: 'number',\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Reasoning Effort',\n\t\t\t\tname: 'reasoning_effort',\n\t\t\t\tdefault: 'medium',\n\t\t\t\tdescription:\n\t\t\t\t\t'Controls the amount of reasoning tokens to use. A value of \"low\" will favor speed and economical token usage, \"high\" will favor more complete reasoning at the cost of more tokens generated and slower responses.',\n\t\t\t\ttype: 'options',\n\t\t\t\toptions: [\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\tdescription: 'Favors speed and economical token usage',\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\tdescription: 'Balance between speed and reasoning accuracy',\n\t\t\t\t\t},\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\tdescription:\n\t\t\t\t\t\t\t'Favors more complete reasoning at the cost of more tokens generated and slower responses',\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// reasoning_effort is only available on o1, o1-versioned, or on o3-mini and beyond, and gpt-5 models. Not on o1-mini or other GPT-models.\n\t\t\t\t\t\t'/modelId': [{ _cnd: { regex: '(^o1([-\\\\d]+)?$)|(^o[3-9].*)|(^gpt-5.*)' } }],\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\tdisplayName: 'Max Tool Calls Iterations',\n\t\t\t\tname: 'maxToolsIterations',\n\t\t\t\ttype: 'number',\n\t\t\t\tdefault: 15,\n\t\t\t\tdescription:\n\t\t\t\t\t'The maximum number of tool iteration cycles the LLM will run before stopping. A single iteration can contain multiple tool calls. Set to 0 for no limit.',\n\t\t\t\tdisplayOptions: {\n\t\t\t\t\tshow: {\n\t\t\t\t\t\t'@version': [{ _cnd: { gte: 1.5 } }],\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: ['message'],\n\t\tresource: ['text'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst nodeVersion = this.getNode().typeVersion;\n\tconst model = this.getNodeParameter('modelId', i, '', { extractValue: true });\n\tlet messages = this.getNodeParameter('messages.values', i, []) as IDataObject[];\n\tconst options = this.getNodeParameter('options', i, {});\n\tconst jsonOutput = this.getNodeParameter('jsonOutput', i, false) as boolean;\n\tconst maxToolsIterations =\n\t\tnodeVersion >= 1.5 ? (this.getNodeParameter('options.maxToolsIterations', i, 15) as number) : 0;\n\n\tconst abortSignal = this.getExecutionCancelSignal();\n\n\tif (options.maxTokens !== undefined) {\n\t\toptions.max_completion_tokens = options.maxTokens;\n\t\tdelete options.maxTokens;\n\t}\n\n\tif (options.topP !== undefined) {\n\t\toptions.top_p = options.topP;\n\t\tdelete options.topP;\n\t}\n\n\tlet response_format;\n\tif (jsonOutput) {\n\t\tresponse_format = { type: 'json_object' };\n\t\tmessages = [\n\t\t\t{\n\t\t\t\trole: 'system',\n\t\t\t\tcontent: 'You are a helpful assistant designed to output JSON.',\n\t\t\t},\n\t\t\t...messages,\n\t\t];\n\t}\n\n\tconst hideTools = this.getNodeParameter('hideTools', i, '') as string;\n\n\tlet tools;\n\tlet externalTools: Tool[] = [];\n\n\tif (hideTools !== 'hide') {\n\t\tconst enforceUniqueNames = nodeVersion > 1;\n\t\texternalTools = await getConnectedTools(this, enforceUniqueNames, false);\n\t}\n\n\tif (externalTools.length) {\n\t\ttools = externalTools.length ? externalTools?.map(formatToOpenAIAssistantTool) : undefined;\n\t}\n\n\tconst body: IDataObject = {\n\t\tmodel,\n\t\tmessages,\n\t\ttools,\n\t\tresponse_format,\n\t\t..._omit(options, ['maxToolsIterations']),\n\t};\n\n\tlet response = (await apiRequest.call(this, 'POST', '/chat/completions', {\n\t\tbody,\n\t})) as ChatCompletion;\n\n\tif (!response) return [];\n\n\tlet currentIteration = 1;\n\tlet toolCalls = response?.choices[0]?.message?.tool_calls;\n\n\twhile (toolCalls?.length) {\n\t\t// Break the loop if the max iterations is reached or the execution is canceled\n\t\tif (\n\t\t\tabortSignal?.aborted ||\n\t\t\t(maxToolsIterations > 0 && currentIteration >= maxToolsIterations)\n\t\t) {\n\t\t\tbreak;\n\t\t}\n\t\tmessages.push(response.choices[0].message);\n\n\t\tfor (const toolCall of toolCalls) {\n\t\t\tconst functionName = toolCall.function.name;\n\t\t\tconst functionArgs = toolCall.function.arguments;\n\n\t\t\tlet functionResponse;\n\t\t\tfor (const tool of externalTools ?? []) {\n\t\t\t\tif (tool.name === functionName) {\n\t\t\t\t\tconst parsedArgs: { input: string } = jsonParse(functionArgs);\n\t\t\t\t\tconst functionInput = parsedArgs.input ?? parsedArgs ?? functionArgs;\n\t\t\t\t\tfunctionResponse = await tool.invoke(functionInput);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (typeof functionResponse === 'object') {\n\t\t\t\tfunctionResponse = JSON.stringify(functionResponse);\n\t\t\t}\n\n\t\t\tmessages.push({\n\t\t\t\ttool_call_id: toolCall.id,\n\t\t\t\trole: 'tool',\n\t\t\t\tcontent: functionResponse,\n\t\t\t});\n\t\t}\n\n\t\tresponse = (await apiRequest.call(this, 'POST', '/chat/completions', {\n\t\t\tbody,\n\t\t})) as ChatCompletion;\n\n\t\ttoolCalls = response.choices[0].message.tool_calls;\n\t\tcurrentIteration += 1;\n\t}\n\n\tif (response_format) {\n\t\tresponse.choices = response.choices.map((choice) => {\n\t\t\ttry {\n\t\t\t\tchoice.message.content = JSON.parse(choice.message.content);\n\t\t\t} catch (error) {}\n\t\t\treturn choice;\n\t\t});\n\t}\n\n\tconst simplify = this.getNodeParameter('simplify', i) as boolean;\n\n\tconst returnData: INodeExecutionData[] = [];\n\n\tif (simplify) {\n\t\tfor (const entry of response.choices) {\n\t\t\treturnData.push({\n\t\t\t\tjson: entry,\n\t\t\t\tpairedItem: { item: i },\n\t\t\t});\n\t\t}\n\t} else {\n\t\treturnData.push({ json: response, pairedItem: { item: i } });\n\t}\n\n\treturn returnData;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,kBAAkB;AAOlB,0BAAgD;AAEhD,qBAAkC;AAElC,uBAAkD;AAElD,mBAA4C;AAC5C,uBAA2B;AAC3B,0BAAyB;AAEzB,MAAM,aAAgC;AAAA,MACrC,8BAAS,aAAa;AAAA,EACtB;AAAA,IACC,aAAa;AAAA,IACb,MAAM;AAAA,IACN,MAAM;AAAA,IACN,aAAa;AAAA,MACZ,UAAU;AAAA,MACV,gBAAgB;AAAA,IACjB;AAAA,IACA,aAAa;AAAA,IACb,SAAS,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE;AAAA,IACrC,SAAS;AAAA,MACR;AAAA,QACC,aAAa;AAAA,QACb,MAAM;AAAA,QACN,QAAQ;AAAA,UACP;AAAA,YACC,aAAa;AAAA,YACb,MAAM;AAAA,YACN,MAAM;AAAA,YACN,aAAa;AAAA,YACb,SAAS;AAAA,YACT,aAAa;AAAA,YACb,aAAa;AAAA,cACZ,MAAM;AAAA,YACP;AAAA,UACD;AAAA,UACA;AAAA,YACC,aAAa;AAAA,YACb,MAAM;AAAA,YACN,MAAM;AAAA,YACN,aACC;AAAA,YACD,SAAS;AAAA,cACR;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aAAa;AAAA,cACd;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,OAAO;AAAA,gBACP,aAAa;AAAA,cACd;AAAA,cACA;AAAA,gBACC,MAAM;AAAA,gBACN,O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I;AACH,eAAO,QAAQ,UAAU,KAAK,MAAM,OAAO,QAAQ,OAAO;AAAA,MAC3D,SAAS,OAAO;AAAA,MAAC;AACjB,aAAO;AAAA,IACR,CAAC;AAAA,EACF;AAEA,QAAM,WAAW,KAAK,iBAAiB,YAAY,CAAC;AAEpD,QAAM,aAAmC,CAAC;AAE1C,MAAI,UAAU;AACb,eAAW,SAAS,SAAS,SAAS;AACrC,iBAAW,KAAK;AAAA,QACf,MAAM;AAAA,QACN,YAAY,EAAE,MAAM,EAAE;AAAA,MACvB,CAAC;AAAA,IACF;AAAA,EACD,OAAO;AACN,eAAW,KAAK,EAAE,MAAM,UAAU,YAAY,EAAE,MAAM,EAAE,EAAE,CAAC;AAAA,EAC5D;AAEA,SAAO;AACR;","names":["_omit"]}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var versionDescription_exports = {};
|
|
30
|
-
__export(versionDescription_exports, {
|
|
31
|
-
versionDescription: () => versionDescription
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(versionDescription_exports);
|
|
34
|
-
var import_n8n_workflow = require("n8n-workflow");
|
|
35
|
-
var assistant = __toESM(require("./assistant"));
|
|
36
|
-
var audio = __toESM(require("./audio"));
|
|
37
|
-
var file = __toESM(require("./file"));
|
|
38
|
-
var image = __toESM(require("./image"));
|
|
39
|
-
var text = __toESM(require("./text"));
|
|
40
|
-
const prettifyOperation = (resource, operation) => {
|
|
41
|
-
if (operation === "deleteAssistant") {
|
|
42
|
-
return "Delete Assistant";
|
|
43
|
-
}
|
|
44
|
-
if (operation === "deleteFile") {
|
|
45
|
-
return "Delete File";
|
|
46
|
-
}
|
|
47
|
-
if (operation === "classify") {
|
|
48
|
-
return "Classify Text";
|
|
49
|
-
}
|
|
50
|
-
if (operation === "message" && resource === "text") {
|
|
51
|
-
return "Message Model";
|
|
52
|
-
}
|
|
53
|
-
const capitalize = (str) => {
|
|
54
|
-
const chars = str.split("");
|
|
55
|
-
chars[0] = chars[0].toUpperCase();
|
|
56
|
-
return chars.join("");
|
|
57
|
-
};
|
|
58
|
-
if (["transcribe", "translate"].includes(operation)) {
|
|
59
|
-
resource = "recording";
|
|
60
|
-
}
|
|
61
|
-
if (operation === "list") {
|
|
62
|
-
resource = resource + "s";
|
|
63
|
-
}
|
|
64
|
-
return `${capitalize(operation)} ${capitalize(resource)}`;
|
|
65
|
-
};
|
|
66
|
-
const configureNodeInputs = (resource, operation, hideTools, memory) => {
|
|
67
|
-
if (resource === "assistant" && operation === "message") {
|
|
68
|
-
const inputs = [
|
|
69
|
-
{ type: "main" },
|
|
70
|
-
{ type: "ai_tool", displayName: "Tools" }
|
|
71
|
-
];
|
|
72
|
-
if (memory !== "threadId") {
|
|
73
|
-
inputs.push({ type: "ai_memory", displayName: "Memory", maxConnections: 1 });
|
|
74
|
-
}
|
|
75
|
-
return inputs;
|
|
76
|
-
}
|
|
77
|
-
if (resource === "text" && operation === "message") {
|
|
78
|
-
if (hideTools === "hide") {
|
|
79
|
-
return ["main"];
|
|
80
|
-
}
|
|
81
|
-
return [{ type: "main" }, { type: "ai_tool", displayName: "Tools" }];
|
|
82
|
-
}
|
|
83
|
-
return ["main"];
|
|
84
|
-
};
|
|
85
|
-
const versionDescription = {
|
|
86
|
-
displayName: "OpenAI",
|
|
87
|
-
name: "openAi",
|
|
88
|
-
icon: { light: "file:openAi.svg", dark: "file:openAi.dark.svg" },
|
|
89
|
-
group: ["transform"],
|
|
90
|
-
version: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8],
|
|
91
|
-
subtitle: `={{(${prettifyOperation})($parameter.resource, $parameter.operation)}}`,
|
|
92
|
-
description: "Message an assistant or GPT, analyze images, generate audio, etc.",
|
|
93
|
-
defaults: {
|
|
94
|
-
name: "OpenAI"
|
|
95
|
-
},
|
|
96
|
-
codex: {
|
|
97
|
-
alias: ["LangChain", "ChatGPT", "DallE", "whisper", "audio", "transcribe", "tts", "assistant"],
|
|
98
|
-
categories: ["AI"],
|
|
99
|
-
subcategories: {
|
|
100
|
-
AI: ["Agents", "Miscellaneous", "Root Nodes"]
|
|
101
|
-
},
|
|
102
|
-
resources: {
|
|
103
|
-
primaryDocumentation: [
|
|
104
|
-
{
|
|
105
|
-
url: "https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/"
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
}
|
|
109
|
-
},
|
|
110
|
-
inputs: `={{(${configureNodeInputs})($parameter.resource, $parameter.operation, $parameter.hideTools, $parameter.memory ?? undefined)}}`,
|
|
111
|
-
outputs: [import_n8n_workflow.NodeConnectionTypes.Main],
|
|
112
|
-
credentials: [
|
|
113
|
-
{
|
|
114
|
-
name: "openAiApi",
|
|
115
|
-
required: true
|
|
116
|
-
}
|
|
117
|
-
],
|
|
118
|
-
properties: [
|
|
119
|
-
{
|
|
120
|
-
displayName: "Resource",
|
|
121
|
-
name: "resource",
|
|
122
|
-
type: "options",
|
|
123
|
-
noDataExpression: true,
|
|
124
|
-
// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items
|
|
125
|
-
options: [
|
|
126
|
-
{
|
|
127
|
-
name: "Assistant",
|
|
128
|
-
value: "assistant"
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
name: "Text",
|
|
132
|
-
value: "text"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "Image",
|
|
136
|
-
value: "image"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: "Audio",
|
|
140
|
-
value: "audio"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "File",
|
|
144
|
-
value: "file"
|
|
145
|
-
}
|
|
146
|
-
],
|
|
147
|
-
default: "text"
|
|
148
|
-
},
|
|
149
|
-
...assistant.description,
|
|
150
|
-
...audio.description,
|
|
151
|
-
...file.description,
|
|
152
|
-
...image.description,
|
|
153
|
-
...text.description
|
|
154
|
-
]
|
|
155
|
-
};
|
|
156
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
157
|
-
0 && (module.exports = {
|
|
158
|
-
versionDescription
|
|
159
|
-
});
|
|
160
|
-
//# sourceMappingURL=versionDescription.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../nodes/vendors/OpenAi/actions/versionDescription.ts"],"sourcesContent":["/* eslint-disable n8n-nodes-base/node-filename-against-convention */\nimport type { INodeInputConfiguration, INodeTypeDescription } from 'n8n-workflow';\nimport { NodeConnectionTypes } from 'n8n-workflow';\n\nimport * as assistant from './assistant';\nimport * as audio from './audio';\nimport * as file from './file';\nimport * as image from './image';\nimport * as text from './text';\n\nconst prettifyOperation = (resource: string, operation: string) => {\n\tif (operation === 'deleteAssistant') {\n\t\treturn 'Delete Assistant';\n\t}\n\n\tif (operation === 'deleteFile') {\n\t\treturn 'Delete File';\n\t}\n\n\tif (operation === 'classify') {\n\t\treturn 'Classify Text';\n\t}\n\n\tif (operation === 'message' && resource === 'text') {\n\t\treturn 'Message Model';\n\t}\n\n\tconst capitalize = (str: string) => {\n\t\tconst chars = str.split('');\n\t\tchars[0] = chars[0].toUpperCase();\n\t\treturn chars.join('');\n\t};\n\n\tif (['transcribe', 'translate'].includes(operation)) {\n\t\tresource = 'recording';\n\t}\n\n\tif (operation === 'list') {\n\t\tresource = resource + 's';\n\t}\n\n\treturn `${capitalize(operation)} ${capitalize(resource)}`;\n};\n\nconst configureNodeInputs = (\n\tresource: string,\n\toperation: string,\n\thideTools: string,\n\tmemory: string | undefined,\n) => {\n\tif (resource === 'assistant' && operation === 'message') {\n\t\tconst inputs: INodeInputConfiguration[] = [\n\t\t\t{ type: 'main' },\n\t\t\t{ type: 'ai_tool', displayName: 'Tools' },\n\t\t];\n\t\tif (memory !== 'threadId') {\n\t\t\tinputs.push({ type: 'ai_memory', displayName: 'Memory', maxConnections: 1 });\n\t\t}\n\t\treturn inputs;\n\t}\n\tif (resource === 'text' && operation === 'message') {\n\t\tif (hideTools === 'hide') {\n\t\t\treturn ['main'];\n\t\t}\n\t\treturn [{ type: 'main' }, { type: 'ai_tool', displayName: 'Tools' }];\n\t}\n\n\treturn ['main'];\n};\n\nexport const versionDescription: INodeTypeDescription = {\n\tdisplayName: 'OpenAI',\n\tname: 'openAi',\n\ticon: { light: 'file:openAi.svg', dark: 'file:openAi.dark.svg' },\n\tgroup: ['transform'],\n\tversion: [1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8],\n\tsubtitle: `={{(${prettifyOperation})($parameter.resource, $parameter.operation)}}`,\n\tdescription: 'Message an assistant or GPT, analyze images, generate audio, etc.',\n\tdefaults: {\n\t\tname: 'OpenAI',\n\t},\n\tcodex: {\n\t\talias: ['LangChain', 'ChatGPT', 'DallE', 'whisper', 'audio', 'transcribe', 'tts', 'assistant'],\n\t\tcategories: ['AI'],\n\t\tsubcategories: {\n\t\t\tAI: ['Agents', 'Miscellaneous', 'Root Nodes'],\n\t\t},\n\t\tresources: {\n\t\t\tprimaryDocumentation: [\n\t\t\t\t{\n\t\t\t\t\turl: 'https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t},\n\tinputs: `={{(${configureNodeInputs})($parameter.resource, $parameter.operation, $parameter.hideTools, $parameter.memory ?? undefined)}}`,\n\toutputs: [NodeConnectionTypes.Main],\n\tcredentials: [\n\t\t{\n\t\t\tname: 'openAiApi',\n\t\t\trequired: true,\n\t\t},\n\t],\n\tproperties: [\n\t\t{\n\t\t\tdisplayName: 'Resource',\n\t\t\tname: 'resource',\n\t\t\ttype: 'options',\n\t\t\tnoDataExpression: true,\n\t\t\t// eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items\n\t\t\toptions: [\n\t\t\t\t{\n\t\t\t\t\tname: 'Assistant',\n\t\t\t\t\tvalue: 'assistant',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Text',\n\t\t\t\t\tvalue: 'text',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Image',\n\t\t\t\t\tvalue: 'image',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Audio',\n\t\t\t\t\tvalue: 'audio',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'File',\n\t\t\t\t\tvalue: 'file',\n\t\t\t\t},\n\t\t\t],\n\t\t\tdefault: 'text',\n\t\t},\n\t\t...assistant.description,\n\t\t...audio.description,\n\t\t...file.description,\n\t\t...image.description,\n\t\t...text.description,\n\t],\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,0BAAoC;AAEpC,gBAA2B;AAC3B,YAAuB;AACvB,WAAsB;AACtB,YAAuB;AACvB,WAAsB;AAEtB,MAAM,oBAAoB,CAAC,UAAkB,cAAsB;AAClE,MAAI,cAAc,mBAAmB;AACpC,WAAO;AAAA,EACR;AAEA,MAAI,cAAc,cAAc;AAC/B,WAAO;AAAA,EACR;AAEA,MAAI,cAAc,YAAY;AAC7B,WAAO;AAAA,EACR;AAEA,MAAI,cAAc,aAAa,aAAa,QAAQ;AACnD,WAAO;AAAA,EACR;AAEA,QAAM,aAAa,CAAC,QAAgB;AACnC,UAAM,QAAQ,IAAI,MAAM,EAAE;AAC1B,UAAM,CAAC,IAAI,MAAM,CAAC,EAAE,YAAY;AAChC,WAAO,MAAM,KAAK,EAAE;AAAA,EACrB;AAEA,MAAI,CAAC,cAAc,WAAW,EAAE,SAAS,SAAS,GAAG;AACpD,eAAW;AAAA,EACZ;AAEA,MAAI,cAAc,QAAQ;AACzB,eAAW,WAAW;AAAA,EACvB;AAEA,SAAO,GAAG,WAAW,SAAS,CAAC,IAAI,WAAW,QAAQ,CAAC;AACxD;AAEA,MAAM,sBAAsB,CAC3B,UACA,WACA,WACA,WACI;AACJ,MAAI,aAAa,eAAe,cAAc,WAAW;AACxD,UAAM,SAAoC;AAAA,MACzC,EAAE,MAAM,OAAO;AAAA,MACf,EAAE,MAAM,WAAW,aAAa,QAAQ;AAAA,IACzC;AACA,QAAI,WAAW,YAAY;AAC1B,aAAO,KAAK,EAAE,MAAM,aAAa,aAAa,UAAU,gBAAgB,EAAE,CAAC;AAAA,IAC5E;AACA,WAAO;AAAA,EACR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A,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,QACA;AAAA,UACC,MAAM;AAAA,UACN,OAAO;AAAA,QACR;AAAA,MACD;AAAA,MACA,SAAS;AAAA,IACV;AAAA,IACA,GAAG,UAAU;AAAA,IACb,GAAG,MAAM;AAAA,IACT,GAAG,KAAK;AAAA,IACR,GAAG,MAAM;AAAA,IACT,GAAG,KAAK;AAAA,EACT;AACD;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|