@reverbia/sdk 1.0.0-next.20251208162906 → 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.
@@ -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
  */
@@ -214,4 +304,40 @@ type UseChatResult = BaseUseChatResult & {
214
304
  */
215
305
  declare function useChat(options?: UseChatOptions): UseChatResult;
216
306
 
217
- export { useChat };
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 };
@@ -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
  */
@@ -214,4 +304,40 @@ type UseChatResult = BaseUseChatResult & {
214
304
  */
215
305
  declare function useChat(options?: UseChatOptions): UseChatResult;
216
306
 
217
- export { useChat };
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 };