feat(Postgres Chat Memory, Redis Chat Memory, Xata): Add support for context window length (#10203)

This commit is contained in:
jeanpaul
2024-08-06 10:42:18 +02:00
committed by GitHub
parent 1eba7c3c76
commit e3edeaa035
5 changed files with 55 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ import type { BufferWindowMemoryInput } from 'langchain/memory';
import { BufferWindowMemory } from 'langchain/memory';
import { logWrapper } from '../../../utils/logWrapper';
import { getConnectionHintNoticeField } from '../../../utils/sharedFields';
import { sessionIdOption, sessionKeyProperty } from '../descriptions';
import { sessionIdOption, sessionKeyProperty, contextWindowLengthProperty } from '../descriptions';
import { getSessionId } from '../../../utils/helpers';
class MemoryChatBufferSingleton {
@@ -130,13 +130,7 @@ export class MemoryBufferWindow implements INodeType {
},
},
sessionKeyProperty,
{
displayName: 'Context Window Length',
name: 'contextWindowLength',
type: 'number',
default: 5,
description: 'The number of previous messages to consider for context',
},
contextWindowLengthProperty,
],
};