UNPKG

@n8n/n8n-nodes-langchain

Version:

![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

70 lines (64 loc) 2.36 kB
/** * Text Classifier Node - Version 1.1 * Classify your text into distinct categories */ export interface LcTextClassifierV11Params { /** * Use an expression to reference data in previous nodes or enter static text */ inputText: string | Expression<string> | PlaceholderValue; categories?: { /** Categories */ categories?: Array<{ /** Category to add */ category?: string | Expression<string> | PlaceholderValue; /** Describe your category if it's not obvious */ description?: string | Expression<string> | PlaceholderValue; }>; }; options?: { /** Allow Multiple Classes To Be True * @default false */ multiClass?: boolean | Expression<boolean>; /** What to do with items that don’t match the categories exactly * @default discard */ fallback?: 'discard' | 'other' | Expression<string>; /** String to use directly as the system prompt template * @default Please classify the text provided by the user into one of the following categories: {categories}, and use the provided formatting instructions below. Don't explain, and only output the json. */ systemPromptTemplate?: string | Expression<string> | PlaceholderValue; /** Whether to enable auto-fixing (may trigger an additional LLM call if output is broken) * @default true */ enableAutoFixing?: boolean | Expression<boolean>; /** Batch processing options for rate limiting * @default {} */ batching?: { /** How many items to process in parallel. This is useful for rate limiting, but might impact the log output ordering. * @default 5 */ batchSize?: number | Expression<number>; /** Delay in milliseconds between batches. This is useful for rate limiting. * @default 0 */ delayBetweenBatches?: number | Expression<number>; }; }; } export interface LcTextClassifierV11SubnodeConfig { model: LanguageModelInstance | LanguageModelInstance[]; } interface LcTextClassifierV11NodeBase { type: '@n8n/n8n-nodes-langchain.textClassifier'; version: 1.1; } export type LcTextClassifierV11ParamsNode = LcTextClassifierV11NodeBase & { config: NodeConfig<LcTextClassifierV11Params> & { subnodes: LcTextClassifierV11SubnodeConfig }; }; export type LcTextClassifierV11Node = LcTextClassifierV11ParamsNode;