mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-29 03:01:50 +03:00
Memory-lancedb: configurable capture limit (#16624) (thanks @ciberponk)
This commit is contained in:
committed by
Vignesh
parent
3e00460cdc
commit
8cb0373bc1
@@ -12,6 +12,7 @@ import { Type } from "@sinclair/typebox";
|
||||
import { randomUUID } from "node:crypto";
|
||||
import OpenAI from "openai";
|
||||
import {
|
||||
DEFAULT_CAPTURE_MAX_CHARS,
|
||||
MEMORY_CATEGORIES,
|
||||
type MemoryCategory,
|
||||
memoryConfigSchema,
|
||||
@@ -195,7 +196,7 @@ const MEMORY_TRIGGERS = [
|
||||
];
|
||||
|
||||
export function shouldCapture(text: string, options?: { maxChars?: number }): boolean {
|
||||
const maxChars = options?.maxChars ?? 1500;
|
||||
const maxChars = options?.maxChars ?? DEFAULT_CAPTURE_MAX_CHARS;
|
||||
if (text.length < 10 || text.length > maxChars) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user