@tpsdev-ai/flair-client 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +1 -1
- package/dist/client.js +2 -2
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare class MemoryApi {
|
|
|
45
45
|
* is found (score >= threshold), returns it instead of creating a new one.
|
|
46
46
|
* Default: false (no dedup check). */
|
|
47
47
|
dedup?: boolean;
|
|
48
|
-
/** Similarity threshold for dedup. Default: 0.
|
|
48
|
+
/** Similarity threshold for dedup. Default: 0.95 */
|
|
49
49
|
dedupThreshold?: number;
|
|
50
50
|
}): Promise<Memory>;
|
|
51
51
|
/** Search memories by meaning. */
|
package/dist/client.js
CHANGED
|
@@ -92,7 +92,7 @@ class MemoryApi {
|
|
|
92
92
|
// Near-duplicate check — skip for very short content where similarity
|
|
93
93
|
// is unreliable (e.g., "ok", "thanks" would match each other)
|
|
94
94
|
if (opts.dedup && content.length >= 20) {
|
|
95
|
-
const threshold = opts.dedupThreshold ?? 0.
|
|
95
|
+
const threshold = opts.dedupThreshold ?? 0.95;
|
|
96
96
|
const existing = await this.search(content, { limit: 1, minScore: threshold });
|
|
97
97
|
if (existing.length > 0) {
|
|
98
98
|
// Return the existing memory instead of creating a duplicate
|
|
@@ -101,7 +101,7 @@ class MemoryApi {
|
|
|
101
101
|
return match;
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
|
-
const id = opts.id ?? `${this.client.agentId}-${
|
|
104
|
+
const id = opts.id ?? `${this.client.agentId}-${crypto.randomUUID()}`;
|
|
105
105
|
const record = {
|
|
106
106
|
id,
|
|
107
107
|
agentId: this.client.agentId,
|
package/package.json
CHANGED