n8n/packages/nodes-base/nodes/Perplexity/Perplexity.node.ts
andrewmadson-pplx f9acc1510a
Some checks failed
CI: Master (Build, Test, Lint) / Build for Github Cache (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (24.18.1) (push) Waiting to run
CI: Master (Build, Test, Lint) / Unit tests (26.5.1) (push) Waiting to run
CI: Master (Build, Test, Lint) / Lint (push) Waiting to run
CI: Master (Build, Test, Lint) / Performance (push) Waiting to run
CI: Master (Build, Test, Lint) / Verify single-instance deps (npm-install) (push) Waiting to run
CI: Master (Build, Test, Lint) / Notify Slack on failure (push) Blocked by required conditions
Util: Publish API Schema / Cloudflare Pages (push) Has been cancelled
feat(Perplexity Node)!: Add v3 Agent-only, keep v2 with deprecation notice (#36551)
Co-authored-by: Elias Meire <elias@meire.dev>
2026-08-25 20:20:55 +00:00

35 lines
1.0 KiB
TypeScript

import type { INodeTypeBaseDescription, IVersionedNodeType } from 'n8n-workflow';
import { VersionedNodeType } from 'n8n-workflow';
import { PerplexityV2 } from './v2/PerplexityV2.node';
import { PerplexityV3 } from './v3/PerplexityV3.node';
export class Perplexity extends VersionedNodeType {
constructor() {
const baseDescription: INodeTypeBaseDescription = {
displayName: 'Perplexity',
name: 'perplexity',
icon: {
light: 'file:perplexity.svg',
dark: 'file:perplexity.dark.svg',
},
group: ['transform'],
subtitle: '={{ $parameter["operation"] + ": " + $parameter["resource"] }}',
description:
'AI-powered answer engine that provides accurate, trusted, and real-time answers to any question. Supports agent responses, web search, and embeddings.',
defaultVersion: 3,
};
const v2 = new PerplexityV2(baseDescription);
const v3 = new PerplexityV3(baseDescription);
const nodeVersions: IVersionedNodeType['nodeVersions'] = {
1: v2,
2: v2,
3: v3,
};
super(nodeVersions, baseDescription);
}
}