/**
 * Question and Answer Chain Node - Version 1.7
 * Answer questions about retrieved documents
 */


export interface LcChainRetrievalQaV17Params {
/**
 * Source for Prompt (User Message)
 * @builderHint Use 'auto' when following a chat trigger, 'define' when custom prompt needed
 * @default auto
 */
    promptType?: 'auto' | 'define' | Expression<string>;
/**
 * Prompt (User Message)
 * @displayOptions.show { promptType: ["auto", "define"] }
 * @default ={{ $json.guardrailsInput }}
 */
    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>;
    /** 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 `{input}` for the user’s query.
     */
    systemPromptTemplate?: string | Expression<string>;
    /** 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 LcChainRetrievalQaV17SubnodeConfig {
  model: LanguageModelInstance | LanguageModelInstance[];
  retriever: RetrieverInstance;
}

interface LcChainRetrievalQaV17NodeBase {
  type: '@n8n/n8n-nodes-langchain.chainRetrievalQa';
  version: 1.7;
}

export type LcChainRetrievalQaV17ParamsNode = LcChainRetrievalQaV17NodeBase & {
  config: NodeConfig<LcChainRetrievalQaV17Params> & { subnodes: LcChainRetrievalQaV17SubnodeConfig };
};

export type LcChainRetrievalQaV17Node = LcChainRetrievalQaV17ParamsNode;