@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/expo/index.d.mts
CHANGED
|
@@ -67,6 +67,96 @@ type LlmapiChoice = {
|
|
|
67
67
|
index?: number;
|
|
68
68
|
message?: LlmapiMessage;
|
|
69
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* ExtraFields contains additional metadata such as provider/model information.
|
|
72
|
+
*/
|
|
73
|
+
type LlmapiImageGenerationExtraFields = {
|
|
74
|
+
/**
|
|
75
|
+
* ModelRequested is the model identifier that the client asked for.
|
|
76
|
+
*/
|
|
77
|
+
model_requested?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Provider is the gateway that serviced this request.
|
|
80
|
+
*/
|
|
81
|
+
provider?: string;
|
|
82
|
+
/**
|
|
83
|
+
* RequestType is always "image_generation".
|
|
84
|
+
*/
|
|
85
|
+
request_type?: string;
|
|
86
|
+
};
|
|
87
|
+
type LlmapiImageGenerationImage = {
|
|
88
|
+
/**
|
|
89
|
+
* B64JSON is the base64 payload for models that can only return binary.
|
|
90
|
+
*/
|
|
91
|
+
b64_json?: string;
|
|
92
|
+
/**
|
|
93
|
+
* URL is the signed URL to download the image.
|
|
94
|
+
*/
|
|
95
|
+
url?: string;
|
|
96
|
+
};
|
|
97
|
+
type LlmapiImageGenerationRequest = {
|
|
98
|
+
/**
|
|
99
|
+
* Model is the model identifier to use for generation (e.g., "gpt-image-1").
|
|
100
|
+
*/
|
|
101
|
+
model: string;
|
|
102
|
+
/**
|
|
103
|
+
* Prompt is the text description of the desired image.
|
|
104
|
+
*/
|
|
105
|
+
prompt: string;
|
|
106
|
+
/**
|
|
107
|
+
* Quality targets a quality preset (e.g., "auto", "high").
|
|
108
|
+
*/
|
|
109
|
+
quality?: string;
|
|
110
|
+
/**
|
|
111
|
+
* ResponseFormat controls how the generated image is returned (e.g., "url" or "b64_json").
|
|
112
|
+
*/
|
|
113
|
+
response_format?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Size controls the dimensions of the generated image (e.g., "1024x1024").
|
|
116
|
+
*/
|
|
117
|
+
size?: string;
|
|
118
|
+
};
|
|
119
|
+
type LlmapiImageGenerationResponse = {
|
|
120
|
+
/**
|
|
121
|
+
* Created is the Unix timestamp when the image was generated.
|
|
122
|
+
*/
|
|
123
|
+
created?: number;
|
|
124
|
+
extra_fields?: LlmapiImageGenerationExtraFields;
|
|
125
|
+
/**
|
|
126
|
+
* Images contains the generated images.
|
|
127
|
+
*/
|
|
128
|
+
images?: Array<LlmapiImageGenerationImage>;
|
|
129
|
+
/**
|
|
130
|
+
* Model is the model identifier that generated the image.
|
|
131
|
+
*/
|
|
132
|
+
model?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Provider is the gateway that produced the image.
|
|
135
|
+
*/
|
|
136
|
+
provider?: string;
|
|
137
|
+
usage?: LlmapiImageGenerationUsage;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Usage documents token usage (when available).
|
|
141
|
+
*/
|
|
142
|
+
type LlmapiImageGenerationUsage = {
|
|
143
|
+
/**
|
|
144
|
+
* CostMicroUSD is the inference cost for this image generation request
|
|
145
|
+
*/
|
|
146
|
+
cost_micro_usd?: number;
|
|
147
|
+
/**
|
|
148
|
+
* InputTokens is the number of tokens sent in the prompt.
|
|
149
|
+
*/
|
|
150
|
+
input_tokens?: number;
|
|
151
|
+
/**
|
|
152
|
+
* OutputTokens is the number of tokens returned by the model.
|
|
153
|
+
*/
|
|
154
|
+
output_tokens?: number;
|
|
155
|
+
/**
|
|
156
|
+
* TotalTokens is the total number of tokens consumed.
|
|
157
|
+
*/
|
|
158
|
+
total_tokens?: number;
|
|
159
|
+
};
|
|
70
160
|
/**
|
|
71
161
|
* Message is the generated message
|
|
72
162
|
*/
|
|
@@ -106,7 +196,10 @@ type LlmapiMessageContentPart = {
|
|
|
106
196
|
*/
|
|
107
197
|
type LlmapiRole = string;
|
|
108
198
|
|
|
109
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Base arguments for sending a message
|
|
201
|
+
*/
|
|
202
|
+
type BaseSendMessageArgs = {
|
|
110
203
|
messages: LlmapiMessage[];
|
|
111
204
|
model?: string;
|
|
112
205
|
/**
|
|
@@ -117,14 +210,20 @@ type SendMessageArgs = {
|
|
|
117
210
|
*/
|
|
118
211
|
onData?: (chunk: string) => void;
|
|
119
212
|
};
|
|
120
|
-
|
|
213
|
+
/**
|
|
214
|
+
* Base result type for sendMessage
|
|
215
|
+
*/
|
|
216
|
+
type BaseSendMessageResult = {
|
|
121
217
|
data: LlmapiChatCompletionResponse;
|
|
122
218
|
error: null;
|
|
123
219
|
} | {
|
|
124
220
|
data: null;
|
|
125
221
|
error: string;
|
|
126
222
|
};
|
|
127
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Base options for useChat hook
|
|
225
|
+
*/
|
|
226
|
+
type BaseUseChatOptions = {
|
|
128
227
|
getToken?: () => Promise<string | null>;
|
|
129
228
|
baseUrl?: string;
|
|
130
229
|
/**
|
|
@@ -147,9 +246,11 @@ type UseChatOptions = {
|
|
|
147
246
|
*/
|
|
148
247
|
onError?: (error: Error) => void;
|
|
149
248
|
};
|
|
150
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Base result type for useChat hook
|
|
251
|
+
*/
|
|
252
|
+
type BaseUseChatResult = {
|
|
151
253
|
isLoading: boolean;
|
|
152
|
-
sendMessage: (args: SendMessageArgs) => Promise<SendMessageResult>;
|
|
153
254
|
/**
|
|
154
255
|
* Aborts the current streaming request if one is in progress.
|
|
155
256
|
*
|
|
@@ -159,6 +260,13 @@ type UseChatResult = {
|
|
|
159
260
|
*/
|
|
160
261
|
stop: () => void;
|
|
161
262
|
};
|
|
263
|
+
|
|
264
|
+
type SendMessageArgs = BaseSendMessageArgs;
|
|
265
|
+
type SendMessageResult = BaseSendMessageResult;
|
|
266
|
+
type UseChatOptions = BaseUseChatOptions;
|
|
267
|
+
type UseChatResult = BaseUseChatResult & {
|
|
268
|
+
sendMessage: (args: SendMessageArgs) => Promise<SendMessageResult>;
|
|
269
|
+
};
|
|
162
270
|
/**
|
|
163
271
|
* A React hook for managing chat completions with authentication.
|
|
164
272
|
*
|
|
@@ -196,4 +304,40 @@ type UseChatResult = {
|
|
|
196
304
|
*/
|
|
197
305
|
declare function useChat(options?: UseChatOptions): UseChatResult;
|
|
198
306
|
|
|
199
|
-
|
|
307
|
+
type UseImageGenerationOptions = {
|
|
308
|
+
/**
|
|
309
|
+
* Custom function to get auth token for API calls
|
|
310
|
+
*/
|
|
311
|
+
getToken?: () => Promise<string | null>;
|
|
312
|
+
/**
|
|
313
|
+
* Optional base URL for the API requests.
|
|
314
|
+
*/
|
|
315
|
+
baseUrl?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Callback function to be called when the generation finishes successfully.
|
|
318
|
+
*/
|
|
319
|
+
onFinish?: (response: LlmapiImageGenerationResponse) => void;
|
|
320
|
+
/**
|
|
321
|
+
* Callback function to be called when an unexpected error is encountered.
|
|
322
|
+
*/
|
|
323
|
+
onError?: (error: Error) => void;
|
|
324
|
+
};
|
|
325
|
+
type GenerateImageArgs = LlmapiImageGenerationRequest;
|
|
326
|
+
type GenerateImageResult = {
|
|
327
|
+
data: LlmapiImageGenerationResponse;
|
|
328
|
+
error: null;
|
|
329
|
+
} | {
|
|
330
|
+
data: null;
|
|
331
|
+
error: string;
|
|
332
|
+
};
|
|
333
|
+
type UseImageGenerationResult = {
|
|
334
|
+
isLoading: boolean;
|
|
335
|
+
generateImage: (args: GenerateImageArgs) => Promise<GenerateImageResult>;
|
|
336
|
+
stop: () => void;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* React hook for generating images using the LLM API.
|
|
340
|
+
*/
|
|
341
|
+
declare function useImageGeneration(options?: UseImageGenerationOptions): UseImageGenerationResult;
|
|
342
|
+
|
|
343
|
+
export { useChat, useImageGeneration };
|
package/dist/expo/index.d.ts
CHANGED
|
@@ -67,6 +67,96 @@ type LlmapiChoice = {
|
|
|
67
67
|
index?: number;
|
|
68
68
|
message?: LlmapiMessage;
|
|
69
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* ExtraFields contains additional metadata such as provider/model information.
|
|
72
|
+
*/
|
|
73
|
+
type LlmapiImageGenerationExtraFields = {
|
|
74
|
+
/**
|
|
75
|
+
* ModelRequested is the model identifier that the client asked for.
|
|
76
|
+
*/
|
|
77
|
+
model_requested?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Provider is the gateway that serviced this request.
|
|
80
|
+
*/
|
|
81
|
+
provider?: string;
|
|
82
|
+
/**
|
|
83
|
+
* RequestType is always "image_generation".
|
|
84
|
+
*/
|
|
85
|
+
request_type?: string;
|
|
86
|
+
};
|
|
87
|
+
type LlmapiImageGenerationImage = {
|
|
88
|
+
/**
|
|
89
|
+
* B64JSON is the base64 payload for models that can only return binary.
|
|
90
|
+
*/
|
|
91
|
+
b64_json?: string;
|
|
92
|
+
/**
|
|
93
|
+
* URL is the signed URL to download the image.
|
|
94
|
+
*/
|
|
95
|
+
url?: string;
|
|
96
|
+
};
|
|
97
|
+
type LlmapiImageGenerationRequest = {
|
|
98
|
+
/**
|
|
99
|
+
* Model is the model identifier to use for generation (e.g., "gpt-image-1").
|
|
100
|
+
*/
|
|
101
|
+
model: string;
|
|
102
|
+
/**
|
|
103
|
+
* Prompt is the text description of the desired image.
|
|
104
|
+
*/
|
|
105
|
+
prompt: string;
|
|
106
|
+
/**
|
|
107
|
+
* Quality targets a quality preset (e.g., "auto", "high").
|
|
108
|
+
*/
|
|
109
|
+
quality?: string;
|
|
110
|
+
/**
|
|
111
|
+
* ResponseFormat controls how the generated image is returned (e.g., "url" or "b64_json").
|
|
112
|
+
*/
|
|
113
|
+
response_format?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Size controls the dimensions of the generated image (e.g., "1024x1024").
|
|
116
|
+
*/
|
|
117
|
+
size?: string;
|
|
118
|
+
};
|
|
119
|
+
type LlmapiImageGenerationResponse = {
|
|
120
|
+
/**
|
|
121
|
+
* Created is the Unix timestamp when the image was generated.
|
|
122
|
+
*/
|
|
123
|
+
created?: number;
|
|
124
|
+
extra_fields?: LlmapiImageGenerationExtraFields;
|
|
125
|
+
/**
|
|
126
|
+
* Images contains the generated images.
|
|
127
|
+
*/
|
|
128
|
+
images?: Array<LlmapiImageGenerationImage>;
|
|
129
|
+
/**
|
|
130
|
+
* Model is the model identifier that generated the image.
|
|
131
|
+
*/
|
|
132
|
+
model?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Provider is the gateway that produced the image.
|
|
135
|
+
*/
|
|
136
|
+
provider?: string;
|
|
137
|
+
usage?: LlmapiImageGenerationUsage;
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Usage documents token usage (when available).
|
|
141
|
+
*/
|
|
142
|
+
type LlmapiImageGenerationUsage = {
|
|
143
|
+
/**
|
|
144
|
+
* CostMicroUSD is the inference cost for this image generation request
|
|
145
|
+
*/
|
|
146
|
+
cost_micro_usd?: number;
|
|
147
|
+
/**
|
|
148
|
+
* InputTokens is the number of tokens sent in the prompt.
|
|
149
|
+
*/
|
|
150
|
+
input_tokens?: number;
|
|
151
|
+
/**
|
|
152
|
+
* OutputTokens is the number of tokens returned by the model.
|
|
153
|
+
*/
|
|
154
|
+
output_tokens?: number;
|
|
155
|
+
/**
|
|
156
|
+
* TotalTokens is the total number of tokens consumed.
|
|
157
|
+
*/
|
|
158
|
+
total_tokens?: number;
|
|
159
|
+
};
|
|
70
160
|
/**
|
|
71
161
|
* Message is the generated message
|
|
72
162
|
*/
|
|
@@ -106,7 +196,10 @@ type LlmapiMessageContentPart = {
|
|
|
106
196
|
*/
|
|
107
197
|
type LlmapiRole = string;
|
|
108
198
|
|
|
109
|
-
|
|
199
|
+
/**
|
|
200
|
+
* Base arguments for sending a message
|
|
201
|
+
*/
|
|
202
|
+
type BaseSendMessageArgs = {
|
|
110
203
|
messages: LlmapiMessage[];
|
|
111
204
|
model?: string;
|
|
112
205
|
/**
|
|
@@ -117,14 +210,20 @@ type SendMessageArgs = {
|
|
|
117
210
|
*/
|
|
118
211
|
onData?: (chunk: string) => void;
|
|
119
212
|
};
|
|
120
|
-
|
|
213
|
+
/**
|
|
214
|
+
* Base result type for sendMessage
|
|
215
|
+
*/
|
|
216
|
+
type BaseSendMessageResult = {
|
|
121
217
|
data: LlmapiChatCompletionResponse;
|
|
122
218
|
error: null;
|
|
123
219
|
} | {
|
|
124
220
|
data: null;
|
|
125
221
|
error: string;
|
|
126
222
|
};
|
|
127
|
-
|
|
223
|
+
/**
|
|
224
|
+
* Base options for useChat hook
|
|
225
|
+
*/
|
|
226
|
+
type BaseUseChatOptions = {
|
|
128
227
|
getToken?: () => Promise<string | null>;
|
|
129
228
|
baseUrl?: string;
|
|
130
229
|
/**
|
|
@@ -147,9 +246,11 @@ type UseChatOptions = {
|
|
|
147
246
|
*/
|
|
148
247
|
onError?: (error: Error) => void;
|
|
149
248
|
};
|
|
150
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Base result type for useChat hook
|
|
251
|
+
*/
|
|
252
|
+
type BaseUseChatResult = {
|
|
151
253
|
isLoading: boolean;
|
|
152
|
-
sendMessage: (args: SendMessageArgs) => Promise<SendMessageResult>;
|
|
153
254
|
/**
|
|
154
255
|
* Aborts the current streaming request if one is in progress.
|
|
155
256
|
*
|
|
@@ -159,6 +260,13 @@ type UseChatResult = {
|
|
|
159
260
|
*/
|
|
160
261
|
stop: () => void;
|
|
161
262
|
};
|
|
263
|
+
|
|
264
|
+
type SendMessageArgs = BaseSendMessageArgs;
|
|
265
|
+
type SendMessageResult = BaseSendMessageResult;
|
|
266
|
+
type UseChatOptions = BaseUseChatOptions;
|
|
267
|
+
type UseChatResult = BaseUseChatResult & {
|
|
268
|
+
sendMessage: (args: SendMessageArgs) => Promise<SendMessageResult>;
|
|
269
|
+
};
|
|
162
270
|
/**
|
|
163
271
|
* A React hook for managing chat completions with authentication.
|
|
164
272
|
*
|
|
@@ -196,4 +304,40 @@ type UseChatResult = {
|
|
|
196
304
|
*/
|
|
197
305
|
declare function useChat(options?: UseChatOptions): UseChatResult;
|
|
198
306
|
|
|
199
|
-
|
|
307
|
+
type UseImageGenerationOptions = {
|
|
308
|
+
/**
|
|
309
|
+
* Custom function to get auth token for API calls
|
|
310
|
+
*/
|
|
311
|
+
getToken?: () => Promise<string | null>;
|
|
312
|
+
/**
|
|
313
|
+
* Optional base URL for the API requests.
|
|
314
|
+
*/
|
|
315
|
+
baseUrl?: string;
|
|
316
|
+
/**
|
|
317
|
+
* Callback function to be called when the generation finishes successfully.
|
|
318
|
+
*/
|
|
319
|
+
onFinish?: (response: LlmapiImageGenerationResponse) => void;
|
|
320
|
+
/**
|
|
321
|
+
* Callback function to be called when an unexpected error is encountered.
|
|
322
|
+
*/
|
|
323
|
+
onError?: (error: Error) => void;
|
|
324
|
+
};
|
|
325
|
+
type GenerateImageArgs = LlmapiImageGenerationRequest;
|
|
326
|
+
type GenerateImageResult = {
|
|
327
|
+
data: LlmapiImageGenerationResponse;
|
|
328
|
+
error: null;
|
|
329
|
+
} | {
|
|
330
|
+
data: null;
|
|
331
|
+
error: string;
|
|
332
|
+
};
|
|
333
|
+
type UseImageGenerationResult = {
|
|
334
|
+
isLoading: boolean;
|
|
335
|
+
generateImage: (args: GenerateImageArgs) => Promise<GenerateImageResult>;
|
|
336
|
+
stop: () => void;
|
|
337
|
+
};
|
|
338
|
+
/**
|
|
339
|
+
* React hook for generating images using the LLM API.
|
|
340
|
+
*/
|
|
341
|
+
declare function useImageGeneration(options?: UseImageGenerationOptions): UseImageGenerationResult;
|
|
342
|
+
|
|
343
|
+
export { useChat, useImageGeneration };
|