mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
feat(ipuaro): add session configuration
- Add SessionConfigSchema with persistIndefinitely, maxHistoryMessages, saveInputHistory - Implement Session.truncateHistory() method for limiting message history - Update HandleMessage to support history truncation and input history toggle - Add config flow through useSession and App components - Add 19 unit tests for SessionConfigSchema - Update CHANGELOG.md and ROADMAP.md for v0.22.2
This commit is contained in:
@@ -94,6 +94,12 @@ export class Session {
|
||||
}
|
||||
}
|
||||
|
||||
truncateHistory(maxMessages: number): void {
|
||||
if (this.history.length > maxMessages) {
|
||||
this.history = this.history.slice(-maxMessages)
|
||||
}
|
||||
}
|
||||
|
||||
clearHistory(): void {
|
||||
this.history = []
|
||||
this.context = {
|
||||
|
||||
Reference in New Issue
Block a user