@vectorize-io/hindsight-client 0.1.13 → 0.1.15
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/generated/client/client.gen.d.ts +1 -1
- package/dist/generated/client/client.gen.js +43 -43
- package/dist/generated/client/index.d.ts +8 -8
- package/dist/generated/client/types.gen.d.ts +18 -18
- package/dist/generated/client/types.gen.d.ts.map +1 -1
- package/dist/generated/client/utils.gen.d.ts +3 -3
- package/dist/generated/client/utils.gen.d.ts.map +1 -1
- package/dist/generated/client/utils.gen.js +30 -30
- package/dist/generated/client/utils.gen.js.map +1 -1
- package/dist/generated/client.gen.d.ts +2 -2
- package/dist/generated/client.gen.d.ts.map +1 -1
- package/dist/generated/client.gen.js.map +1 -1
- package/dist/generated/core/auth.gen.d.ts +3 -3
- package/dist/generated/core/auth.gen.js +3 -3
- package/dist/generated/core/bodySerializer.gen.d.ts +1 -1
- package/dist/generated/core/bodySerializer.gen.js +3 -3
- package/dist/generated/core/params.gen.d.ts +3 -3
- package/dist/generated/core/params.gen.js +9 -9
- package/dist/generated/core/pathSerializer.gen.d.ts +3 -3
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -1
- package/dist/generated/core/pathSerializer.gen.js +36 -36
- package/dist/generated/core/pathSerializer.gen.js.map +1 -1
- package/dist/generated/core/queryKeySerializer.gen.js +11 -11
- package/dist/generated/core/serverSentEvents.gen.d.ts +3 -3
- package/dist/generated/core/serverSentEvents.gen.js +18 -18
- package/dist/generated/core/types.gen.d.ts +4 -4
- package/dist/generated/core/utils.gen.d.ts +1 -1
- package/dist/generated/core/utils.gen.js +16 -16
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/sdk.gen.d.ts +20 -20
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/sdk.gen.js +66 -59
- package/dist/generated/sdk.gen.js.map +1 -1
- package/dist/generated/types.gen.d.ts +349 -30
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +3 -0
- package/dist/src/index.js.map +1 -1
- package/generated/client/client.gen.ts +50 -50
- package/generated/client/index.ts +8 -8
- package/generated/client/types.gen.ts +38 -37
- package/generated/client/utils.gen.ts +47 -42
- package/generated/client.gen.ts +10 -3
- package/generated/core/auth.gen.ts +6 -6
- package/generated/core/bodySerializer.gen.ts +4 -4
- package/generated/core/params.gen.ts +12 -12
- package/generated/core/pathSerializer.gen.ts +40 -41
- package/generated/core/queryKeySerializer.gen.ts +11 -11
- package/generated/core/serverSentEvents.gen.ts +22 -22
- package/generated/core/types.gen.ts +12 -12
- package/generated/core/utils.gen.ts +18 -18
- package/generated/index.ts +2 -2
- package/generated/sdk.gen.ts +336 -85
- package/generated/types.gen.ts +1352 -990
- package/package.json +1 -1
- package/src/index.ts +5 -2
package/generated/sdk.gen.ts
CHANGED
|
@@ -1,21 +1,95 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
2
|
|
|
3
|
-
import type { Client, Options as Options2, TDataShape } from
|
|
4
|
-
import { client } from
|
|
5
|
-
import type {
|
|
3
|
+
import type { Client, Options as Options2, TDataShape } from "./client";
|
|
4
|
+
import { client } from "./client.gen";
|
|
5
|
+
import type {
|
|
6
|
+
AddBankBackgroundData,
|
|
7
|
+
AddBankBackgroundErrors,
|
|
8
|
+
AddBankBackgroundResponses,
|
|
9
|
+
CancelOperationData,
|
|
10
|
+
CancelOperationErrors,
|
|
11
|
+
CancelOperationResponses,
|
|
12
|
+
ClearBankMemoriesData,
|
|
13
|
+
ClearBankMemoriesErrors,
|
|
14
|
+
ClearBankMemoriesResponses,
|
|
15
|
+
CreateOrUpdateBankData,
|
|
16
|
+
CreateOrUpdateBankErrors,
|
|
17
|
+
CreateOrUpdateBankResponses,
|
|
18
|
+
DeleteBankData,
|
|
19
|
+
DeleteBankErrors,
|
|
20
|
+
DeleteBankResponses,
|
|
21
|
+
DeleteDocumentData,
|
|
22
|
+
DeleteDocumentErrors,
|
|
23
|
+
DeleteDocumentResponses,
|
|
24
|
+
GetAgentStatsData,
|
|
25
|
+
GetAgentStatsErrors,
|
|
26
|
+
GetAgentStatsResponses,
|
|
27
|
+
GetBankProfileData,
|
|
28
|
+
GetBankProfileErrors,
|
|
29
|
+
GetBankProfileResponses,
|
|
30
|
+
GetChunkData,
|
|
31
|
+
GetChunkErrors,
|
|
32
|
+
GetChunkResponses,
|
|
33
|
+
GetDocumentData,
|
|
34
|
+
GetDocumentErrors,
|
|
35
|
+
GetDocumentResponses,
|
|
36
|
+
GetEntityData,
|
|
37
|
+
GetEntityErrors,
|
|
38
|
+
GetEntityResponses,
|
|
39
|
+
GetGraphData,
|
|
40
|
+
GetGraphErrors,
|
|
41
|
+
GetGraphResponses,
|
|
42
|
+
HealthEndpointHealthGetData,
|
|
43
|
+
HealthEndpointHealthGetResponses,
|
|
44
|
+
ListBanksData,
|
|
45
|
+
ListBanksErrors,
|
|
46
|
+
ListBanksResponses,
|
|
47
|
+
ListDocumentsData,
|
|
48
|
+
ListDocumentsErrors,
|
|
49
|
+
ListDocumentsResponses,
|
|
50
|
+
ListEntitiesData,
|
|
51
|
+
ListEntitiesErrors,
|
|
52
|
+
ListEntitiesResponses,
|
|
53
|
+
ListMemoriesData,
|
|
54
|
+
ListMemoriesErrors,
|
|
55
|
+
ListMemoriesResponses,
|
|
56
|
+
ListOperationsData,
|
|
57
|
+
ListOperationsErrors,
|
|
58
|
+
ListOperationsResponses,
|
|
59
|
+
MetricsEndpointMetricsGetData,
|
|
60
|
+
MetricsEndpointMetricsGetResponses,
|
|
61
|
+
RecallMemoriesData,
|
|
62
|
+
RecallMemoriesErrors,
|
|
63
|
+
RecallMemoriesResponses,
|
|
64
|
+
ReflectData,
|
|
65
|
+
ReflectErrors,
|
|
66
|
+
ReflectResponses,
|
|
67
|
+
RegenerateEntityObservationsData,
|
|
68
|
+
RegenerateEntityObservationsErrors,
|
|
69
|
+
RegenerateEntityObservationsResponses,
|
|
70
|
+
RetainMemoriesData,
|
|
71
|
+
RetainMemoriesErrors,
|
|
72
|
+
RetainMemoriesResponses,
|
|
73
|
+
UpdateBankDispositionData,
|
|
74
|
+
UpdateBankDispositionErrors,
|
|
75
|
+
UpdateBankDispositionResponses,
|
|
76
|
+
} from "./types.gen";
|
|
6
77
|
|
|
7
|
-
export type Options<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
78
|
+
export type Options<
|
|
79
|
+
TData extends TDataShape = TDataShape,
|
|
80
|
+
ThrowOnError extends boolean = boolean,
|
|
81
|
+
> = Options2<TData, ThrowOnError> & {
|
|
82
|
+
/**
|
|
83
|
+
* You can provide a client instance returned by `createClient()` instead of
|
|
84
|
+
* individual options. This might be also useful if you want to implement a
|
|
85
|
+
* custom client.
|
|
86
|
+
*/
|
|
87
|
+
client?: Client;
|
|
88
|
+
/**
|
|
89
|
+
* You can pass arbitrary values through the `meta` object. This can be
|
|
90
|
+
* used to access values that aren't defined as part of the SDK function.
|
|
91
|
+
*/
|
|
92
|
+
meta?: Record<string, unknown>;
|
|
19
93
|
};
|
|
20
94
|
|
|
21
95
|
/**
|
|
@@ -23,28 +97,56 @@ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends
|
|
|
23
97
|
*
|
|
24
98
|
* Checks the health of the API and database connection
|
|
25
99
|
*/
|
|
26
|
-
export const healthEndpointHealthGet = <ThrowOnError extends boolean = false>(
|
|
100
|
+
export const healthEndpointHealthGet = <ThrowOnError extends boolean = false>(
|
|
101
|
+
options?: Options<HealthEndpointHealthGetData, ThrowOnError>,
|
|
102
|
+
) =>
|
|
103
|
+
(options?.client ?? client).get<
|
|
104
|
+
HealthEndpointHealthGetResponses,
|
|
105
|
+
unknown,
|
|
106
|
+
ThrowOnError
|
|
107
|
+
>({ url: "/health", ...options });
|
|
27
108
|
|
|
28
109
|
/**
|
|
29
110
|
* Prometheus metrics endpoint
|
|
30
111
|
*
|
|
31
112
|
* Exports metrics in Prometheus format for scraping
|
|
32
113
|
*/
|
|
33
|
-
export const metricsEndpointMetricsGet = <ThrowOnError extends boolean = false>(
|
|
114
|
+
export const metricsEndpointMetricsGet = <ThrowOnError extends boolean = false>(
|
|
115
|
+
options?: Options<MetricsEndpointMetricsGetData, ThrowOnError>,
|
|
116
|
+
) =>
|
|
117
|
+
(options?.client ?? client).get<
|
|
118
|
+
MetricsEndpointMetricsGetResponses,
|
|
119
|
+
unknown,
|
|
120
|
+
ThrowOnError
|
|
121
|
+
>({ url: "/metrics", ...options });
|
|
34
122
|
|
|
35
123
|
/**
|
|
36
124
|
* Get memory graph data
|
|
37
125
|
*
|
|
38
126
|
* Retrieve graph data for visualization, optionally filtered by type (world/experience/opinion). Limited to 1000 most recent items.
|
|
39
127
|
*/
|
|
40
|
-
export const getGraph = <ThrowOnError extends boolean = false>(
|
|
128
|
+
export const getGraph = <ThrowOnError extends boolean = false>(
|
|
129
|
+
options: Options<GetGraphData, ThrowOnError>,
|
|
130
|
+
) =>
|
|
131
|
+
(options.client ?? client).get<
|
|
132
|
+
GetGraphResponses,
|
|
133
|
+
GetGraphErrors,
|
|
134
|
+
ThrowOnError
|
|
135
|
+
>({ url: "/v1/default/banks/{bank_id}/graph", ...options });
|
|
41
136
|
|
|
42
137
|
/**
|
|
43
138
|
* List memory units
|
|
44
139
|
*
|
|
45
140
|
* List memory units with pagination and optional full-text search. Supports filtering by type. Results are sorted by most recent first (mentioned_at DESC, then created_at DESC).
|
|
46
141
|
*/
|
|
47
|
-
export const listMemories = <ThrowOnError extends boolean = false>(
|
|
142
|
+
export const listMemories = <ThrowOnError extends boolean = false>(
|
|
143
|
+
options: Options<ListMemoriesData, ThrowOnError>,
|
|
144
|
+
) =>
|
|
145
|
+
(options.client ?? client).get<
|
|
146
|
+
ListMemoriesResponses,
|
|
147
|
+
ListMemoriesErrors,
|
|
148
|
+
ThrowOnError
|
|
149
|
+
>({ url: "/v1/default/banks/{bank_id}/memories/list", ...options });
|
|
48
150
|
|
|
49
151
|
/**
|
|
50
152
|
* Recall memory
|
|
@@ -52,20 +154,27 @@ export const listMemories = <ThrowOnError extends boolean = false>(options: Opti
|
|
|
52
154
|
* Recall memory using semantic similarity and spreading activation.
|
|
53
155
|
*
|
|
54
156
|
* The type parameter is optional and must be one of:
|
|
55
|
-
* -
|
|
56
|
-
* -
|
|
57
|
-
* -
|
|
157
|
+
* - `world`: General knowledge about people, places, events, and things that happen
|
|
158
|
+
* - `experience`: Memories about experience, conversations, actions taken, and tasks performed
|
|
159
|
+
* - `opinion`: The bank's formed beliefs, perspectives, and viewpoints
|
|
58
160
|
*
|
|
59
|
-
* Set include_entities=true to get entity observations alongside recall results.
|
|
161
|
+
* Set `include_entities=true` to get entity observations alongside recall results.
|
|
60
162
|
*/
|
|
61
|
-
export const recallMemories = <ThrowOnError extends boolean = false>(
|
|
62
|
-
|
|
163
|
+
export const recallMemories = <ThrowOnError extends boolean = false>(
|
|
164
|
+
options: Options<RecallMemoriesData, ThrowOnError>,
|
|
165
|
+
) =>
|
|
166
|
+
(options.client ?? client).post<
|
|
167
|
+
RecallMemoriesResponses,
|
|
168
|
+
RecallMemoriesErrors,
|
|
169
|
+
ThrowOnError
|
|
170
|
+
>({
|
|
171
|
+
url: "/v1/default/banks/{bank_id}/memories/recall",
|
|
63
172
|
...options,
|
|
64
173
|
headers: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
});
|
|
174
|
+
"Content-Type": "application/json",
|
|
175
|
+
...options.headers,
|
|
176
|
+
},
|
|
177
|
+
});
|
|
69
178
|
|
|
70
179
|
/**
|
|
71
180
|
* Reflect and generate answer
|
|
@@ -80,56 +189,110 @@ export const recallMemories = <ThrowOnError extends boolean = false>(options: Op
|
|
|
80
189
|
* 5. Extracts and stores any new opinions formed
|
|
81
190
|
* 6. Returns plain text answer, the facts used, and new opinions
|
|
82
191
|
*/
|
|
83
|
-
export const reflect = <ThrowOnError extends boolean = false>(
|
|
84
|
-
|
|
192
|
+
export const reflect = <ThrowOnError extends boolean = false>(
|
|
193
|
+
options: Options<ReflectData, ThrowOnError>,
|
|
194
|
+
) =>
|
|
195
|
+
(options.client ?? client).post<
|
|
196
|
+
ReflectResponses,
|
|
197
|
+
ReflectErrors,
|
|
198
|
+
ThrowOnError
|
|
199
|
+
>({
|
|
200
|
+
url: "/v1/default/banks/{bank_id}/reflect",
|
|
85
201
|
...options,
|
|
86
202
|
headers: {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
});
|
|
203
|
+
"Content-Type": "application/json",
|
|
204
|
+
...options.headers,
|
|
205
|
+
},
|
|
206
|
+
});
|
|
91
207
|
|
|
92
208
|
/**
|
|
93
209
|
* List all memory banks
|
|
94
210
|
*
|
|
95
211
|
* Get a list of all agents with their profiles
|
|
96
212
|
*/
|
|
97
|
-
export const listBanks = <ThrowOnError extends boolean = false>(
|
|
213
|
+
export const listBanks = <ThrowOnError extends boolean = false>(
|
|
214
|
+
options?: Options<ListBanksData, ThrowOnError>,
|
|
215
|
+
) =>
|
|
216
|
+
(options?.client ?? client).get<
|
|
217
|
+
ListBanksResponses,
|
|
218
|
+
ListBanksErrors,
|
|
219
|
+
ThrowOnError
|
|
220
|
+
>({ url: "/v1/default/banks", ...options });
|
|
98
221
|
|
|
99
222
|
/**
|
|
100
223
|
* Get statistics for memory bank
|
|
101
224
|
*
|
|
102
225
|
* Get statistics about nodes and links for a specific agent
|
|
103
226
|
*/
|
|
104
|
-
export const getAgentStats = <ThrowOnError extends boolean = false>(
|
|
227
|
+
export const getAgentStats = <ThrowOnError extends boolean = false>(
|
|
228
|
+
options: Options<GetAgentStatsData, ThrowOnError>,
|
|
229
|
+
) =>
|
|
230
|
+
(options.client ?? client).get<
|
|
231
|
+
GetAgentStatsResponses,
|
|
232
|
+
GetAgentStatsErrors,
|
|
233
|
+
ThrowOnError
|
|
234
|
+
>({ url: "/v1/default/banks/{bank_id}/stats", ...options });
|
|
105
235
|
|
|
106
236
|
/**
|
|
107
237
|
* List entities
|
|
108
238
|
*
|
|
109
239
|
* List all entities (people, organizations, etc.) known by the bank, ordered by mention count.
|
|
110
240
|
*/
|
|
111
|
-
export const listEntities = <ThrowOnError extends boolean = false>(
|
|
241
|
+
export const listEntities = <ThrowOnError extends boolean = false>(
|
|
242
|
+
options: Options<ListEntitiesData, ThrowOnError>,
|
|
243
|
+
) =>
|
|
244
|
+
(options.client ?? client).get<
|
|
245
|
+
ListEntitiesResponses,
|
|
246
|
+
ListEntitiesErrors,
|
|
247
|
+
ThrowOnError
|
|
248
|
+
>({ url: "/v1/default/banks/{bank_id}/entities", ...options });
|
|
112
249
|
|
|
113
250
|
/**
|
|
114
251
|
* Get entity details
|
|
115
252
|
*
|
|
116
253
|
* Get detailed information about an entity including observations (mental model).
|
|
117
254
|
*/
|
|
118
|
-
export const getEntity = <ThrowOnError extends boolean = false>(
|
|
255
|
+
export const getEntity = <ThrowOnError extends boolean = false>(
|
|
256
|
+
options: Options<GetEntityData, ThrowOnError>,
|
|
257
|
+
) =>
|
|
258
|
+
(options.client ?? client).get<
|
|
259
|
+
GetEntityResponses,
|
|
260
|
+
GetEntityErrors,
|
|
261
|
+
ThrowOnError
|
|
262
|
+
>({ url: "/v1/default/banks/{bank_id}/entities/{entity_id}", ...options });
|
|
119
263
|
|
|
120
264
|
/**
|
|
121
265
|
* Regenerate entity observations
|
|
122
266
|
*
|
|
123
267
|
* Regenerate observations for an entity based on all facts mentioning it.
|
|
124
268
|
*/
|
|
125
|
-
export const regenerateEntityObservations = <
|
|
269
|
+
export const regenerateEntityObservations = <
|
|
270
|
+
ThrowOnError extends boolean = false,
|
|
271
|
+
>(
|
|
272
|
+
options: Options<RegenerateEntityObservationsData, ThrowOnError>,
|
|
273
|
+
) =>
|
|
274
|
+
(options.client ?? client).post<
|
|
275
|
+
RegenerateEntityObservationsResponses,
|
|
276
|
+
RegenerateEntityObservationsErrors,
|
|
277
|
+
ThrowOnError
|
|
278
|
+
>({
|
|
279
|
+
url: "/v1/default/banks/{bank_id}/entities/{entity_id}/regenerate",
|
|
280
|
+
...options,
|
|
281
|
+
});
|
|
126
282
|
|
|
127
283
|
/**
|
|
128
284
|
* List documents
|
|
129
285
|
*
|
|
130
286
|
* List documents with pagination and optional search. Documents are the source content from which memory units are extracted.
|
|
131
287
|
*/
|
|
132
|
-
export const listDocuments = <ThrowOnError extends boolean = false>(
|
|
288
|
+
export const listDocuments = <ThrowOnError extends boolean = false>(
|
|
289
|
+
options: Options<ListDocumentsData, ThrowOnError>,
|
|
290
|
+
) =>
|
|
291
|
+
(options.client ?? client).get<
|
|
292
|
+
ListDocumentsResponses,
|
|
293
|
+
ListDocumentsErrors,
|
|
294
|
+
ThrowOnError
|
|
295
|
+
>({ url: "/v1/default/banks/{bank_id}/documents", ...options });
|
|
133
296
|
|
|
134
297
|
/**
|
|
135
298
|
* Delete a document
|
|
@@ -143,131 +306,219 @@ export const listDocuments = <ThrowOnError extends boolean = false>(options: Opt
|
|
|
143
306
|
*
|
|
144
307
|
* This operation cannot be undone.
|
|
145
308
|
*/
|
|
146
|
-
export const deleteDocument = <ThrowOnError extends boolean = false>(
|
|
309
|
+
export const deleteDocument = <ThrowOnError extends boolean = false>(
|
|
310
|
+
options: Options<DeleteDocumentData, ThrowOnError>,
|
|
311
|
+
) =>
|
|
312
|
+
(options.client ?? client).delete<
|
|
313
|
+
DeleteDocumentResponses,
|
|
314
|
+
DeleteDocumentErrors,
|
|
315
|
+
ThrowOnError
|
|
316
|
+
>({ url: "/v1/default/banks/{bank_id}/documents/{document_id}", ...options });
|
|
147
317
|
|
|
148
318
|
/**
|
|
149
319
|
* Get document details
|
|
150
320
|
*
|
|
151
321
|
* Get a specific document including its original text
|
|
152
322
|
*/
|
|
153
|
-
export const getDocument = <ThrowOnError extends boolean = false>(
|
|
323
|
+
export const getDocument = <ThrowOnError extends boolean = false>(
|
|
324
|
+
options: Options<GetDocumentData, ThrowOnError>,
|
|
325
|
+
) =>
|
|
326
|
+
(options.client ?? client).get<
|
|
327
|
+
GetDocumentResponses,
|
|
328
|
+
GetDocumentErrors,
|
|
329
|
+
ThrowOnError
|
|
330
|
+
>({ url: "/v1/default/banks/{bank_id}/documents/{document_id}", ...options });
|
|
154
331
|
|
|
155
332
|
/**
|
|
156
333
|
* Get chunk details
|
|
157
334
|
*
|
|
158
335
|
* Get a specific chunk by its ID
|
|
159
336
|
*/
|
|
160
|
-
export const getChunk = <ThrowOnError extends boolean = false>(
|
|
337
|
+
export const getChunk = <ThrowOnError extends boolean = false>(
|
|
338
|
+
options: Options<GetChunkData, ThrowOnError>,
|
|
339
|
+
) =>
|
|
340
|
+
(options.client ?? client).get<
|
|
341
|
+
GetChunkResponses,
|
|
342
|
+
GetChunkErrors,
|
|
343
|
+
ThrowOnError
|
|
344
|
+
>({ url: "/v1/default/chunks/{chunk_id}", ...options });
|
|
161
345
|
|
|
162
346
|
/**
|
|
163
347
|
* List async operations
|
|
164
348
|
*
|
|
165
349
|
* Get a list of all async operations (pending and failed) for a specific agent, including error messages for failed operations
|
|
166
350
|
*/
|
|
167
|
-
export const listOperations = <ThrowOnError extends boolean = false>(
|
|
351
|
+
export const listOperations = <ThrowOnError extends boolean = false>(
|
|
352
|
+
options: Options<ListOperationsData, ThrowOnError>,
|
|
353
|
+
) =>
|
|
354
|
+
(options.client ?? client).get<
|
|
355
|
+
ListOperationsResponses,
|
|
356
|
+
ListOperationsErrors,
|
|
357
|
+
ThrowOnError
|
|
358
|
+
>({ url: "/v1/default/banks/{bank_id}/operations", ...options });
|
|
168
359
|
|
|
169
360
|
/**
|
|
170
361
|
* Cancel a pending async operation
|
|
171
362
|
*
|
|
172
363
|
* Cancel a pending async operation by removing it from the queue
|
|
173
364
|
*/
|
|
174
|
-
export const cancelOperation = <ThrowOnError extends boolean = false>(
|
|
365
|
+
export const cancelOperation = <ThrowOnError extends boolean = false>(
|
|
366
|
+
options: Options<CancelOperationData, ThrowOnError>,
|
|
367
|
+
) =>
|
|
368
|
+
(options.client ?? client).delete<
|
|
369
|
+
CancelOperationResponses,
|
|
370
|
+
CancelOperationErrors,
|
|
371
|
+
ThrowOnError
|
|
372
|
+
>({
|
|
373
|
+
url: "/v1/default/banks/{bank_id}/operations/{operation_id}",
|
|
374
|
+
...options,
|
|
375
|
+
});
|
|
175
376
|
|
|
176
377
|
/**
|
|
177
378
|
* Get memory bank profile
|
|
178
379
|
*
|
|
179
380
|
* Get disposition traits and background for a memory bank. Auto-creates agent with defaults if not exists.
|
|
180
381
|
*/
|
|
181
|
-
export const getBankProfile = <ThrowOnError extends boolean = false>(
|
|
382
|
+
export const getBankProfile = <ThrowOnError extends boolean = false>(
|
|
383
|
+
options: Options<GetBankProfileData, ThrowOnError>,
|
|
384
|
+
) =>
|
|
385
|
+
(options.client ?? client).get<
|
|
386
|
+
GetBankProfileResponses,
|
|
387
|
+
GetBankProfileErrors,
|
|
388
|
+
ThrowOnError
|
|
389
|
+
>({ url: "/v1/default/banks/{bank_id}/profile", ...options });
|
|
182
390
|
|
|
183
391
|
/**
|
|
184
392
|
* Update memory bank disposition
|
|
185
393
|
*
|
|
186
394
|
* Update bank's disposition traits (skepticism, literalism, empathy)
|
|
187
395
|
*/
|
|
188
|
-
export const updateBankDisposition = <ThrowOnError extends boolean = false>(
|
|
189
|
-
|
|
396
|
+
export const updateBankDisposition = <ThrowOnError extends boolean = false>(
|
|
397
|
+
options: Options<UpdateBankDispositionData, ThrowOnError>,
|
|
398
|
+
) =>
|
|
399
|
+
(options.client ?? client).put<
|
|
400
|
+
UpdateBankDispositionResponses,
|
|
401
|
+
UpdateBankDispositionErrors,
|
|
402
|
+
ThrowOnError
|
|
403
|
+
>({
|
|
404
|
+
url: "/v1/default/banks/{bank_id}/profile",
|
|
190
405
|
...options,
|
|
191
406
|
headers: {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
});
|
|
407
|
+
"Content-Type": "application/json",
|
|
408
|
+
...options.headers,
|
|
409
|
+
},
|
|
410
|
+
});
|
|
196
411
|
|
|
197
412
|
/**
|
|
198
413
|
* Add/merge memory bank background
|
|
199
414
|
*
|
|
200
415
|
* Add new background information or merge with existing. LLM intelligently resolves conflicts, normalizes to first person, and optionally infers disposition traits.
|
|
201
416
|
*/
|
|
202
|
-
export const addBankBackground = <ThrowOnError extends boolean = false>(
|
|
203
|
-
|
|
417
|
+
export const addBankBackground = <ThrowOnError extends boolean = false>(
|
|
418
|
+
options: Options<AddBankBackgroundData, ThrowOnError>,
|
|
419
|
+
) =>
|
|
420
|
+
(options.client ?? client).post<
|
|
421
|
+
AddBankBackgroundResponses,
|
|
422
|
+
AddBankBackgroundErrors,
|
|
423
|
+
ThrowOnError
|
|
424
|
+
>({
|
|
425
|
+
url: "/v1/default/banks/{bank_id}/background",
|
|
204
426
|
...options,
|
|
205
427
|
headers: {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
}
|
|
209
|
-
});
|
|
428
|
+
"Content-Type": "application/json",
|
|
429
|
+
...options.headers,
|
|
430
|
+
},
|
|
431
|
+
});
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Delete memory bank
|
|
435
|
+
*
|
|
436
|
+
* Delete an entire memory bank including all memories, entities, documents, and the bank profile itself. This is a destructive operation that cannot be undone.
|
|
437
|
+
*/
|
|
438
|
+
export const deleteBank = <ThrowOnError extends boolean = false>(
|
|
439
|
+
options: Options<DeleteBankData, ThrowOnError>,
|
|
440
|
+
) =>
|
|
441
|
+
(options.client ?? client).delete<
|
|
442
|
+
DeleteBankResponses,
|
|
443
|
+
DeleteBankErrors,
|
|
444
|
+
ThrowOnError
|
|
445
|
+
>({ url: "/v1/default/banks/{bank_id}", ...options });
|
|
210
446
|
|
|
211
447
|
/**
|
|
212
448
|
* Create or update memory bank
|
|
213
449
|
*
|
|
214
450
|
* Create a new agent or update existing agent with disposition and background. Auto-fills missing fields with defaults.
|
|
215
451
|
*/
|
|
216
|
-
export const createOrUpdateBank = <ThrowOnError extends boolean = false>(
|
|
217
|
-
|
|
452
|
+
export const createOrUpdateBank = <ThrowOnError extends boolean = false>(
|
|
453
|
+
options: Options<CreateOrUpdateBankData, ThrowOnError>,
|
|
454
|
+
) =>
|
|
455
|
+
(options.client ?? client).put<
|
|
456
|
+
CreateOrUpdateBankResponses,
|
|
457
|
+
CreateOrUpdateBankErrors,
|
|
458
|
+
ThrowOnError
|
|
459
|
+
>({
|
|
460
|
+
url: "/v1/default/banks/{bank_id}",
|
|
218
461
|
...options,
|
|
219
462
|
headers: {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
}
|
|
223
|
-
});
|
|
463
|
+
"Content-Type": "application/json",
|
|
464
|
+
...options.headers,
|
|
465
|
+
},
|
|
466
|
+
});
|
|
224
467
|
|
|
225
468
|
/**
|
|
226
469
|
* Clear memory bank memories
|
|
227
470
|
*
|
|
228
471
|
* Delete memory units for a memory bank. Optionally filter by type (world, experience, opinion) to delete only specific types. This is a destructive operation that cannot be undone. The bank profile (disposition and background) will be preserved.
|
|
229
472
|
*/
|
|
230
|
-
export const clearBankMemories = <ThrowOnError extends boolean = false>(
|
|
473
|
+
export const clearBankMemories = <ThrowOnError extends boolean = false>(
|
|
474
|
+
options: Options<ClearBankMemoriesData, ThrowOnError>,
|
|
475
|
+
) =>
|
|
476
|
+
(options.client ?? client).delete<
|
|
477
|
+
ClearBankMemoriesResponses,
|
|
478
|
+
ClearBankMemoriesErrors,
|
|
479
|
+
ThrowOnError
|
|
480
|
+
>({ url: "/v1/default/banks/{bank_id}/memories", ...options });
|
|
231
481
|
|
|
232
482
|
/**
|
|
233
483
|
* Retain memories
|
|
234
484
|
*
|
|
235
485
|
* Retain memory items with automatic fact extraction.
|
|
236
486
|
*
|
|
237
|
-
* This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing
|
|
238
|
-
* via the async parameter.
|
|
487
|
+
* This is the main endpoint for storing memories. It supports both synchronous and asynchronous processing via the `async` parameter.
|
|
239
488
|
*
|
|
240
|
-
* Features
|
|
489
|
+
* **Features:**
|
|
241
490
|
* - Efficient batch processing
|
|
242
491
|
* - Automatic fact extraction from natural language
|
|
243
492
|
* - Entity recognition and linking
|
|
244
|
-
* - Document tracking with automatic upsert (when document_id is provided
|
|
493
|
+
* - Document tracking with automatic upsert (when document_id is provided)
|
|
245
494
|
* - Temporal and semantic linking
|
|
246
495
|
* - Optional asynchronous processing
|
|
247
496
|
*
|
|
248
|
-
* The system automatically
|
|
497
|
+
* **The system automatically:**
|
|
249
498
|
* 1. Extracts semantic facts from the content
|
|
250
499
|
* 2. Generates embeddings
|
|
251
500
|
* 3. Deduplicates similar facts
|
|
252
501
|
* 4. Creates temporal, semantic, and entity links
|
|
253
502
|
* 5. Tracks document metadata
|
|
254
503
|
*
|
|
255
|
-
* When async=true
|
|
256
|
-
* - Returns immediately after queuing the task
|
|
257
|
-
* - Processing happens in the background
|
|
258
|
-
* - Use the operations endpoint to monitor progress
|
|
504
|
+
* **When `async=true`:** Returns immediately after queuing. Use the operations endpoint to monitor progress.
|
|
259
505
|
*
|
|
260
|
-
* When async=false (default)
|
|
261
|
-
* - Waits for processing to complete
|
|
262
|
-
* - Returns after all memories are stored
|
|
506
|
+
* **When `async=false` (default):** Waits for processing to complete.
|
|
263
507
|
*
|
|
264
|
-
* Note
|
|
508
|
+
* **Note:** If a memory item has a `document_id` that already exists, the old document and its memory units will be deleted before creating new ones (upsert behavior).
|
|
265
509
|
*/
|
|
266
|
-
export const retainMemories = <ThrowOnError extends boolean = false>(
|
|
267
|
-
|
|
510
|
+
export const retainMemories = <ThrowOnError extends boolean = false>(
|
|
511
|
+
options: Options<RetainMemoriesData, ThrowOnError>,
|
|
512
|
+
) =>
|
|
513
|
+
(options.client ?? client).post<
|
|
514
|
+
RetainMemoriesResponses,
|
|
515
|
+
RetainMemoriesErrors,
|
|
516
|
+
ThrowOnError
|
|
517
|
+
>({
|
|
518
|
+
url: "/v1/default/banks/{bank_id}/memories",
|
|
268
519
|
...options,
|
|
269
520
|
headers: {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
273
|
-
});
|
|
521
|
+
"Content-Type": "application/json",
|
|
522
|
+
...options.headers,
|
|
523
|
+
},
|
|
524
|
+
});
|