@n8n/n8n-nodes-langchain
Version:

55 lines (49 loc) • 1.9 kB
text/typescript
/**
* Summarization Chain Node - Version 1
* Transforms text into a concise summary
*/
export interface LcChainSummarizationV1Params {
/**
* The type of summarization to run
* @default map_reduce
*/
type?: 'map_reduce' | 'refine' | 'stuff' | Expression<string>;
options?: {
/** Final Prompt to Combine
* @hint The prompt to combine individual summaries
* @displayOptions.show { /type: ["map_reduce"] }
*/
combineMapPrompt?: string | Expression<string> | PlaceholderValue;
/** Individual Summary Prompt
* @hint The prompt to summarize an individual document (or chunk)
* @displayOptions.show { /type: ["map_reduce"] }
*/
prompt?: string | Expression<string> | PlaceholderValue;
/** Prompt
* @displayOptions.show { /type: ["stuff"] }
*/
prompt?: string | Expression<string> | PlaceholderValue;
/** Subsequent (Refine) Prompt
* @hint The prompt to refine the summary based on the next document (or chunk)
* @displayOptions.show { /type: ["refine"] }
*/
refinePrompt?: string | Expression<string> | PlaceholderValue;
/** Initial Prompt
* @hint The prompt for the first document (or chunk)
* @displayOptions.show { /type: ["refine"] }
*/
refineQuestionPrompt?: string | Expression<string> | PlaceholderValue;
};
}
export interface LcChainSummarizationV1SubnodeConfig {
model?: LanguageModelInstance | LanguageModelInstance[];
documentLoader?: DocumentLoaderInstance | DocumentLoaderInstance[];
}
interface LcChainSummarizationV1NodeBase {
type: '@n8n/n8n-nodes-langchain.chainSummarization';
version: 1;
}
export type LcChainSummarizationV1ParamsNode = LcChainSummarizationV1NodeBase & {
config: NodeConfig<LcChainSummarizationV1Params> & { subnodes?: LcChainSummarizationV1SubnodeConfig };
};
export type LcChainSummarizationV1Node = LcChainSummarizationV1ParamsNode;