react-brai 1.0.4 → 1.0.5

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.

Potentially problematic release.


This version of react-brai might be problematic. Click here for more details.

@@ -0,0 +1,30 @@
1
+ import { InitProgressReport } from '@mlc-ai/web-llm';
2
+ export { InitProgressReport } from '@mlc-ai/web-llm';
3
+
4
+ type ModelID = "Llama-3-8B-Instruct-q4f16_1-MLC" | "Gemma-2b-it-q4f16_1-MLC" | string;
5
+ interface Message {
6
+ role: "system" | "user" | "assistant";
7
+ content: string;
8
+ }
9
+ interface WorkerMessage {
10
+ type: "READY" | "PROGRESS" | "TOKEN" | "DONE" | "ERROR";
11
+ payload?: any;
12
+ }
13
+ interface WorkerPayload {
14
+ type: "LOAD" | "GENERATE";
15
+ modelId?: string;
16
+ messages?: Message[];
17
+ }
18
+
19
+ declare function useLocalAI(): {
20
+ isSupported: boolean | null;
21
+ loadModel: (modelId: string) => void;
22
+ chat: (messages: Message[]) => void;
23
+ isReady: boolean;
24
+ isLoading: boolean;
25
+ response: string;
26
+ progress: InitProgressReport | null;
27
+ error: string | null;
28
+ };
29
+
30
+ export { type Message, type ModelID, type WorkerMessage, type WorkerPayload, useLocalAI };
@@ -0,0 +1,30 @@
1
+ import { InitProgressReport } from '@mlc-ai/web-llm';
2
+ export { InitProgressReport } from '@mlc-ai/web-llm';
3
+
4
+ type ModelID = "Llama-3-8B-Instruct-q4f16_1-MLC" | "Gemma-2b-it-q4f16_1-MLC" | string;
5
+ interface Message {
6
+ role: "system" | "user" | "assistant";
7
+ content: string;
8
+ }
9
+ interface WorkerMessage {
10
+ type: "READY" | "PROGRESS" | "TOKEN" | "DONE" | "ERROR";
11
+ payload?: any;
12
+ }
13
+ interface WorkerPayload {
14
+ type: "LOAD" | "GENERATE";
15
+ modelId?: string;
16
+ messages?: Message[];
17
+ }
18
+
19
+ declare function useLocalAI(): {
20
+ isSupported: boolean | null;
21
+ loadModel: (modelId: string) => void;
22
+ chat: (messages: Message[]) => void;
23
+ isReady: boolean;
24
+ isLoading: boolean;
25
+ response: string;
26
+ progress: InitProgressReport | null;
27
+ error: string | null;
28
+ };
29
+
30
+ export { type Message, type ModelID, type WorkerMessage, type WorkerPayload, useLocalAI };