feat(editor): Improve how we show default Agent prompt and Memory session parameters (#11491)

This commit is contained in:
oleg
2024-11-12 11:33:20 +01:00
committed by GitHub
parent e875bc5592
commit 565f8cd8c7
26 changed files with 231 additions and 135 deletions

View File

@@ -1,4 +1,6 @@
/* eslint-disable n8n-nodes-base/node-dirname-against-convention */
import type { BufferWindowMemoryInput } from 'langchain/memory';
import { BufferWindowMemory } from 'langchain/memory';
import {
NodeConnectionType,
type INodeType,
@@ -6,12 +8,16 @@ import {
type ISupplyDataFunctions,
type SupplyData,
} from 'n8n-workflow';
import type { BufferWindowMemoryInput } from 'langchain/memory';
import { BufferWindowMemory } from 'langchain/memory';
import { getSessionId } from '../../../utils/helpers';
import { logWrapper } from '../../../utils/logWrapper';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
import { sessionIdOption, sessionKeyProperty, contextWindowLengthProperty } from '../descriptions';
import { getSessionId } from '../../../utils/helpers';
import {
sessionIdOption,
sessionKeyProperty,
contextWindowLengthProperty,
expressionSessionKeyProperty,
} from '../descriptions';
class MemoryChatBufferSingleton {
private static instance: MemoryChatBufferSingleton;
@@ -72,7 +78,7 @@ export class MemoryBufferWindow implements INodeType {
name: 'memoryBufferWindow',
icon: 'fa:database',
group: ['transform'],
version: [1, 1.1, 1.2],
version: [1, 1.1, 1.2, 1.3],
description: 'Stores in n8n memory, so no credentials required',
defaults: {
name: 'Window Buffer Memory',
@@ -129,6 +135,7 @@ export class MemoryBufferWindow implements INodeType {
},
},
},
expressionSessionKeyProperty(1.3),
sessionKeyProperty,
contextWindowLengthProperty,
],