mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
fix(AI Agent Node): Move model retrieval into try/catch to fix continueOnFail handling (#13165)
This commit is contained in:
@@ -321,16 +321,16 @@ export class ChainSummarizationV2 implements INodeType {
|
||||
| 'simple'
|
||||
| 'advanced';
|
||||
|
||||
const model = (await this.getInputConnectionData(
|
||||
NodeConnectionType.AiLanguageModel,
|
||||
0,
|
||||
)) as BaseLanguageModel;
|
||||
|
||||
const items = this.getInputData();
|
||||
const returnData: INodeExecutionData[] = [];
|
||||
|
||||
for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
|
||||
try {
|
||||
const model = (await this.getInputConnectionData(
|
||||
NodeConnectionType.AiLanguageModel,
|
||||
0,
|
||||
)) as BaseLanguageModel;
|
||||
|
||||
const summarizationMethodAndPrompts = this.getNodeParameter(
|
||||
'options.summarizationMethodAndPrompts.values',
|
||||
itemIndex,
|
||||
@@ -411,9 +411,12 @@ export class ChainSummarizationV2 implements INodeType {
|
||||
}
|
||||
|
||||
const processedItem = await processor.processItem(item, itemIndex);
|
||||
const response = await chain.call({
|
||||
input_documents: processedItem,
|
||||
});
|
||||
const response = await chain.invoke(
|
||||
{
|
||||
input_documents: processedItem,
|
||||
},
|
||||
{ signal: this.getExecutionCancelSignal() },
|
||||
);
|
||||
returnData.push({ json: { response } });
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user