10xgraph-client 0.6.0 → 1.0.0-rc.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/CHANGELOG.md +207 -0
- package/README.md +11 -5
- package/dist/agent.d.ts +17 -5
- package/dist/agent.d.ts.map +1 -1
- package/dist/cjs/agent.d.ts +33 -0
- package/dist/cjs/client.d.ts +533 -0
- package/dist/cjs/compat.d.ts +27 -0
- package/dist/cjs/endpoints/addThreadMessages.d.ts +25 -0
- package/dist/cjs/endpoints/clearThreadState.d.ts +14 -0
- package/dist/cjs/endpoints/deleteFile.d.ts +13 -0
- package/dist/cjs/endpoints/deleteMemory.d.ts +18 -0
- package/dist/cjs/endpoints/deleteThread.d.ts +18 -0
- package/dist/cjs/endpoints/deleteThreadMessage.d.ts +19 -0
- package/dist/cjs/endpoints/files.d.ts +115 -0
- package/dist/cjs/endpoints/fixGraph.d.ts +33 -0
- package/dist/cjs/endpoints/forgetMemories.d.ts +21 -0
- package/dist/cjs/endpoints/getMemory.d.ts +18 -0
- package/dist/cjs/endpoints/graph.d.ts +50 -0
- package/dist/cjs/endpoints/graphTools.d.ts +31 -0
- package/dist/cjs/endpoints/invoke.d.ts +66 -0
- package/dist/cjs/endpoints/listMemories.d.ts +24 -0
- package/dist/cjs/endpoints/metadata.d.ts +5 -0
- package/dist/cjs/endpoints/observability.d.ts +111 -0
- package/dist/cjs/endpoints/ping.d.ts +9 -0
- package/dist/cjs/endpoints/realtime.d.ts +154 -0
- package/dist/cjs/endpoints/searchMemory.d.ts +56 -0
- package/dist/cjs/endpoints/stateSchema.d.ts +49 -0
- package/dist/cjs/endpoints/stopGraph.d.ts +35 -0
- package/dist/cjs/endpoints/storeMemory.d.ts +32 -0
- package/dist/cjs/endpoints/stream.d.ts +67 -0
- package/dist/cjs/endpoints/threadDetails.d.ts +18 -0
- package/dist/cjs/endpoints/threadMessage.d.ts +16 -0
- package/dist/cjs/endpoints/threadMessages.d.ts +28 -0
- package/dist/cjs/endpoints/threadState.d.ts +13 -0
- package/dist/cjs/endpoints/threads.d.ts +35 -0
- package/dist/cjs/endpoints/updateMemory.d.ts +20 -0
- package/dist/cjs/endpoints/updateThreadMessageFeedback.d.ts +19 -0
- package/dist/cjs/endpoints/updateThreadState.d.ts +22 -0
- package/dist/cjs/endpoints/wsStream.d.ts +34 -0
- package/dist/cjs/errors.d.ts +212 -0
- package/dist/cjs/index.d.ts +41 -0
- package/dist/cjs/interrupt.d.ts +45 -0
- package/dist/cjs/message.d.ts +173 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/request.d.ts +60 -0
- package/dist/cjs/tools.d.ts +80 -0
- package/dist/cjs/ws.d.ts +47 -0
- package/dist/client.d.ts +95 -40
- package/dist/client.d.ts.map +1 -1
- package/dist/endpoints/addThreadMessages.d.ts +4 -0
- package/dist/endpoints/addThreadMessages.d.ts.map +1 -1
- package/dist/endpoints/clearThreadState.d.ts.map +1 -1
- package/dist/endpoints/deleteFile.d.ts +14 -0
- package/dist/endpoints/deleteFile.d.ts.map +1 -0
- package/dist/endpoints/deleteMemory.d.ts.map +1 -1
- package/dist/endpoints/deleteThread.d.ts.map +1 -1
- package/dist/endpoints/deleteThreadMessage.d.ts.map +1 -1
- package/dist/endpoints/files.d.ts +33 -0
- package/dist/endpoints/files.d.ts.map +1 -1
- package/dist/endpoints/fixGraph.d.ts +8 -3
- package/dist/endpoints/fixGraph.d.ts.map +1 -1
- package/dist/endpoints/forgetMemories.d.ts.map +1 -1
- package/dist/endpoints/getMemory.d.ts.map +1 -1
- package/dist/endpoints/graph.d.ts +20 -8
- package/dist/endpoints/graph.d.ts.map +1 -1
- package/dist/endpoints/graphTools.d.ts.map +1 -1
- package/dist/endpoints/invoke.d.ts +8 -0
- package/dist/endpoints/invoke.d.ts.map +1 -1
- package/dist/endpoints/listMemories.d.ts +6 -0
- package/dist/endpoints/listMemories.d.ts.map +1 -1
- package/dist/endpoints/observability.d.ts +54 -0
- package/dist/endpoints/observability.d.ts.map +1 -1
- package/dist/endpoints/ping.d.ts.map +1 -1
- package/dist/endpoints/realtime.d.ts +25 -4
- package/dist/endpoints/realtime.d.ts.map +1 -1
- package/dist/endpoints/searchMemory.d.ts.map +1 -1
- package/dist/endpoints/stateSchema.d.ts.map +1 -1
- package/dist/endpoints/stopGraph.d.ts +13 -3
- package/dist/endpoints/stopGraph.d.ts.map +1 -1
- package/dist/endpoints/storeMemory.d.ts.map +1 -1
- package/dist/endpoints/stream.d.ts +8 -0
- package/dist/endpoints/stream.d.ts.map +1 -1
- package/dist/endpoints/threadDetails.d.ts.map +1 -1
- package/dist/endpoints/threadMessage.d.ts.map +1 -1
- package/dist/endpoints/threadMessages.d.ts +6 -0
- package/dist/endpoints/threadMessages.d.ts.map +1 -1
- package/dist/endpoints/threadState.d.ts.map +1 -1
- package/dist/endpoints/threads.d.ts +6 -0
- package/dist/endpoints/threads.d.ts.map +1 -1
- package/dist/endpoints/updateMemory.d.ts.map +1 -1
- package/dist/endpoints/updateThreadMessageFeedback.d.ts +20 -0
- package/dist/endpoints/updateThreadMessageFeedback.d.ts.map +1 -0
- package/dist/endpoints/updateThreadState.d.ts +6 -1
- package/dist/endpoints/updateThreadState.d.ts.map +1 -1
- package/dist/endpoints/wsStream.d.ts +2 -0
- package/dist/endpoints/wsStream.d.ts.map +1 -1
- package/dist/errors.d.ts +60 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1742 -1217
- package/dist/index.js.map +1 -1
- package/dist/interrupt.d.ts +46 -0
- package/dist/interrupt.d.ts.map +1 -0
- package/dist/request.d.ts +28 -0
- package/dist/request.d.ts.map +1 -1
- package/dist/tools.d.ts +14 -0
- package/dist/tools.d.ts.map +1 -1
- package/package.json +11 -6
- package/src/agent.ts +17 -4
- package/src/client.ts +248 -128
- package/src/endpoints/addThreadMessages.ts +15 -10
- package/src/endpoints/clearThreadState.ts +19 -20
- package/src/endpoints/deleteFile.ts +65 -0
- package/src/endpoints/deleteMemory.ts +9 -13
- package/src/endpoints/deleteThread.ts +9 -13
- package/src/endpoints/deleteThreadMessage.ts +9 -13
- package/src/endpoints/files.ts +164 -131
- package/src/endpoints/fixGraph.ts +15 -16
- package/src/endpoints/forgetMemories.ts +44 -60
- package/src/endpoints/getMemory.ts +9 -9
- package/src/endpoints/graph.ts +28 -21
- package/src/endpoints/graphTools.ts +7 -13
- package/src/endpoints/invoke.ts +105 -84
- package/src/endpoints/listMemories.ts +18 -13
- package/src/endpoints/observability.ts +77 -34
- package/src/endpoints/ping.ts +7 -13
- package/src/endpoints/realtime.ts +101 -39
- package/src/endpoints/searchMemory.ts +19 -13
- package/src/endpoints/stateSchema.ts +7 -13
- package/src/endpoints/stopGraph.ts +20 -16
- package/src/endpoints/storeMemory.ts +7 -8
- package/src/endpoints/stream.ts +179 -61
- package/src/endpoints/threadDetails.ts +9 -14
- package/src/endpoints/threadMessage.ts +9 -9
- package/src/endpoints/threadMessages.ts +15 -9
- package/src/endpoints/threadState.ts +19 -20
- package/src/endpoints/threads.ts +13 -12
- package/src/endpoints/updateMemory.ts +9 -9
- package/src/endpoints/updateThreadMessageFeedback.ts +80 -0
- package/src/endpoints/updateThreadState.ts +28 -22
- package/src/endpoints/wsStream.ts +167 -42
- package/src/errors.ts +332 -93
- package/src/index.ts +9 -0
- package/src/interrupt.ts +60 -0
- package/src/request.ts +134 -0
- package/src/tools.ts +95 -0
package/src/client.ts
CHANGED
|
@@ -50,6 +50,12 @@ import {
|
|
|
50
50
|
DeleteThreadMessageRequest,
|
|
51
51
|
DeleteThreadMessageResponse,
|
|
52
52
|
} from './endpoints/deleteThreadMessage.js';
|
|
53
|
+
import {
|
|
54
|
+
updateThreadMessageFeedback,
|
|
55
|
+
UpdateThreadMessageFeedbackContext,
|
|
56
|
+
UpdateThreadMessageFeedbackRequest,
|
|
57
|
+
UpdateThreadMessageFeedbackResponse,
|
|
58
|
+
} from './endpoints/updateThreadMessageFeedback.js';
|
|
53
59
|
import {
|
|
54
60
|
deleteThread,
|
|
55
61
|
DeleteThreadContext,
|
|
@@ -136,6 +142,9 @@ import {
|
|
|
136
142
|
uploadFile as uploadFileEndpoint,
|
|
137
143
|
getFile as getFileEndpoint,
|
|
138
144
|
getFileInfo as getFileInfoEndpoint,
|
|
145
|
+
listFiles as listFilesEndpoint,
|
|
146
|
+
ListFilesRequest,
|
|
147
|
+
ListFilesResponse,
|
|
139
148
|
getFileAccessUrl as getFileAccessUrlEndpoint,
|
|
140
149
|
getMultimodalConfig as getMultimodalConfigEndpoint,
|
|
141
150
|
FileUploadContext,
|
|
@@ -144,11 +153,21 @@ import {
|
|
|
144
153
|
FileInfoResponse,
|
|
145
154
|
MultimodalConfigResponse,
|
|
146
155
|
} from './endpoints/files.js';
|
|
147
|
-
import {
|
|
156
|
+
import {
|
|
157
|
+
deleteFile as deleteFileEndpoint,
|
|
158
|
+
DeleteFileContext,
|
|
159
|
+
DeleteFileResponse,
|
|
160
|
+
} from './endpoints/deleteFile.js';
|
|
161
|
+
import { serializeMessage } from './endpoints/stream.js';
|
|
162
|
+
import { TenxGraphAuth, RequestContext, RequestOptions, normalizeBaseUrl } from './request.js';
|
|
148
163
|
|
|
149
164
|
export interface TenxGraphConfig {
|
|
150
165
|
baseUrl: string;
|
|
151
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Bearer token, or a function returning one. A function is called before every request,
|
|
168
|
+
* so a short-lived JWT can be refreshed without rebuilding the client.
|
|
169
|
+
*/
|
|
170
|
+
authToken?: string | null | (() => string | null | undefined);
|
|
152
171
|
auth?: TenxGraphAuth | null;
|
|
153
172
|
headers?: HeadersInit;
|
|
154
173
|
credentials?: RequestCredentials;
|
|
@@ -212,7 +231,7 @@ function normalizeThreadMessagesRequest(
|
|
|
212
231
|
|
|
213
232
|
export class TenxGraphClient {
|
|
214
233
|
private baseUrl: string;
|
|
215
|
-
private authToken?: string | null;
|
|
234
|
+
private authToken?: string | null | (() => string | null | undefined);
|
|
216
235
|
private auth?: TenxGraphAuth | null;
|
|
217
236
|
private headers?: HeadersInit;
|
|
218
237
|
private credentials?: RequestCredentials;
|
|
@@ -222,7 +241,7 @@ export class TenxGraphClient {
|
|
|
222
241
|
private toolExecutor: ToolExecutor;
|
|
223
242
|
|
|
224
243
|
constructor(config: TenxGraphConfig) {
|
|
225
|
-
this.baseUrl = config.baseUrl;
|
|
244
|
+
this.baseUrl = normalizeBaseUrl(config.baseUrl);
|
|
226
245
|
this.authToken = config.authToken;
|
|
227
246
|
this.auth = config.auth;
|
|
228
247
|
this.headers = config.headers;
|
|
@@ -233,10 +252,26 @@ export class TenxGraphClient {
|
|
|
233
252
|
this.toolExecutor = new ToolExecutor([]);
|
|
234
253
|
}
|
|
235
254
|
|
|
236
|
-
|
|
255
|
+
/**
|
|
256
|
+
* Replace the bearer token used for later requests (for example after a refresh).
|
|
257
|
+
* Does not touch an open stream or socket.
|
|
258
|
+
*/
|
|
259
|
+
setAuthToken(token: string | null | (() => string | null | undefined)): void {
|
|
260
|
+
this.authToken = token;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/** Drop the bearer token and any `auth` credentials. Later requests are sent without them. */
|
|
264
|
+
clearAuth(): void {
|
|
265
|
+
this.authToken = null;
|
|
266
|
+
this.auth = null;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
private createContext<T extends RequestContext>(options?: RequestOptions): T {
|
|
270
|
+
const token = typeof this.authToken === 'function' ? this.authToken() : this.authToken;
|
|
237
271
|
return {
|
|
238
272
|
baseUrl: this.baseUrl,
|
|
239
|
-
authToken:
|
|
273
|
+
authToken: token,
|
|
274
|
+
signal: options?.signal,
|
|
240
275
|
auth: this.auth,
|
|
241
276
|
headers: this.headers,
|
|
242
277
|
credentials: this.credentials,
|
|
@@ -268,8 +303,8 @@ export class TenxGraphClient {
|
|
|
268
303
|
/**
|
|
269
304
|
* Ping the server to check connectivity
|
|
270
305
|
*/
|
|
271
|
-
async ping(): Promise<PingResponse> {
|
|
272
|
-
const context = this.createContext<PingContext>();
|
|
306
|
+
async ping(options?: RequestOptions): Promise<PingResponse> {
|
|
307
|
+
const context = this.createContext<PingContext>(options);
|
|
273
308
|
|
|
274
309
|
return ping(context);
|
|
275
310
|
}
|
|
@@ -277,8 +312,8 @@ export class TenxGraphClient {
|
|
|
277
312
|
/**
|
|
278
313
|
* Fetch the agent graph
|
|
279
314
|
*/
|
|
280
|
-
async graph(): Promise<GraphResponse> {
|
|
281
|
-
const context = this.createContext<GraphContext>();
|
|
315
|
+
async graph(options?: RequestOptions): Promise<GraphResponse> {
|
|
316
|
+
const context = this.createContext<GraphContext>(options);
|
|
282
317
|
|
|
283
318
|
return graph(context);
|
|
284
319
|
}
|
|
@@ -287,8 +322,8 @@ export class TenxGraphClient {
|
|
|
287
322
|
* Fetch the tools exposed by the graph's tool nodes, grouped by node.
|
|
288
323
|
* Each tool is tagged with its source (local / mcp / remote).
|
|
289
324
|
*/
|
|
290
|
-
async graphTools(): Promise<GraphToolsResponse> {
|
|
291
|
-
const context = this.createContext<GraphToolsContext>();
|
|
325
|
+
async graphTools(options?: RequestOptions): Promise<GraphToolsResponse> {
|
|
326
|
+
const context = this.createContext<GraphToolsContext>(options);
|
|
292
327
|
|
|
293
328
|
return graphTools(context);
|
|
294
329
|
}
|
|
@@ -297,8 +332,12 @@ export class TenxGraphClient {
|
|
|
297
332
|
* Fetch the reconstructed observability trace (spans, events, cost) for a
|
|
298
333
|
* thread. Returns the latest run by default, or a specific run when given.
|
|
299
334
|
*/
|
|
300
|
-
async observability(
|
|
301
|
-
|
|
335
|
+
async observability(
|
|
336
|
+
threadId: string,
|
|
337
|
+
runId?: string,
|
|
338
|
+
options?: RequestOptions
|
|
339
|
+
): Promise<ObservabilityResponse> {
|
|
340
|
+
const context = this.createContext<ObservabilityContext>(options);
|
|
302
341
|
|
|
303
342
|
return observability(context, threadId, runId);
|
|
304
343
|
}
|
|
@@ -309,8 +348,12 @@ export class TenxGraphClient {
|
|
|
309
348
|
* @param config - Optional configuration for the stop operation
|
|
310
349
|
* @returns StopGraphResponse with the stop operation result
|
|
311
350
|
*/
|
|
312
|
-
async stopGraph(
|
|
313
|
-
|
|
351
|
+
async stopGraph(
|
|
352
|
+
threadId: string,
|
|
353
|
+
config?: Record<string, any>,
|
|
354
|
+
options?: RequestOptions
|
|
355
|
+
): Promise<StopGraphResponse> {
|
|
356
|
+
const context = this.createContext<StopGraphContext>(options);
|
|
314
357
|
|
|
315
358
|
const request: StopGraphRequest = {
|
|
316
359
|
thread_id: threadId,
|
|
@@ -321,16 +364,23 @@ export class TenxGraphClient {
|
|
|
321
364
|
}
|
|
322
365
|
|
|
323
366
|
/**
|
|
324
|
-
*
|
|
325
|
-
*
|
|
326
|
-
*
|
|
367
|
+
* Repair a thread whose run stopped after the model asked for tools but before
|
|
368
|
+
* the results were saved. The server removes assistant messages with unanswered
|
|
369
|
+
* tool calls (matched by tool call id) and tool results whose call no longer
|
|
370
|
+
* exists. Unanswered calls of the latest assistant message are kept while the
|
|
371
|
+
* thread is paused (interrupt, client tool call or human approval). When nothing
|
|
372
|
+
* needs fixing, removed_count is 0 and the state is not written.
|
|
327
373
|
*
|
|
328
374
|
* @param threadId - The ID of the thread to fix state for
|
|
329
375
|
* @param config - Optional configuration for the fix operation
|
|
330
376
|
* @returns FixGraphResponse with the fix operation result including removed_count
|
|
331
377
|
*/
|
|
332
|
-
async fixGraph(
|
|
333
|
-
|
|
378
|
+
async fixGraph(
|
|
379
|
+
threadId: string,
|
|
380
|
+
config?: Record<string, any>,
|
|
381
|
+
options?: RequestOptions
|
|
382
|
+
): Promise<FixGraphResponse> {
|
|
383
|
+
const context = this.createContext<FixGraphContext>(options);
|
|
334
384
|
|
|
335
385
|
const request: FixGraphRequest = {
|
|
336
386
|
thread_id: threadId,
|
|
@@ -346,8 +396,8 @@ export class TenxGraphClient {
|
|
|
346
396
|
/**
|
|
347
397
|
* Fetch the state schema of the agent
|
|
348
398
|
*/
|
|
349
|
-
async graphStateSchema(): Promise<StateSchemaResponse> {
|
|
350
|
-
const context = this.createContext<StateSchemaContext>();
|
|
399
|
+
async graphStateSchema(options?: RequestOptions): Promise<StateSchemaResponse> {
|
|
400
|
+
const context = this.createContext<StateSchemaContext>(options);
|
|
351
401
|
|
|
352
402
|
return stateSchema(context);
|
|
353
403
|
}
|
|
@@ -361,8 +411,11 @@ export class TenxGraphClient {
|
|
|
361
411
|
* @param threadId - The ID of the thread to fetch state for
|
|
362
412
|
* @returns ThreadStateResponse containing the thread's current state
|
|
363
413
|
*/
|
|
364
|
-
async threadState(
|
|
365
|
-
|
|
414
|
+
async threadState(
|
|
415
|
+
threadId: string | number,
|
|
416
|
+
options?: RequestOptions
|
|
417
|
+
): Promise<ThreadStateResponse> {
|
|
418
|
+
const context = this.createContext<ThreadStateContext>(options);
|
|
366
419
|
|
|
367
420
|
return threadState(context, threadId);
|
|
368
421
|
}
|
|
@@ -377,9 +430,10 @@ export class TenxGraphClient {
|
|
|
377
430
|
async updateThreadState(
|
|
378
431
|
threadId: string | number,
|
|
379
432
|
config: Record<string, any>,
|
|
380
|
-
state: any // AgentState
|
|
433
|
+
state: any, // AgentState
|
|
434
|
+
options?: RequestOptions
|
|
381
435
|
): Promise<UpdateThreadStateResponse> {
|
|
382
|
-
const context = this.createContext<UpdateThreadStateContext>();
|
|
436
|
+
const context = this.createContext<UpdateThreadStateContext>(options);
|
|
383
437
|
|
|
384
438
|
const request: UpdateThreadStateRequest = {
|
|
385
439
|
config,
|
|
@@ -394,8 +448,11 @@ export class TenxGraphClient {
|
|
|
394
448
|
* @param threadId - The ID of the thread to clear state for
|
|
395
449
|
* @returns ClearThreadStateResponse with the clear operation result
|
|
396
450
|
*/
|
|
397
|
-
async clearThreadState(
|
|
398
|
-
|
|
451
|
+
async clearThreadState(
|
|
452
|
+
threadId: string | number,
|
|
453
|
+
options?: RequestOptions
|
|
454
|
+
): Promise<ClearThreadStateResponse> {
|
|
455
|
+
const context = this.createContext<ClearThreadStateContext>(options);
|
|
399
456
|
|
|
400
457
|
return clearThreadState(context, threadId);
|
|
401
458
|
}
|
|
@@ -405,8 +462,11 @@ export class TenxGraphClient {
|
|
|
405
462
|
* @param threadId - The ID of the thread to fetch
|
|
406
463
|
* @returns ThreadDetailsResponse containing thread details
|
|
407
464
|
*/
|
|
408
|
-
async threadDetails(
|
|
409
|
-
|
|
465
|
+
async threadDetails(
|
|
466
|
+
threadId: string | number,
|
|
467
|
+
options?: RequestOptions
|
|
468
|
+
): Promise<ThreadDetailsResponse> {
|
|
469
|
+
const context = this.createContext<ThreadDetailsContext>(options);
|
|
410
470
|
|
|
411
471
|
return threadDetails(context, threadId);
|
|
412
472
|
}
|
|
@@ -419,14 +479,20 @@ export class TenxGraphClient {
|
|
|
419
479
|
* @returns ThreadsResponse containing the list of threads and metadata
|
|
420
480
|
*/
|
|
421
481
|
async threads(): Promise<ThreadsResponse>;
|
|
422
|
-
async threads(request: ThreadsRequest): Promise<ThreadsResponse>;
|
|
482
|
+
async threads(request: ThreadsRequest, options?: RequestOptions): Promise<ThreadsResponse>;
|
|
423
483
|
async threads(
|
|
424
484
|
search?: string | ThreadsRequest,
|
|
425
|
-
offset?: number,
|
|
426
|
-
limit?: number
|
|
485
|
+
offset?: number | RequestOptions,
|
|
486
|
+
limit?: number,
|
|
487
|
+
options?: RequestOptions
|
|
427
488
|
): Promise<ThreadsResponse> {
|
|
428
|
-
const
|
|
429
|
-
const
|
|
489
|
+
const requestOptions = typeof offset === 'object' ? offset : options;
|
|
490
|
+
const context = this.createContext<ThreadsContext>(requestOptions);
|
|
491
|
+
const request = normalizeThreadsRequest(
|
|
492
|
+
search,
|
|
493
|
+
typeof offset === 'number' ? offset : undefined,
|
|
494
|
+
limit
|
|
495
|
+
);
|
|
430
496
|
|
|
431
497
|
return threads(context, request);
|
|
432
498
|
}
|
|
@@ -441,22 +507,34 @@ export class TenxGraphClient {
|
|
|
441
507
|
*/
|
|
442
508
|
async threadMessages(
|
|
443
509
|
threadId: string | number,
|
|
444
|
-
request: Omit<ThreadMessagesRequest, 'threadId'
|
|
510
|
+
request: Omit<ThreadMessagesRequest, 'threadId'>,
|
|
511
|
+
options?: RequestOptions
|
|
445
512
|
): Promise<ThreadMessagesResponse>;
|
|
446
513
|
async threadMessages(
|
|
447
514
|
threadId: string | number,
|
|
448
515
|
search?: string | Omit<ThreadMessagesRequest, 'threadId'>,
|
|
449
|
-
offset?: number,
|
|
450
|
-
limit?: number
|
|
516
|
+
offset?: number | RequestOptions,
|
|
517
|
+
limit?: number,
|
|
518
|
+
options?: RequestOptions
|
|
451
519
|
): Promise<ThreadMessagesResponse> {
|
|
452
|
-
const
|
|
453
|
-
const
|
|
520
|
+
const requestOptions = typeof offset === 'object' ? offset : options;
|
|
521
|
+
const context = this.createContext<ThreadMessagesContext>(requestOptions);
|
|
522
|
+
const request = normalizeThreadMessagesRequest(
|
|
523
|
+
threadId,
|
|
524
|
+
search,
|
|
525
|
+
typeof offset === 'number' ? offset : undefined,
|
|
526
|
+
limit
|
|
527
|
+
);
|
|
454
528
|
|
|
455
529
|
return threadMessages(context, request);
|
|
456
530
|
}
|
|
457
531
|
|
|
458
532
|
/**
|
|
459
533
|
* Add messages to a specific thread checkpoint
|
|
534
|
+
*
|
|
535
|
+
* @deprecated Requires the `checkpointer:import` scope (admin only) in 10xgraph-api releases after 0.9.0.
|
|
536
|
+
* Use `updateThreadMessageFeedback` to attach feedback to a message.
|
|
537
|
+
*
|
|
460
538
|
* @param threadId - The ID of the thread to add messages to
|
|
461
539
|
* @param messages - Array of messages to add to the checkpoint
|
|
462
540
|
* @param config - Configuration map for the checkpoint
|
|
@@ -467,9 +545,10 @@ export class TenxGraphClient {
|
|
|
467
545
|
threadId: string | number,
|
|
468
546
|
messages: Message[],
|
|
469
547
|
config: Record<string, any> = {},
|
|
470
|
-
metadata?: Record<string, any
|
|
548
|
+
metadata?: Record<string, any>,
|
|
549
|
+
options?: RequestOptions
|
|
471
550
|
): Promise<AddThreadMessagesResponse> {
|
|
472
|
-
const context = this.createContext<AddThreadMessagesContext>();
|
|
551
|
+
const context = this.createContext<AddThreadMessagesContext>(options);
|
|
473
552
|
|
|
474
553
|
const request: AddThreadMessagesRequest = {
|
|
475
554
|
threadId,
|
|
@@ -489,9 +568,10 @@ export class TenxGraphClient {
|
|
|
489
568
|
*/
|
|
490
569
|
async singleMessage(
|
|
491
570
|
threadId: string | number,
|
|
492
|
-
messageId: string
|
|
571
|
+
messageId: string,
|
|
572
|
+
options?: RequestOptions
|
|
493
573
|
): Promise<ThreadMessageResponse> {
|
|
494
|
-
const context = this.createContext<ThreadMessageContext>();
|
|
574
|
+
const context = this.createContext<ThreadMessageContext>(options);
|
|
495
575
|
|
|
496
576
|
const request: ThreadMessageRequest = {
|
|
497
577
|
threadId,
|
|
@@ -511,9 +591,10 @@ export class TenxGraphClient {
|
|
|
511
591
|
async deleteMessage(
|
|
512
592
|
threadId: string | number,
|
|
513
593
|
messageId: string,
|
|
514
|
-
config?: Record<string, any
|
|
594
|
+
config?: Record<string, any>,
|
|
595
|
+
options?: RequestOptions
|
|
515
596
|
): Promise<DeleteThreadMessageResponse> {
|
|
516
|
-
const context = this.createContext<DeleteThreadMessageContext>();
|
|
597
|
+
const context = this.createContext<DeleteThreadMessageContext>(options);
|
|
517
598
|
|
|
518
599
|
const request: DeleteThreadMessageRequest = {
|
|
519
600
|
threadId,
|
|
@@ -524,6 +605,31 @@ export class TenxGraphClient {
|
|
|
524
605
|
return deleteThreadMessage(context, request);
|
|
525
606
|
}
|
|
526
607
|
|
|
608
|
+
/**
|
|
609
|
+
* Replace the feedback attached to a message (`message.metadata.feedback`).
|
|
610
|
+
* Nothing else on the message changes.
|
|
611
|
+
* @param threadId - The ID of the thread
|
|
612
|
+
* @param messageId - The ID of the message to attach feedback to
|
|
613
|
+
* @param feedback - Any JSON object, at most 8192 serialized bytes and nesting depth 10
|
|
614
|
+
* @returns UpdateThreadMessageFeedbackResponse containing the updated message
|
|
615
|
+
*/
|
|
616
|
+
async updateThreadMessageFeedback(
|
|
617
|
+
threadId: string | number,
|
|
618
|
+
messageId: string,
|
|
619
|
+
feedback: Record<string, unknown>,
|
|
620
|
+
options?: RequestOptions
|
|
621
|
+
): Promise<UpdateThreadMessageFeedbackResponse> {
|
|
622
|
+
const context = this.createContext<UpdateThreadMessageFeedbackContext>(options);
|
|
623
|
+
|
|
624
|
+
const request: UpdateThreadMessageFeedbackRequest = {
|
|
625
|
+
threadId,
|
|
626
|
+
messageId,
|
|
627
|
+
feedback,
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
return updateThreadMessageFeedback(context, request);
|
|
631
|
+
}
|
|
632
|
+
|
|
527
633
|
/**
|
|
528
634
|
* Delete a specific thread
|
|
529
635
|
* @param threadId - The ID of the thread to delete
|
|
@@ -532,9 +638,10 @@ export class TenxGraphClient {
|
|
|
532
638
|
*/
|
|
533
639
|
async deleteThread(
|
|
534
640
|
threadId: string | number,
|
|
535
|
-
config?: Record<string, any
|
|
641
|
+
config?: Record<string, any>,
|
|
642
|
+
options?: RequestOptions
|
|
536
643
|
): Promise<DeleteThreadResponse> {
|
|
537
|
-
const context = this.createContext<DeleteThreadContext>();
|
|
644
|
+
const context = this.createContext<DeleteThreadContext>(options);
|
|
538
645
|
|
|
539
646
|
const request: DeleteThreadRequest = {
|
|
540
647
|
threadId,
|
|
@@ -556,21 +663,30 @@ export class TenxGraphClient {
|
|
|
556
663
|
initial_state?: Record<string, any>;
|
|
557
664
|
config?: Record<string, any>;
|
|
558
665
|
recursion_limit?: number;
|
|
666
|
+
on_busy?: 'wait' | 'cancel';
|
|
667
|
+
resume?: unknown;
|
|
668
|
+
interrupt_id?: string;
|
|
559
669
|
response_granularity?: 'full' | 'partial' | 'low';
|
|
670
|
+
/** Abort to cancel the request (and the open stream or socket). */
|
|
671
|
+
signal?: AbortSignal;
|
|
560
672
|
onPartialResult?: InvokeCallback;
|
|
561
673
|
}
|
|
562
674
|
): Promise<InvokeResult> {
|
|
563
675
|
const context: InvokeContext = {
|
|
564
676
|
...this.createContext<InvokeContext>(),
|
|
565
677
|
toolExecutor: this.toolExecutor,
|
|
678
|
+
signal: options?.signal,
|
|
566
679
|
};
|
|
567
680
|
|
|
568
681
|
// Prepare request
|
|
569
682
|
const request: InvokeRequest = {
|
|
570
|
-
messages: messages.map((msg) =>
|
|
683
|
+
messages: messages.map((msg) => serializeMessage(msg)),
|
|
571
684
|
initial_state: options?.initial_state,
|
|
572
685
|
config: options?.config,
|
|
573
|
-
recursion_limit: options?.recursion_limit
|
|
686
|
+
recursion_limit: options?.recursion_limit ?? 25,
|
|
687
|
+
on_busy: options?.on_busy,
|
|
688
|
+
resume: options?.resume,
|
|
689
|
+
interrupt_id: options?.interrupt_id,
|
|
574
690
|
response_granularity: options?.response_granularity || 'full',
|
|
575
691
|
};
|
|
576
692
|
|
|
@@ -608,20 +724,29 @@ export class TenxGraphClient {
|
|
|
608
724
|
initial_state?: Record<string, any>;
|
|
609
725
|
config?: Record<string, any>;
|
|
610
726
|
recursion_limit?: number;
|
|
727
|
+
on_busy?: 'wait' | 'cancel';
|
|
728
|
+
resume?: unknown;
|
|
729
|
+
interrupt_id?: string;
|
|
611
730
|
response_granularity?: 'full' | 'partial' | 'low';
|
|
731
|
+
/** Abort to cancel the request (and the open stream or socket). */
|
|
732
|
+
signal?: AbortSignal;
|
|
612
733
|
}
|
|
613
734
|
): AsyncGenerator<StreamChunk, void, unknown> {
|
|
614
735
|
const context: StreamContext = {
|
|
615
736
|
...this.createContext<StreamContext>(),
|
|
616
737
|
toolExecutor: this.toolExecutor,
|
|
738
|
+
signal: options?.signal,
|
|
617
739
|
};
|
|
618
740
|
|
|
619
741
|
// Prepare request
|
|
620
742
|
const request: StreamRequest = {
|
|
621
|
-
messages: messages.map((msg) =>
|
|
743
|
+
messages: messages.map((msg) => serializeMessage(msg)),
|
|
622
744
|
initial_state: options?.initial_state,
|
|
623
745
|
config: options?.config,
|
|
624
|
-
recursion_limit: options?.recursion_limit
|
|
746
|
+
recursion_limit: options?.recursion_limit ?? 25,
|
|
747
|
+
on_busy: options?.on_busy,
|
|
748
|
+
resume: options?.resume,
|
|
749
|
+
interrupt_id: options?.interrupt_id,
|
|
625
750
|
response_granularity: options?.response_granularity || 'low',
|
|
626
751
|
};
|
|
627
752
|
|
|
@@ -671,19 +796,28 @@ export class TenxGraphClient {
|
|
|
671
796
|
initial_state?: Record<string, any>;
|
|
672
797
|
config?: Record<string, any>;
|
|
673
798
|
recursion_limit?: number;
|
|
799
|
+
on_busy?: 'wait' | 'cancel';
|
|
800
|
+
resume?: unknown;
|
|
801
|
+
interrupt_id?: string;
|
|
674
802
|
response_granularity?: 'full' | 'partial' | 'low';
|
|
803
|
+
/** Abort to cancel the request (and the open stream or socket). */
|
|
804
|
+
signal?: AbortSignal;
|
|
675
805
|
}
|
|
676
806
|
): AsyncGenerator<StreamChunk, void, unknown> {
|
|
677
807
|
const context: WsStreamContext = {
|
|
678
808
|
...this.createContext<WsStreamContext>(),
|
|
679
809
|
toolExecutor: this.toolExecutor,
|
|
810
|
+
signal: options?.signal,
|
|
680
811
|
};
|
|
681
812
|
|
|
682
813
|
const request: StreamRequest = {
|
|
683
|
-
messages: messages.map((msg) =>
|
|
814
|
+
messages: messages.map((msg) => serializeMessage(msg)),
|
|
684
815
|
initial_state: options?.initial_state,
|
|
685
816
|
config: options?.config,
|
|
686
817
|
recursion_limit: options?.recursion_limit ?? 25,
|
|
818
|
+
on_busy: options?.on_busy,
|
|
819
|
+
resume: options?.resume,
|
|
820
|
+
interrupt_id: options?.interrupt_id,
|
|
687
821
|
response_granularity: options?.response_granularity ?? 'low',
|
|
688
822
|
};
|
|
689
823
|
|
|
@@ -700,7 +834,7 @@ export class TenxGraphClient {
|
|
|
700
834
|
*
|
|
701
835
|
* @example
|
|
702
836
|
* ```ts
|
|
703
|
-
* const session = client.realtime({ model: 'gemini-
|
|
837
|
+
* const session = client.realtime({ model: 'gemini-3.8-live' });
|
|
704
838
|
* session.on('audio', (pcm) => speaker.write(pcm));
|
|
705
839
|
* session.on('output_transcript', (e) => console.log(e.text));
|
|
706
840
|
* await session.ready;
|
|
@@ -708,7 +842,12 @@ export class TenxGraphClient {
|
|
|
708
842
|
* ```
|
|
709
843
|
*/
|
|
710
844
|
realtime(init: RealtimeInit, options?: RealtimeOptions): RealtimeSession {
|
|
711
|
-
const context =
|
|
845
|
+
const context: RealtimeContext = {
|
|
846
|
+
...this.createContext<RealtimeContext>(),
|
|
847
|
+
// Re-resolved on every reconnect so a refreshed token is used
|
|
848
|
+
getAuthToken: () =>
|
|
849
|
+
typeof this.authToken === 'function' ? this.authToken() : this.authToken,
|
|
850
|
+
};
|
|
712
851
|
return new RealtimeSession(context, init, options);
|
|
713
852
|
}
|
|
714
853
|
|
|
@@ -729,8 +868,11 @@ export class TenxGraphClient {
|
|
|
729
868
|
* console.log('Memory stored with ID:', result.data.memory_id);
|
|
730
869
|
* ```
|
|
731
870
|
*/
|
|
732
|
-
async storeMemory(
|
|
733
|
-
|
|
871
|
+
async storeMemory(
|
|
872
|
+
request: StoreMemoryRequest,
|
|
873
|
+
options?: RequestOptions
|
|
874
|
+
): Promise<StoreMemoryResponse> {
|
|
875
|
+
const context = this.createContext<StoreMemoryContext>(options);
|
|
734
876
|
|
|
735
877
|
return storeMemoryEndpoint(context, request);
|
|
736
878
|
}
|
|
@@ -754,8 +896,11 @@ export class TenxGraphClient {
|
|
|
754
896
|
* });
|
|
755
897
|
* ```
|
|
756
898
|
*/
|
|
757
|
-
async searchMemory(
|
|
758
|
-
|
|
899
|
+
async searchMemory(
|
|
900
|
+
request: SearchMemoryRequest,
|
|
901
|
+
options?: RequestOptions
|
|
902
|
+
): Promise<SearchMemoryResponse> {
|
|
903
|
+
const context = this.createContext<SearchMemoryContext>(options);
|
|
759
904
|
|
|
760
905
|
return searchMemoryEndpoint(context, request);
|
|
761
906
|
}
|
|
@@ -778,9 +923,9 @@ export class TenxGraphClient {
|
|
|
778
923
|
*/
|
|
779
924
|
async getMemory(
|
|
780
925
|
memoryId: string,
|
|
781
|
-
options?: { config?: Record<string, any>; options?: Record<string, any
|
|
926
|
+
options?: { config?: Record<string, any>; options?: Record<string, any>; signal?: AbortSignal }
|
|
782
927
|
): Promise<GetMemoryResponse> {
|
|
783
|
-
const context = this.createContext<GetMemoryContext>();
|
|
928
|
+
const context = this.createContext<GetMemoryContext>(options);
|
|
784
929
|
|
|
785
930
|
const request: GetMemoryRequest = {
|
|
786
931
|
memoryId,
|
|
@@ -814,9 +959,10 @@ export class TenxGraphClient {
|
|
|
814
959
|
config?: Record<string, any>;
|
|
815
960
|
options?: Record<string, any>;
|
|
816
961
|
metadata?: Record<string, any>;
|
|
962
|
+
signal?: AbortSignal;
|
|
817
963
|
}
|
|
818
964
|
): Promise<UpdateMemoryResponse> {
|
|
819
|
-
const context = this.createContext<UpdateMemoryContext>();
|
|
965
|
+
const context = this.createContext<UpdateMemoryContext>(options);
|
|
820
966
|
|
|
821
967
|
const request: UpdateMemoryRequest = {
|
|
822
968
|
memoryId,
|
|
@@ -847,9 +993,9 @@ export class TenxGraphClient {
|
|
|
847
993
|
*/
|
|
848
994
|
async deleteMemory(
|
|
849
995
|
memoryId: string,
|
|
850
|
-
options?: { config?: Record<string, any>; options?: Record<string, any
|
|
996
|
+
options?: { config?: Record<string, any>; options?: Record<string, any>; signal?: AbortSignal }
|
|
851
997
|
): Promise<DeleteMemoryResponse> {
|
|
852
|
-
const context = this.createContext<DeleteMemoryContext>();
|
|
998
|
+
const context = this.createContext<DeleteMemoryContext>(options);
|
|
853
999
|
|
|
854
1000
|
const request: DeleteMemoryRequest = {
|
|
855
1001
|
memoryId,
|
|
@@ -882,13 +1028,16 @@ export class TenxGraphClient {
|
|
|
882
1028
|
config?: Record<string, any>;
|
|
883
1029
|
options?: Record<string, any>;
|
|
884
1030
|
limit?: number;
|
|
1031
|
+
offset?: number;
|
|
1032
|
+
signal?: AbortSignal;
|
|
885
1033
|
}): Promise<ListMemoriesResponse> {
|
|
886
|
-
const context = this.createContext<ListMemoriesContext>();
|
|
1034
|
+
const context = this.createContext<ListMemoriesContext>(options);
|
|
887
1035
|
|
|
888
1036
|
const request: ListMemoriesRequest = {
|
|
889
1037
|
config: options?.config,
|
|
890
1038
|
options: options?.options,
|
|
891
1039
|
limit: options?.limit,
|
|
1040
|
+
offset: options?.offset,
|
|
892
1041
|
};
|
|
893
1042
|
|
|
894
1043
|
return listMemoriesEndpoint(context, request);
|
|
@@ -917,8 +1066,9 @@ export class TenxGraphClient {
|
|
|
917
1066
|
memory_type?: any;
|
|
918
1067
|
category?: string;
|
|
919
1068
|
filters?: Record<string, any>;
|
|
1069
|
+
signal?: AbortSignal;
|
|
920
1070
|
}): Promise<ForgetMemoriesResponse> {
|
|
921
|
-
const context = this.createContext<ForgetMemoriesContext>();
|
|
1071
|
+
const context = this.createContext<ForgetMemoriesContext>(options);
|
|
922
1072
|
|
|
923
1073
|
const request: ForgetMemoriesRequest = {
|
|
924
1074
|
config: options?.config,
|
|
@@ -949,25 +1099,35 @@ export class TenxGraphClient {
|
|
|
949
1099
|
* ```
|
|
950
1100
|
*/
|
|
951
1101
|
async uploadFile(
|
|
952
|
-
file: File | Blob | { data: Blob; filename: string }
|
|
1102
|
+
file: File | Blob | { data: Blob; filename: string },
|
|
1103
|
+
options?: RequestOptions
|
|
953
1104
|
): Promise<FileUploadResponse> {
|
|
954
|
-
const context = this.createContext<FileUploadContext>();
|
|
1105
|
+
const context = this.createContext<FileUploadContext>(options);
|
|
955
1106
|
return uploadFileEndpoint(context, file);
|
|
956
1107
|
}
|
|
957
1108
|
|
|
958
1109
|
/**
|
|
959
1110
|
* Download a file by its file_id. Returns raw Blob.
|
|
960
1111
|
*/
|
|
961
|
-
async getFile(fileId: string): Promise<Blob> {
|
|
962
|
-
const context = this.createContext<FileUploadContext>();
|
|
1112
|
+
async getFile(fileId: string, options?: RequestOptions): Promise<Blob> {
|
|
1113
|
+
const context = this.createContext<FileUploadContext>(options);
|
|
963
1114
|
return getFileEndpoint(context, fileId);
|
|
964
1115
|
}
|
|
965
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* List the caller's uploaded files (GET /v1/files).
|
|
1119
|
+
* Throws a TenxGraphError with status 501 when the media store cannot enumerate files.
|
|
1120
|
+
*/
|
|
1121
|
+
async listFiles(params?: ListFilesRequest, options?: RequestOptions): Promise<ListFilesResponse> {
|
|
1122
|
+
const context = this.createContext<FileUploadContext>(options);
|
|
1123
|
+
return listFilesEndpoint(context, params);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
966
1126
|
/**
|
|
967
1127
|
* Get metadata about a stored file.
|
|
968
1128
|
*/
|
|
969
|
-
async getFileInfo(fileId: string): Promise<FileInfoResponse> {
|
|
970
|
-
const context = this.createContext<FileUploadContext>();
|
|
1129
|
+
async getFileInfo(fileId: string, options?: RequestOptions): Promise<FileInfoResponse> {
|
|
1130
|
+
const context = this.createContext<FileUploadContext>(options);
|
|
971
1131
|
return getFileInfoEndpoint(context, fileId);
|
|
972
1132
|
}
|
|
973
1133
|
|
|
@@ -976,69 +1136,29 @@ export class TenxGraphClient {
|
|
|
976
1136
|
* For cloud-backed media this will typically be a signed URL.
|
|
977
1137
|
* For local or memory-backed media this may fall back to the API file route.
|
|
978
1138
|
*/
|
|
979
|
-
async getFileAccessUrl(fileId: string): Promise<FileAccessUrlResponse> {
|
|
980
|
-
const context = this.createContext<FileUploadContext>();
|
|
1139
|
+
async getFileAccessUrl(fileId: string, options?: RequestOptions): Promise<FileAccessUrlResponse> {
|
|
1140
|
+
const context = this.createContext<FileUploadContext>(options);
|
|
981
1141
|
return getFileAccessUrlEndpoint(context, fileId);
|
|
982
1142
|
}
|
|
983
1143
|
|
|
984
1144
|
/**
|
|
985
|
-
*
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
/**
|
|
993
|
-
* Serialize a Message object for API transmission
|
|
994
|
-
* Converts Message class instances to plain objects
|
|
1145
|
+
* Delete a stored file. Only the file's owner can delete it.
|
|
1146
|
+
* Requires the `files:delete` permission; the server returns 404 when the file
|
|
1147
|
+
* does not exist or belongs to someone else.
|
|
1148
|
+
*
|
|
1149
|
+
* @param fileId - The file_id returned by `uploadFile`
|
|
1150
|
+
* @returns DeleteFileResponse with `data.file_id` and `data.deleted`
|
|
995
1151
|
*/
|
|
996
|
-
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
content: this.cleanContent(message.content),
|
|
1000
|
-
};
|
|
1001
|
-
|
|
1002
|
-
// message_id: use "0" if not set (server will generate one)
|
|
1003
|
-
if (message.message_id !== null && message.message_id !== undefined) {
|
|
1004
|
-
serialized.message_id = String(message.message_id);
|
|
1005
|
-
} else {
|
|
1006
|
-
serialized.message_id = '0';
|
|
1007
|
-
}
|
|
1008
|
-
|
|
1009
|
-
// Only include optional fields if they are explicitly set
|
|
1010
|
-
if (message.tools_calls) {
|
|
1011
|
-
serialized.tools_calls = message.tools_calls;
|
|
1012
|
-
}
|
|
1013
|
-
if (message.metadata && Object.keys(message.metadata).length > 0) {
|
|
1014
|
-
serialized.metadata = message.metadata;
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
return serialized;
|
|
1152
|
+
async deleteFile(fileId: string, options?: RequestOptions): Promise<DeleteFileResponse> {
|
|
1153
|
+
const context = this.createContext<DeleteFileContext>(options);
|
|
1154
|
+
return deleteFileEndpoint(context, fileId);
|
|
1018
1155
|
}
|
|
1019
1156
|
|
|
1020
1157
|
/**
|
|
1021
|
-
*
|
|
1022
|
-
* Server requires array of content blocks, not simplified string
|
|
1158
|
+
* Get the current multimodal configuration from the server.
|
|
1023
1159
|
*/
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
return
|
|
1027
|
-
const cleaned: any = {};
|
|
1028
|
-
|
|
1029
|
-
for (const [key, value] of Object.entries(block)) {
|
|
1030
|
-
// Skip empty arrays
|
|
1031
|
-
if (Array.isArray(value) && value.length === 0) {
|
|
1032
|
-
continue;
|
|
1033
|
-
}
|
|
1034
|
-
// Skip undefined values
|
|
1035
|
-
if (value === undefined) {
|
|
1036
|
-
continue;
|
|
1037
|
-
}
|
|
1038
|
-
cleaned[key] = value;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
return cleaned;
|
|
1042
|
-
});
|
|
1160
|
+
async getMultimodalConfig(options?: RequestOptions): Promise<MultimodalConfigResponse> {
|
|
1161
|
+
const context = this.createContext<FileUploadContext>(options);
|
|
1162
|
+
return getMultimodalConfigEndpoint(context);
|
|
1043
1163
|
}
|
|
1044
1164
|
}
|