@reverbia/sdk 1.0.0-next.20251208112742 → 1.0.0-next.20251209090511
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/expo/index.cjs +1061 -107
- package/dist/expo/index.d.mts +150 -6
- package/dist/expo/index.d.ts +150 -6
- package/dist/expo/index.mjs +1059 -106
- package/dist/react/index.cjs +523 -47635
- package/dist/react/index.d.mts +42 -26
- package/dist/react/index.d.ts +42 -26
- package/dist/react/index.mjs +428 -166
- package/package.json +1 -1
- package/dist/react/chunk-BG7SZT33.mjs +0 -182
- package/dist/react/chunk-FBCDBTKJ.mjs +0 -55
- package/dist/react/chunk-LVWIZZZP.mjs +0 -6
- package/dist/react/chunk-Q6FVPTTV.mjs +0 -28
- package/dist/react/constants-WUGUGYE3.mjs +0 -7
- package/dist/react/generation-NG4QVPCR.mjs +0 -52
- package/dist/react/onnxruntime_binding-5QEF3SUC.node +0 -0
- package/dist/react/onnxruntime_binding-BKPKNEGC.node +0 -0
- package/dist/react/onnxruntime_binding-FMOXGIUT.node +0 -0
- package/dist/react/onnxruntime_binding-OI2KMXC5.node +0 -0
- package/dist/react/onnxruntime_binding-UX44MLAZ.node +0 -0
- package/dist/react/onnxruntime_binding-Y2W7N7WY.node +0 -0
- package/dist/react/selector-XMR5KL3E.mjs +0 -14
- package/dist/react/transformers.node-LUTOZWVQ.mjs +0 -46943
package/dist/react/index.d.mts
CHANGED
|
@@ -395,7 +395,10 @@ interface ToolExecutionResult {
|
|
|
395
395
|
error?: string;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
/**
|
|
399
|
+
* Base arguments for sending a message
|
|
400
|
+
*/
|
|
401
|
+
type BaseSendMessageArgs = {
|
|
399
402
|
messages: LlmapiMessage[];
|
|
400
403
|
model?: string;
|
|
401
404
|
/**
|
|
@@ -405,22 +408,11 @@ type SendMessageArgs = {
|
|
|
405
408
|
* @param chunk - The content delta from the current chunk
|
|
406
409
|
*/
|
|
407
410
|
onData?: (chunk: string) => void;
|
|
408
|
-
/**
|
|
409
|
-
* Whether to run tool selection for this message.
|
|
410
|
-
* Defaults to true if tools are configured.
|
|
411
|
-
*/
|
|
412
|
-
runTools?: boolean;
|
|
413
|
-
};
|
|
414
|
-
type SendMessageResult = {
|
|
415
|
-
data: LlmapiChatCompletionResponse;
|
|
416
|
-
error: null;
|
|
417
|
-
toolExecution?: ToolExecutionResult;
|
|
418
|
-
} | {
|
|
419
|
-
data: null;
|
|
420
|
-
error: string;
|
|
421
|
-
toolExecution?: ToolExecutionResult;
|
|
422
411
|
};
|
|
423
|
-
|
|
412
|
+
/**
|
|
413
|
+
* Base options for useChat hook
|
|
414
|
+
*/
|
|
415
|
+
type BaseUseChatOptions = {
|
|
424
416
|
getToken?: () => Promise<string | null>;
|
|
425
417
|
baseUrl?: string;
|
|
426
418
|
/**
|
|
@@ -442,6 +434,39 @@ type UseChatOptions = {
|
|
|
442
434
|
* @param error - The error that occurred (never an AbortError)
|
|
443
435
|
*/
|
|
444
436
|
onError?: (error: Error) => void;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Base result type for useChat hook
|
|
440
|
+
*/
|
|
441
|
+
type BaseUseChatResult = {
|
|
442
|
+
isLoading: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Aborts the current streaming request if one is in progress.
|
|
445
|
+
*
|
|
446
|
+
* When a request is aborted, `sendMessage` will return with
|
|
447
|
+
* `{ data: null, error: "Request aborted" }`. The `onError` callback
|
|
448
|
+
* will NOT be called, as aborts are intentional actions, not errors.
|
|
449
|
+
*/
|
|
450
|
+
stop: () => void;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
type SendMessageArgs = BaseSendMessageArgs & {
|
|
454
|
+
/**
|
|
455
|
+
* Whether to run tool selection for this message.
|
|
456
|
+
* Defaults to true if tools are configured.
|
|
457
|
+
*/
|
|
458
|
+
runTools?: boolean;
|
|
459
|
+
};
|
|
460
|
+
type SendMessageResult = {
|
|
461
|
+
data: LlmapiChatCompletionResponse;
|
|
462
|
+
error: null;
|
|
463
|
+
toolExecution?: ToolExecutionResult;
|
|
464
|
+
} | {
|
|
465
|
+
data: null;
|
|
466
|
+
error: string;
|
|
467
|
+
toolExecution?: ToolExecutionResult;
|
|
468
|
+
};
|
|
469
|
+
type UseChatOptions = BaseUseChatOptions & {
|
|
445
470
|
/**
|
|
446
471
|
* The provider to use for chat completions (default: "api")
|
|
447
472
|
* "local": Uses a local HuggingFace model (in-browser)
|
|
@@ -469,18 +494,9 @@ type UseChatOptions = {
|
|
|
469
494
|
*/
|
|
470
495
|
onToolExecution?: (result: ToolExecutionResult) => void;
|
|
471
496
|
};
|
|
472
|
-
type UseChatResult = {
|
|
473
|
-
isLoading: boolean;
|
|
497
|
+
type UseChatResult = BaseUseChatResult & {
|
|
474
498
|
isSelectingTool: boolean;
|
|
475
499
|
sendMessage: (args: SendMessageArgs) => Promise<SendMessageResult>;
|
|
476
|
-
/**
|
|
477
|
-
* Aborts the current streaming request if one is in progress.
|
|
478
|
-
*
|
|
479
|
-
* When a request is aborted, `sendMessage` will return with
|
|
480
|
-
* `{ data: null, error: "Request aborted" }`. The `onError` callback
|
|
481
|
-
* will NOT be called, as aborts are intentional actions, not errors.
|
|
482
|
-
*/
|
|
483
|
-
stop: () => void;
|
|
484
500
|
};
|
|
485
501
|
/**
|
|
486
502
|
* A React hook for managing chat completions with authentication.
|
package/dist/react/index.d.ts
CHANGED
|
@@ -395,7 +395,10 @@ interface ToolExecutionResult {
|
|
|
395
395
|
error?: string;
|
|
396
396
|
}
|
|
397
397
|
|
|
398
|
-
|
|
398
|
+
/**
|
|
399
|
+
* Base arguments for sending a message
|
|
400
|
+
*/
|
|
401
|
+
type BaseSendMessageArgs = {
|
|
399
402
|
messages: LlmapiMessage[];
|
|
400
403
|
model?: string;
|
|
401
404
|
/**
|
|
@@ -405,22 +408,11 @@ type SendMessageArgs = {
|
|
|
405
408
|
* @param chunk - The content delta from the current chunk
|
|
406
409
|
*/
|
|
407
410
|
onData?: (chunk: string) => void;
|
|
408
|
-
/**
|
|
409
|
-
* Whether to run tool selection for this message.
|
|
410
|
-
* Defaults to true if tools are configured.
|
|
411
|
-
*/
|
|
412
|
-
runTools?: boolean;
|
|
413
|
-
};
|
|
414
|
-
type SendMessageResult = {
|
|
415
|
-
data: LlmapiChatCompletionResponse;
|
|
416
|
-
error: null;
|
|
417
|
-
toolExecution?: ToolExecutionResult;
|
|
418
|
-
} | {
|
|
419
|
-
data: null;
|
|
420
|
-
error: string;
|
|
421
|
-
toolExecution?: ToolExecutionResult;
|
|
422
411
|
};
|
|
423
|
-
|
|
412
|
+
/**
|
|
413
|
+
* Base options for useChat hook
|
|
414
|
+
*/
|
|
415
|
+
type BaseUseChatOptions = {
|
|
424
416
|
getToken?: () => Promise<string | null>;
|
|
425
417
|
baseUrl?: string;
|
|
426
418
|
/**
|
|
@@ -442,6 +434,39 @@ type UseChatOptions = {
|
|
|
442
434
|
* @param error - The error that occurred (never an AbortError)
|
|
443
435
|
*/
|
|
444
436
|
onError?: (error: Error) => void;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Base result type for useChat hook
|
|
440
|
+
*/
|
|
441
|
+
type BaseUseChatResult = {
|
|
442
|
+
isLoading: boolean;
|
|
443
|
+
/**
|
|
444
|
+
* Aborts the current streaming request if one is in progress.
|
|
445
|
+
*
|
|
446
|
+
* When a request is aborted, `sendMessage` will return with
|
|
447
|
+
* `{ data: null, error: "Request aborted" }`. The `onError` callback
|
|
448
|
+
* will NOT be called, as aborts are intentional actions, not errors.
|
|
449
|
+
*/
|
|
450
|
+
stop: () => void;
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
type SendMessageArgs = BaseSendMessageArgs & {
|
|
454
|
+
/**
|
|
455
|
+
* Whether to run tool selection for this message.
|
|
456
|
+
* Defaults to true if tools are configured.
|
|
457
|
+
*/
|
|
458
|
+
runTools?: boolean;
|
|
459
|
+
};
|
|
460
|
+
type SendMessageResult = {
|
|
461
|
+
data: LlmapiChatCompletionResponse;
|
|
462
|
+
error: null;
|
|
463
|
+
toolExecution?: ToolExecutionResult;
|
|
464
|
+
} | {
|
|
465
|
+
data: null;
|
|
466
|
+
error: string;
|
|
467
|
+
toolExecution?: ToolExecutionResult;
|
|
468
|
+
};
|
|
469
|
+
type UseChatOptions = BaseUseChatOptions & {
|
|
445
470
|
/**
|
|
446
471
|
* The provider to use for chat completions (default: "api")
|
|
447
472
|
* "local": Uses a local HuggingFace model (in-browser)
|
|
@@ -469,18 +494,9 @@ type UseChatOptions = {
|
|
|
469
494
|
*/
|
|
470
495
|
onToolExecution?: (result: ToolExecutionResult) => void;
|
|
471
496
|
};
|
|
472
|
-
type UseChatResult = {
|
|
473
|
-
isLoading: boolean;
|
|
497
|
+
type UseChatResult = BaseUseChatResult & {
|
|
474
498
|
isSelectingTool: boolean;
|
|
475
499
|
sendMessage: (args: SendMessageArgs) => Promise<SendMessageResult>;
|
|
476
|
-
/**
|
|
477
|
-
* Aborts the current streaming request if one is in progress.
|
|
478
|
-
*
|
|
479
|
-
* When a request is aborted, `sendMessage` will return with
|
|
480
|
-
* `{ data: null, error: "Request aborted" }`. The `onError` callback
|
|
481
|
-
* will NOT be called, as aborts are intentional actions, not errors.
|
|
482
|
-
*/
|
|
483
|
-
stop: () => void;
|
|
484
500
|
};
|
|
485
501
|
/**
|
|
486
502
|
* A React hook for managing chat completions with authentication.
|