@reminix/sdk 0.12.0 → 0.13.0
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/CHANGELOG.md +12 -0
- package/client.d.mts +8 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +8 -2
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents.d.mts +92 -4
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +92 -4
- package/resources/agents.d.ts.map +1 -1
- package/resources/execution-logs.d.mts +3 -3
- package/resources/execution-logs.d.mts.map +1 -1
- package/resources/execution-logs.d.ts +3 -3
- package/resources/execution-logs.d.ts.map +1 -1
- package/resources/execution-logs.js +1 -1
- package/resources/execution-logs.mjs +1 -1
- package/resources/index.d.mts +3 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -0
- package/resources/index.mjs.map +1 -1
- package/resources/knowledge/collections/collections.d.mts +89 -0
- package/resources/knowledge/collections/collections.d.mts.map +1 -0
- package/resources/knowledge/collections/collections.d.ts +89 -0
- package/resources/knowledge/collections/collections.d.ts.map +1 -0
- package/resources/knowledge/collections/collections.js +56 -0
- package/resources/knowledge/collections/collections.js.map +1 -0
- package/resources/knowledge/collections/collections.mjs +51 -0
- package/resources/knowledge/collections/collections.mjs.map +1 -0
- package/resources/knowledge/collections/documents.d.mts +121 -0
- package/resources/knowledge/collections/documents.d.mts.map +1 -0
- package/resources/knowledge/collections/documents.d.ts +121 -0
- package/resources/knowledge/collections/documents.d.ts.map +1 -0
- package/resources/knowledge/collections/documents.js +62 -0
- package/resources/knowledge/collections/documents.js.map +1 -0
- package/resources/knowledge/collections/documents.mjs +58 -0
- package/resources/knowledge/collections/documents.mjs.map +1 -0
- package/resources/knowledge/collections/index.d.mts +3 -0
- package/resources/knowledge/collections/index.d.mts.map +1 -0
- package/resources/knowledge/collections/index.d.ts +3 -0
- package/resources/knowledge/collections/index.d.ts.map +1 -0
- package/resources/knowledge/collections/index.js +9 -0
- package/resources/knowledge/collections/index.js.map +1 -0
- package/resources/knowledge/collections/index.mjs +4 -0
- package/resources/knowledge/collections/index.mjs.map +1 -0
- package/resources/knowledge/collections.d.mts +2 -0
- package/resources/knowledge/collections.d.mts.map +1 -0
- package/resources/knowledge/collections.d.ts +2 -0
- package/resources/knowledge/collections.d.ts.map +1 -0
- package/resources/knowledge/collections.js +6 -0
- package/resources/knowledge/collections.js.map +1 -0
- package/resources/knowledge/collections.mjs +3 -0
- package/resources/knowledge/collections.mjs.map +1 -0
- package/resources/knowledge/index.d.mts +3 -0
- package/resources/knowledge/index.d.mts.map +1 -0
- package/resources/knowledge/index.d.ts +3 -0
- package/resources/knowledge/index.d.ts.map +1 -0
- package/resources/knowledge/index.js +9 -0
- package/resources/knowledge/index.js.map +1 -0
- package/resources/knowledge/index.mjs +4 -0
- package/resources/knowledge/index.mjs.map +1 -0
- package/resources/knowledge/knowledge.d.mts +65 -0
- package/resources/knowledge/knowledge.d.mts.map +1 -0
- package/resources/knowledge/knowledge.d.ts +65 -0
- package/resources/knowledge/knowledge.d.ts.map +1 -0
- package/resources/knowledge/knowledge.js +26 -0
- package/resources/knowledge/knowledge.js.map +1 -0
- package/resources/knowledge/knowledge.mjs +21 -0
- package/resources/knowledge/knowledge.mjs.map +1 -0
- package/resources/knowledge.d.mts +2 -0
- package/resources/knowledge.d.mts.map +1 -0
- package/resources/knowledge.d.ts +2 -0
- package/resources/knowledge.d.ts.map +1 -0
- package/resources/knowledge.js +6 -0
- package/resources/knowledge.js.map +1 -0
- package/resources/knowledge.mjs +3 -0
- package/resources/knowledge.mjs.map +1 -0
- package/resources/memory.d.mts +148 -0
- package/resources/memory.d.mts.map +1 -0
- package/resources/memory.d.ts +148 -0
- package/resources/memory.d.ts.map +1 -0
- package/resources/memory.js +82 -0
- package/resources/memory.js.map +1 -0
- package/resources/memory.mjs +78 -0
- package/resources/memory.mjs.map +1 -0
- package/resources/tools.d.mts +60 -2
- package/resources/tools.d.mts.map +1 -1
- package/resources/tools.d.ts +60 -2
- package/resources/tools.d.ts.map +1 -1
- package/src/client.ts +30 -0
- package/src/resources/agents.ts +108 -3
- package/src/resources/execution-logs.ts +3 -3
- package/src/resources/index.ts +10 -0
- package/src/resources/knowledge/collections/collections.ts +167 -0
- package/src/resources/knowledge/collections/documents.ts +200 -0
- package/src/resources/knowledge/collections/index.ts +22 -0
- package/src/resources/knowledge/collections.ts +3 -0
- package/src/resources/knowledge/index.ts +11 -0
- package/src/resources/knowledge/knowledge.ts +101 -0
- package/src/resources/knowledge.ts +3 -0
- package/src/resources/memory.ts +188 -0
- package/src/resources/tools.ts +70 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import * as CollectionsAPI from "./collections/collections.js";
|
|
3
|
+
import { CollectionCreateParams, CollectionListParams, CollectionUpdateParams, Collections, KnowledgeCollection, KnowledgeCollectionsCursor } from "./collections/collections.js";
|
|
4
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
5
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
6
|
+
export declare class Knowledge extends APIResource {
|
|
7
|
+
collections: CollectionsAPI.Collections;
|
|
8
|
+
/**
|
|
9
|
+
* Search across one or more knowledge collections using semantic similarity.
|
|
10
|
+
*
|
|
11
|
+
* The search uses vector embeddings to find the most relevant content. Results are
|
|
12
|
+
* ordered by relevance score (0-1, higher is more similar).
|
|
13
|
+
*/
|
|
14
|
+
search(body: KnowledgeSearchParams, options?: RequestOptions): APIPromise<KnowledgeSearchResponse>;
|
|
15
|
+
}
|
|
16
|
+
export interface KnowledgeSearchResponse {
|
|
17
|
+
chunks: Array<KnowledgeSearchResponse.Chunk>;
|
|
18
|
+
/**
|
|
19
|
+
* Number of results found
|
|
20
|
+
*/
|
|
21
|
+
count: number;
|
|
22
|
+
}
|
|
23
|
+
export declare namespace KnowledgeSearchResponse {
|
|
24
|
+
interface Chunk {
|
|
25
|
+
/**
|
|
26
|
+
* Position in document
|
|
27
|
+
*/
|
|
28
|
+
chunkIndex: number;
|
|
29
|
+
/**
|
|
30
|
+
* Chunk text content
|
|
31
|
+
*/
|
|
32
|
+
content: string;
|
|
33
|
+
/**
|
|
34
|
+
* Source document ID
|
|
35
|
+
*/
|
|
36
|
+
documentId: string;
|
|
37
|
+
/**
|
|
38
|
+
* Similarity score (0-1)
|
|
39
|
+
*/
|
|
40
|
+
score: number;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export interface KnowledgeSearchParams {
|
|
44
|
+
/**
|
|
45
|
+
* Collection IDs to search
|
|
46
|
+
*/
|
|
47
|
+
collectionIds: Array<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Natural language search query
|
|
50
|
+
*/
|
|
51
|
+
query: string;
|
|
52
|
+
/**
|
|
53
|
+
* Maximum number of results
|
|
54
|
+
*/
|
|
55
|
+
limit?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Minimum similarity score (0-1)
|
|
58
|
+
*/
|
|
59
|
+
threshold?: number;
|
|
60
|
+
}
|
|
61
|
+
export declare namespace Knowledge {
|
|
62
|
+
export { type KnowledgeSearchResponse as KnowledgeSearchResponse, type KnowledgeSearchParams as KnowledgeSearchParams, };
|
|
63
|
+
export { Collections as Collections, type KnowledgeCollection as KnowledgeCollection, type KnowledgeCollectionsCursor as KnowledgeCollectionsCursor, type CollectionCreateParams as CollectionCreateParams, type CollectionUpdateParams as CollectionUpdateParams, type CollectionListParams as CollectionListParams, };
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=knowledge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../../src/resources/knowledge/knowledge.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EACL,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,WAAW,EACX,mBAAmB,EACnB,0BAA0B,EAC3B;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,SAAU,SAAQ,WAAW;IACxC,WAAW,EAAE,cAAc,CAAC,WAAW,CAAgD;IAEvF;;;;;OAKG;IACH,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;CAGnG;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,KAAK,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAAC;IAE7C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,yBAAiB,uBAAuB,CAAC;IACvC,UAAiB,KAAK;QACpB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,OAAO,EAAE,MAAM,CAAC;QAEhB;;WAEG;QACH,UAAU,EAAE,MAAM,CAAC;QAEnB;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;KACf;CACF;AAED,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAE7B;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAID,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC;IACjC,OAAO,EACL,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,qBAAqB,IAAI,qBAAqB,GACpD,CAAC;IAEF,OAAO,EACL,WAAW,IAAI,WAAW,EAC1B,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Knowledge = void 0;
|
|
5
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../core/resource.js");
|
|
7
|
+
const CollectionsAPI = tslib_1.__importStar(require("./collections/collections.js"));
|
|
8
|
+
const collections_1 = require("./collections/collections.js");
|
|
9
|
+
class Knowledge extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.collections = new CollectionsAPI.Collections(this._client);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Search across one or more knowledge collections using semantic similarity.
|
|
16
|
+
*
|
|
17
|
+
* The search uses vector embeddings to find the most relevant content. Results are
|
|
18
|
+
* ordered by relevance score (0-1, higher is more similar).
|
|
19
|
+
*/
|
|
20
|
+
search(body, options) {
|
|
21
|
+
return this._client.post('/knowledge/search', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Knowledge = Knowledge;
|
|
25
|
+
Knowledge.Collections = collections_1.Collections;
|
|
26
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../../src/resources/knowledge/knowledge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,qFAA4D;AAC5D,8DAOmC;AAInC,MAAa,SAAU,SAAQ,sBAAW;IAA1C;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAWzF,CAAC;IATC;;;;;OAKG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAZD,8BAYC;AAyDD,SAAS,CAAC,WAAW,GAAG,yBAAW,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../core/resource.mjs";
|
|
3
|
+
import * as CollectionsAPI from "./collections/collections.mjs";
|
|
4
|
+
import { Collections, } from "./collections/collections.mjs";
|
|
5
|
+
export class Knowledge extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.collections = new CollectionsAPI.Collections(this._client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Search across one or more knowledge collections using semantic similarity.
|
|
12
|
+
*
|
|
13
|
+
* The search uses vector embeddings to find the most relevant content. Results are
|
|
14
|
+
* ordered by relevance score (0-1, higher is more similar).
|
|
15
|
+
*/
|
|
16
|
+
search(body, options) {
|
|
17
|
+
return this._client.post('/knowledge/search', { body, ...options });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
Knowledge.Collections = Collections;
|
|
21
|
+
//# sourceMappingURL=knowledge.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.mjs","sourceRoot":"","sources":["../../src/resources/knowledge/knowledge.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,cAAc;OACnB,EAIL,WAAW,GAGZ;AAID,MAAM,OAAO,SAAU,SAAQ,WAAW;IAA1C;;QACE,gBAAW,GAA+B,IAAI,cAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAWzF,CAAC;IATC;;;;;OAKG;IACH,MAAM,CAAC,IAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;CACF;AAyDD,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.mts","sourceRoot":"","sources":["../src/resources/knowledge.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.d.ts","sourceRoot":"","sources":["../src/resources/knowledge.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const tslib_1 = require("../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./knowledge/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.js","sourceRoot":"","sources":["../src/resources/knowledge.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,+DAAkC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"knowledge.mjs","sourceRoot":"","sources":["../src/resources/knowledge.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
export declare class MemoryResource extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get a memory value by key for a specific identity.
|
|
7
|
+
*
|
|
8
|
+
* Identity is specified via query parameters with the `identity.` prefix.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const memory = await client.memory.retrieve('x');
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
retrieve(key: string, options?: RequestOptions): APIPromise<Memory>;
|
|
16
|
+
/**
|
|
17
|
+
* List all memory keys for a specific identity.
|
|
18
|
+
*
|
|
19
|
+
* Identity is specified via query parameters with the `identity.` prefix. For
|
|
20
|
+
* example: `?identity.user_id=user_123&identity.tenant_id=acme`
|
|
21
|
+
*
|
|
22
|
+
* Returns memory keys and metadata (not full values for efficiency).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const memories = await client.memory.list();
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
list(options?: RequestOptions): APIPromise<MemoryListResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete a memory by key for a specific identity.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* await client.memory.delete('x');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
delete(key: string, options?: RequestOptions): APIPromise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete all memories for a specific identity.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.memory.deleteAll();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
deleteAll(options?: RequestOptions): APIPromise<MemoryDeleteAllResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Store a key-value memory for a specific identity.
|
|
50
|
+
*
|
|
51
|
+
* If a memory with the same key already exists, it will be updated.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const memory = await client.memory.store({
|
|
56
|
+
* identity: { user_id: 'user_123' },
|
|
57
|
+
* key: 'preferred_language',
|
|
58
|
+
* value: 'en',
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
store(body: MemoryStoreParams, options?: RequestOptions): APIPromise<Memory>;
|
|
63
|
+
}
|
|
64
|
+
export interface Memory {
|
|
65
|
+
/**
|
|
66
|
+
* Unique memory ID
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
/**
|
|
70
|
+
* When the memory was created
|
|
71
|
+
*/
|
|
72
|
+
createdAt: string;
|
|
73
|
+
/**
|
|
74
|
+
* When the memory expires
|
|
75
|
+
*/
|
|
76
|
+
expiresAt: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Identity fields for memory scoping (e.g., user_id, tenant_id)
|
|
79
|
+
*/
|
|
80
|
+
identity: {
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Memory key
|
|
85
|
+
*/
|
|
86
|
+
key: string;
|
|
87
|
+
/**
|
|
88
|
+
* Project ID
|
|
89
|
+
*/
|
|
90
|
+
projectId: string;
|
|
91
|
+
/**
|
|
92
|
+
* When the memory was last updated
|
|
93
|
+
*/
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
/**
|
|
96
|
+
* Memory value
|
|
97
|
+
*/
|
|
98
|
+
value?: unknown;
|
|
99
|
+
}
|
|
100
|
+
export interface MemoryListResponse {
|
|
101
|
+
data: Array<MemoryListResponse.Data>;
|
|
102
|
+
}
|
|
103
|
+
export declare namespace MemoryListResponse {
|
|
104
|
+
interface Data {
|
|
105
|
+
/**
|
|
106
|
+
* When the memory expires (if set)
|
|
107
|
+
*/
|
|
108
|
+
expiresAt: string | null;
|
|
109
|
+
/**
|
|
110
|
+
* Memory key
|
|
111
|
+
*/
|
|
112
|
+
key: string;
|
|
113
|
+
/**
|
|
114
|
+
* When the memory was last updated
|
|
115
|
+
*/
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export interface MemoryDeleteAllResponse {
|
|
120
|
+
/**
|
|
121
|
+
* Number of memories deleted
|
|
122
|
+
*/
|
|
123
|
+
deleted: number;
|
|
124
|
+
}
|
|
125
|
+
export interface MemoryStoreParams {
|
|
126
|
+
/**
|
|
127
|
+
* Identity fields for memory scoping (e.g., user_id, tenant_id)
|
|
128
|
+
*/
|
|
129
|
+
identity: {
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Memory key
|
|
134
|
+
*/
|
|
135
|
+
key: string;
|
|
136
|
+
/**
|
|
137
|
+
* Optional expiration time (ISO 8601)
|
|
138
|
+
*/
|
|
139
|
+
expiresAt?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Value to store
|
|
142
|
+
*/
|
|
143
|
+
value?: unknown;
|
|
144
|
+
}
|
|
145
|
+
export declare namespace MemoryResource {
|
|
146
|
+
export { type Memory as Memory, type MemoryListResponse as MemoryListResponse, type MemoryDeleteAllResponse as MemoryDeleteAllResponse, type MemoryStoreParams as MemoryStoreParams, };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=memory.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.mts","sourceRoot":"","sources":["../src/resources/memory.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAInE;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI9D;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO/D;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIxE;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAG7E;AAED,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,IAAI;QACnB;;WAEG;QACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAEzB;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;KACnB;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
export declare class MemoryResource extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get a memory value by key for a specific identity.
|
|
7
|
+
*
|
|
8
|
+
* Identity is specified via query parameters with the `identity.` prefix.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const memory = await client.memory.retrieve('x');
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
retrieve(key: string, options?: RequestOptions): APIPromise<Memory>;
|
|
16
|
+
/**
|
|
17
|
+
* List all memory keys for a specific identity.
|
|
18
|
+
*
|
|
19
|
+
* Identity is specified via query parameters with the `identity.` prefix. For
|
|
20
|
+
* example: `?identity.user_id=user_123&identity.tenant_id=acme`
|
|
21
|
+
*
|
|
22
|
+
* Returns memory keys and metadata (not full values for efficiency).
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const memories = await client.memory.list();
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
list(options?: RequestOptions): APIPromise<MemoryListResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Delete a memory by key for a specific identity.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* await client.memory.delete('x');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
delete(key: string, options?: RequestOptions): APIPromise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Delete all memories for a specific identity.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```ts
|
|
44
|
+
* const response = await client.memory.deleteAll();
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
deleteAll(options?: RequestOptions): APIPromise<MemoryDeleteAllResponse>;
|
|
48
|
+
/**
|
|
49
|
+
* Store a key-value memory for a specific identity.
|
|
50
|
+
*
|
|
51
|
+
* If a memory with the same key already exists, it will be updated.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const memory = await client.memory.store({
|
|
56
|
+
* identity: { user_id: 'user_123' },
|
|
57
|
+
* key: 'preferred_language',
|
|
58
|
+
* value: 'en',
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
store(body: MemoryStoreParams, options?: RequestOptions): APIPromise<Memory>;
|
|
63
|
+
}
|
|
64
|
+
export interface Memory {
|
|
65
|
+
/**
|
|
66
|
+
* Unique memory ID
|
|
67
|
+
*/
|
|
68
|
+
id: string;
|
|
69
|
+
/**
|
|
70
|
+
* When the memory was created
|
|
71
|
+
*/
|
|
72
|
+
createdAt: string;
|
|
73
|
+
/**
|
|
74
|
+
* When the memory expires
|
|
75
|
+
*/
|
|
76
|
+
expiresAt: string | null;
|
|
77
|
+
/**
|
|
78
|
+
* Identity fields for memory scoping (e.g., user_id, tenant_id)
|
|
79
|
+
*/
|
|
80
|
+
identity: {
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Memory key
|
|
85
|
+
*/
|
|
86
|
+
key: string;
|
|
87
|
+
/**
|
|
88
|
+
* Project ID
|
|
89
|
+
*/
|
|
90
|
+
projectId: string;
|
|
91
|
+
/**
|
|
92
|
+
* When the memory was last updated
|
|
93
|
+
*/
|
|
94
|
+
updatedAt: string;
|
|
95
|
+
/**
|
|
96
|
+
* Memory value
|
|
97
|
+
*/
|
|
98
|
+
value?: unknown;
|
|
99
|
+
}
|
|
100
|
+
export interface MemoryListResponse {
|
|
101
|
+
data: Array<MemoryListResponse.Data>;
|
|
102
|
+
}
|
|
103
|
+
export declare namespace MemoryListResponse {
|
|
104
|
+
interface Data {
|
|
105
|
+
/**
|
|
106
|
+
* When the memory expires (if set)
|
|
107
|
+
*/
|
|
108
|
+
expiresAt: string | null;
|
|
109
|
+
/**
|
|
110
|
+
* Memory key
|
|
111
|
+
*/
|
|
112
|
+
key: string;
|
|
113
|
+
/**
|
|
114
|
+
* When the memory was last updated
|
|
115
|
+
*/
|
|
116
|
+
updatedAt: string;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export interface MemoryDeleteAllResponse {
|
|
120
|
+
/**
|
|
121
|
+
* Number of memories deleted
|
|
122
|
+
*/
|
|
123
|
+
deleted: number;
|
|
124
|
+
}
|
|
125
|
+
export interface MemoryStoreParams {
|
|
126
|
+
/**
|
|
127
|
+
* Identity fields for memory scoping (e.g., user_id, tenant_id)
|
|
128
|
+
*/
|
|
129
|
+
identity: {
|
|
130
|
+
[key: string]: unknown;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Memory key
|
|
134
|
+
*/
|
|
135
|
+
key: string;
|
|
136
|
+
/**
|
|
137
|
+
* Optional expiration time (ISO 8601)
|
|
138
|
+
*/
|
|
139
|
+
expiresAt?: string;
|
|
140
|
+
/**
|
|
141
|
+
* Value to store
|
|
142
|
+
*/
|
|
143
|
+
value?: unknown;
|
|
144
|
+
}
|
|
145
|
+
export declare namespace MemoryResource {
|
|
146
|
+
export { type Memory as Memory, type MemoryListResponse as MemoryListResponse, type MemoryDeleteAllResponse as MemoryDeleteAllResponse, type MemoryStoreParams as MemoryStoreParams, };
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/resources/memory.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OAEd,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;IAInE;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,kBAAkB,CAAC;IAI9D;;;;;;;OAOG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO/D;;;;;;;OAOG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,uBAAuB,CAAC;IAIxE;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAI,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,MAAM,CAAC;CAG7E;AAED,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,KAAK,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,yBAAiB,kBAAkB,CAAC;IAClC,UAAiB,IAAI;QACnB;;WAEG;QACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QAEzB;;WAEG;QACH,GAAG,EAAE,MAAM,CAAC;QAEZ;;WAEG;QACH,SAAS,EAAE,MAAM,CAAC;KACnB;CACF;AAED,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,MAAM,IAAI,MAAM,EACrB,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MemoryResource = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const headers_1 = require("../internal/headers.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
class MemoryResource extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Get a memory value by key for a specific identity.
|
|
11
|
+
*
|
|
12
|
+
* Identity is specified via query parameters with the `identity.` prefix.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const memory = await client.memory.retrieve('x');
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
retrieve(key, options) {
|
|
20
|
+
return this._client.get((0, path_1.path) `/memory/${key}`, options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* List all memory keys for a specific identity.
|
|
24
|
+
*
|
|
25
|
+
* Identity is specified via query parameters with the `identity.` prefix. For
|
|
26
|
+
* example: `?identity.user_id=user_123&identity.tenant_id=acme`
|
|
27
|
+
*
|
|
28
|
+
* Returns memory keys and metadata (not full values for efficiency).
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const memories = await client.memory.list();
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
list(options) {
|
|
36
|
+
return this._client.get('/memory', options);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Delete a memory by key for a specific identity.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* await client.memory.delete('x');
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
delete(key, options) {
|
|
47
|
+
return this._client.delete((0, path_1.path) `/memory/${key}`, {
|
|
48
|
+
...options,
|
|
49
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Delete all memories for a specific identity.
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const response = await client.memory.deleteAll();
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
deleteAll(options) {
|
|
61
|
+
return this._client.delete('/memory', options);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Store a key-value memory for a specific identity.
|
|
65
|
+
*
|
|
66
|
+
* If a memory with the same key already exists, it will be updated.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const memory = await client.memory.store({
|
|
71
|
+
* identity: { user_id: 'user_123' },
|
|
72
|
+
* key: 'preferred_language',
|
|
73
|
+
* value: 'en',
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
store(body, options) {
|
|
78
|
+
return this._client.post('/memory', { body, ...options });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.MemoryResource = MemoryResource;
|
|
82
|
+
//# sourceMappingURL=memory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/resources/memory.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAW,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,WAAW,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,GAAW,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,WAAW,GAAG,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAuB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF;AA5ED,wCA4EC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
export class MemoryResource extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Get a memory value by key for a specific identity.
|
|
8
|
+
*
|
|
9
|
+
* Identity is specified via query parameters with the `identity.` prefix.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const memory = await client.memory.retrieve('x');
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
retrieve(key, options) {
|
|
17
|
+
return this._client.get(path `/memory/${key}`, options);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* List all memory keys for a specific identity.
|
|
21
|
+
*
|
|
22
|
+
* Identity is specified via query parameters with the `identity.` prefix. For
|
|
23
|
+
* example: `?identity.user_id=user_123&identity.tenant_id=acme`
|
|
24
|
+
*
|
|
25
|
+
* Returns memory keys and metadata (not full values for efficiency).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const memories = await client.memory.list();
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
list(options) {
|
|
33
|
+
return this._client.get('/memory', options);
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Delete a memory by key for a specific identity.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* await client.memory.delete('x');
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
delete(key, options) {
|
|
44
|
+
return this._client.delete(path `/memory/${key}`, {
|
|
45
|
+
...options,
|
|
46
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Delete all memories for a specific identity.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```ts
|
|
54
|
+
* const response = await client.memory.deleteAll();
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
deleteAll(options) {
|
|
58
|
+
return this._client.delete('/memory', options);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Store a key-value memory for a specific identity.
|
|
62
|
+
*
|
|
63
|
+
* If a memory with the same key already exists, it will be updated.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const memory = await client.memory.store({
|
|
68
|
+
* identity: { user_id: 'user_123' },
|
|
69
|
+
* key: 'preferred_language',
|
|
70
|
+
* value: 'en',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
store(body, options) {
|
|
75
|
+
return this._client.post('/memory', { body, ...options });
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=memory.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.mjs","sourceRoot":"","sources":["../src/resources/memory.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;OASG;IACH,QAAQ,CAAC,GAAW,EAAE,OAAwB;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,WAAW,GAAG,EAAE,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CAAC,OAAwB;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,GAAW,EAAE,OAAwB;QAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,WAAW,GAAG,EAAE,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,SAAS,CAAC,OAAwB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,KAAK,CAAC,IAAuB,EAAE,OAAwB;QACrD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;CACF"}
|