first commit
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
Security: Sync from Public / sync-from-public (push) Has been cancelled
Test: Benchmark Nightly / build (push) Has been cancelled
Test: Benchmark Nightly / Notify Cats on failure (push) Has been cancelled
CI: Python / Checks (push) Has been cancelled
Test: Evals Python / Workflow Comparison Python (push) Has been cancelled
Util: Check Docs URLs / check-docs-urls (push) Has been cancelled
Test: Visual Storybook / Cloudflare Pages (push) Has been cancelled
Test: E2E Performance / build-and-test-performance (push) Has been cancelled
Test: Workflows Nightly / Run Workflow Tests (push) Has been cancelled
Util: Cleanup CI Docker Images / Delete stale CI images (push) Has been cancelled
Test: Benchmark Destroy Env / build (push) Has been cancelled
Util: Update Node Popularity / update-popularity (push) Has been cancelled
Test: E2E Coverage Weekly / Coverage Tests (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
import {
|
||||
type IVersionedNodeType,
|
||||
VersionedNodeType,
|
||||
type INodeTypeBaseDescription,
|
||||
} from 'n8n-workflow';
|
||||
|
||||
import { prettifyOperation } from './helpers/description';
|
||||
import { OpenAiV1 } from './v1/OpenAiV1.node';
|
||||
import { OpenAiV2 } from './v2/OpenAiV2.node';
|
||||
|
||||
export class OpenAi extends VersionedNodeType {
|
||||
constructor() {
|
||||
const baseDescription: INodeTypeBaseDescription = {
|
||||
displayName: 'OpenAI',
|
||||
name: 'openAi',
|
||||
icon: { light: 'file:openAi.svg', dark: 'file:openAi.dark.svg' },
|
||||
group: ['transform'],
|
||||
defaultVersion: 2.1,
|
||||
subtitle: `={{(${prettifyOperation})($parameter.resource, $parameter.operation)}}`,
|
||||
description: 'Message an assistant or GPT, analyze images, generate audio, etc.',
|
||||
codex: {
|
||||
alias: [
|
||||
'LangChain',
|
||||
'ChatGPT',
|
||||
'Sora',
|
||||
'DallE',
|
||||
'whisper',
|
||||
'audio',
|
||||
'transcribe',
|
||||
'tts',
|
||||
'assistant',
|
||||
],
|
||||
categories: ['AI'],
|
||||
subcategories: {
|
||||
AI: ['Agents', 'Miscellaneous', 'Root Nodes'],
|
||||
},
|
||||
resources: {
|
||||
primaryDocumentation: [
|
||||
{
|
||||
url: 'https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-langchain.openai/',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
builderHint: {
|
||||
message:
|
||||
'For text generation, reasoning and tools, use AI Agent with OpenAI Chat Model. This OpenAI node is for specialized operations: image generation (DALL-E), audio (Whisper, TTS), and video generation (Sora).',
|
||||
relatedNodes: [
|
||||
{
|
||||
nodeType: '@n8n/n8n-nodes-langchain.agent',
|
||||
relationHint: 'Prefer for most LLM tasks',
|
||||
},
|
||||
{
|
||||
nodeType: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
|
||||
relationHint: 'Prefer for most LLM tasks',
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
|
||||
1: new OpenAiV1(baseDescription),
|
||||
1.1: new OpenAiV1(baseDescription),
|
||||
1.2: new OpenAiV1(baseDescription),
|
||||
1.3: new OpenAiV1(baseDescription),
|
||||
1.4: new OpenAiV1(baseDescription),
|
||||
1.5: new OpenAiV1(baseDescription),
|
||||
1.6: new OpenAiV1(baseDescription),
|
||||
1.7: new OpenAiV1(baseDescription),
|
||||
1.8: new OpenAiV1(baseDescription),
|
||||
2: new OpenAiV2(baseDescription),
|
||||
2.1: new OpenAiV2(baseDescription),
|
||||
};
|
||||
|
||||
super(nodeVersions, baseDescription);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user