@n8n/n8n-nodes-langchain
Version:
45 lines (38 loc) • 1.37 kB
text/typescript
/**
* Question and Answer Chain Node - Version 1.2
* Answer questions about retrieved documents
*/
export interface LcChainRetrievalQaV12Params {
/**
* Query
* @default ={{ $json.chatInput }}
*/
query?: string | Expression<string>;
/**
* Prompt (User Message)
* @displayOptions.show { promptType: ["define"] }
* @required when the displayOptions conditions above match
*/
text?: string | Expression<string>;
options?: {
/** Template string used for the system prompt. This should include the variable `{context}` for the provided context. For text completion models, you should also include the variable `{question}` for the user’s query.
*/
systemPromptTemplate?: string | Expression<string>;
};
}
export type LcChainRetrievalQaV12Output = {
response: string;
};
export interface LcChainRetrievalQaV12SubnodeConfig {
model: LanguageModelInstance | LanguageModelInstance[];
retriever: RetrieverInstance;
}
interface LcChainRetrievalQaV12NodeBase {
type: '@n8n/n8n-nodes-langchain.chainRetrievalQa';
version: 1.2;
}
export type LcChainRetrievalQaV12ParamsNode = LcChainRetrievalQaV12NodeBase & {
config: NodeConfig<LcChainRetrievalQaV12Params> & { subnodes: LcChainRetrievalQaV12SubnodeConfig };
output?: Items<LcChainRetrievalQaV12Output>;
};
export type LcChainRetrievalQaV12Node = LcChainRetrievalQaV12ParamsNode;