n8n-nodes-base
Version:
Base nodes of n8n
79 lines • 2.8 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.OpenAi = void 0;
const n8n_workflow_1 = require("n8n-workflow");
const ChatDescription_1 = require("./ChatDescription");
const ImageDescription_1 = require("./ImageDescription");
const TextDescription_1 = require("./TextDescription");
const descriptions_1 = require("../../utils/descriptions");
class OpenAi {
description = {
displayName: 'OpenAI',
name: 'openAi',
hidden: true,
icon: { light: 'file:openAi.svg', dark: 'file:openAi.dark.svg' },
group: ['transform'],
version: [1, 1.1],
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
description: 'Consume Open AI',
defaults: {
name: 'OpenAI',
},
inputs: [n8n_workflow_1.NodeConnectionTypes.Main],
outputs: [n8n_workflow_1.NodeConnectionTypes.Main],
builderHint: {
relatedNodes: [
{
nodeType: '@n8n/n8n-nodes-langchain.lmChatOpenAi',
relationHint: 'For most LLM tasks, text generation, reasoning, use Agent with this model',
},
{
nodeType: '@n8n/n8n-nodes-langchain.agent',
relationHint: 'For most LLM tasks, text generation, reasoning, tool calls, etc.',
},
],
},
credentials: [
{
name: 'openAiApi',
required: true,
},
],
requestDefaults: {
ignoreHttpStatusErrors: true,
baseURL: '={{ $credentials.url?.split("/").slice(0,-1).join("/") ?? "https://api.openai.com" }}',
},
properties: [
descriptions_1.oldVersionNotice,
{
displayName: 'Resource',
name: 'resource',
type: 'options',
noDataExpression: true,
options: [
{
name: 'Chat',
value: 'chat',
},
{
name: 'Image',
value: 'image',
},
{
name: 'Text',
value: 'text',
},
],
default: 'text',
},
...ChatDescription_1.chatOperations,
...ChatDescription_1.chatFields,
...ImageDescription_1.imageOperations,
...ImageDescription_1.imageFields,
...TextDescription_1.textOperations,
...TextDescription_1.textFields,
],
};
}
exports.OpenAi = OpenAi;
//# sourceMappingURL=OpenAi.node.js.map