@reverbia/sdk 1.0.0-next.20251202095402 → 1.0.0-next.20251202225102
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/index.cjs +26 -2
- package/dist/index.d.mts +260 -2
- package/dist/index.d.ts +260 -2
- package/dist/index.mjs +23 -1
- package/dist/react/index.cjs +130 -20
- package/dist/react/index.d.mts +152 -2
- package/dist/react/index.d.ts +152 -2
- package/dist/react/index.mjs +129 -20
- package/dist/vercel/index.cjs +1 -1
- package/dist/vercel/index.d.mts +25 -1
- package/dist/vercel/index.d.ts +25 -1
- package/dist/vercel/index.mjs +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -23,7 +23,9 @@ __export(index_exports, {
|
|
|
23
23
|
getApiV1Models: () => getApiV1Models,
|
|
24
24
|
getHealth: () => getHealth,
|
|
25
25
|
postApiV1ChatCompletions: () => postApiV1ChatCompletions,
|
|
26
|
-
postApiV1Embeddings: () => postApiV1Embeddings
|
|
26
|
+
postApiV1Embeddings: () => postApiV1Embeddings,
|
|
27
|
+
postApiV1ImagesGenerations: () => postApiV1ImagesGenerations,
|
|
28
|
+
postApiV1Search: () => postApiV1Search
|
|
27
29
|
});
|
|
28
30
|
module.exports = __toCommonJS(index_exports);
|
|
29
31
|
|
|
@@ -863,12 +865,32 @@ var postApiV1Embeddings = (options) => {
|
|
|
863
865
|
}
|
|
864
866
|
});
|
|
865
867
|
};
|
|
868
|
+
var postApiV1ImagesGenerations = (options) => {
|
|
869
|
+
return (options.client ?? client).post({
|
|
870
|
+
url: "/api/v1/images/generations",
|
|
871
|
+
...options,
|
|
872
|
+
headers: {
|
|
873
|
+
"Content-Type": "application/json",
|
|
874
|
+
...options.headers
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
};
|
|
866
878
|
var getApiV1Models = (options) => {
|
|
867
879
|
return (options?.client ?? client).get({
|
|
868
880
|
url: "/api/v1/models",
|
|
869
881
|
...options
|
|
870
882
|
});
|
|
871
883
|
};
|
|
884
|
+
var postApiV1Search = (options) => {
|
|
885
|
+
return (options.client ?? client).post({
|
|
886
|
+
url: "/api/v1/search",
|
|
887
|
+
...options,
|
|
888
|
+
headers: {
|
|
889
|
+
"Content-Type": "application/json",
|
|
890
|
+
...options.headers
|
|
891
|
+
}
|
|
892
|
+
});
|
|
893
|
+
};
|
|
872
894
|
var getHealth = (options) => {
|
|
873
895
|
return (options?.client ?? client).get({
|
|
874
896
|
url: "/health",
|
|
@@ -880,5 +902,7 @@ var getHealth = (options) => {
|
|
|
880
902
|
getApiV1Models,
|
|
881
903
|
getHealth,
|
|
882
904
|
postApiV1ChatCompletions,
|
|
883
|
-
postApiV1Embeddings
|
|
905
|
+
postApiV1Embeddings,
|
|
906
|
+
postApiV1ImagesGenerations,
|
|
907
|
+
postApiV1Search
|
|
884
908
|
});
|
package/dist/index.d.mts
CHANGED
|
@@ -188,6 +188,96 @@ type LlmapiEmbeddingUsage = {
|
|
|
188
188
|
*/
|
|
189
189
|
total_tokens?: number;
|
|
190
190
|
};
|
|
191
|
+
/**
|
|
192
|
+
* ExtraFields contains additional metadata such as provider/model information.
|
|
193
|
+
*/
|
|
194
|
+
type LlmapiImageGenerationExtraFields = {
|
|
195
|
+
/**
|
|
196
|
+
* ModelRequested is the model identifier that the client asked for.
|
|
197
|
+
*/
|
|
198
|
+
model_requested?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Provider is the gateway that serviced this request.
|
|
201
|
+
*/
|
|
202
|
+
provider?: string;
|
|
203
|
+
/**
|
|
204
|
+
* RequestType is always "image_generation".
|
|
205
|
+
*/
|
|
206
|
+
request_type?: string;
|
|
207
|
+
};
|
|
208
|
+
type LlmapiImageGenerationImage = {
|
|
209
|
+
/**
|
|
210
|
+
* B64JSON is the base64 payload for models that can only return binary.
|
|
211
|
+
*/
|
|
212
|
+
b64_json?: string;
|
|
213
|
+
/**
|
|
214
|
+
* URL is the signed URL to download the image.
|
|
215
|
+
*/
|
|
216
|
+
url?: string;
|
|
217
|
+
};
|
|
218
|
+
type LlmapiImageGenerationRequest = {
|
|
219
|
+
/**
|
|
220
|
+
* Model is the model identifier to use for generation (e.g., "gpt-image-1").
|
|
221
|
+
*/
|
|
222
|
+
model?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Prompt is the text description of the desired image.
|
|
225
|
+
*/
|
|
226
|
+
prompt?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Quality targets a quality preset (e.g., "auto", "high").
|
|
229
|
+
*/
|
|
230
|
+
quality?: string;
|
|
231
|
+
/**
|
|
232
|
+
* ResponseFormat controls how the generated image is returned (e.g., "url" or "b64_json").
|
|
233
|
+
*/
|
|
234
|
+
response_format?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Size controls the dimensions of the generated image (e.g., "1024x1024").
|
|
237
|
+
*/
|
|
238
|
+
size?: string;
|
|
239
|
+
};
|
|
240
|
+
type LlmapiImageGenerationResponse = {
|
|
241
|
+
/**
|
|
242
|
+
* Created is the Unix timestamp when the image was generated.
|
|
243
|
+
*/
|
|
244
|
+
created?: number;
|
|
245
|
+
extra_fields?: LlmapiImageGenerationExtraFields;
|
|
246
|
+
/**
|
|
247
|
+
* Images contains the generated images.
|
|
248
|
+
*/
|
|
249
|
+
images?: Array<LlmapiImageGenerationImage>;
|
|
250
|
+
/**
|
|
251
|
+
* Model is the model identifier that generated the image.
|
|
252
|
+
*/
|
|
253
|
+
model?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Provider is the gateway that produced the image.
|
|
256
|
+
*/
|
|
257
|
+
provider?: string;
|
|
258
|
+
usage?: LlmapiImageGenerationUsage;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Usage documents token usage (when available).
|
|
262
|
+
*/
|
|
263
|
+
type LlmapiImageGenerationUsage = {
|
|
264
|
+
/**
|
|
265
|
+
* CostMicroUSD is the inference cost for this image generation request
|
|
266
|
+
*/
|
|
267
|
+
cost_micro_usd?: number;
|
|
268
|
+
/**
|
|
269
|
+
* InputTokens is the number of tokens sent in the prompt.
|
|
270
|
+
*/
|
|
271
|
+
input_tokens?: number;
|
|
272
|
+
/**
|
|
273
|
+
* OutputTokens is the number of tokens returned by the model.
|
|
274
|
+
*/
|
|
275
|
+
output_tokens?: number;
|
|
276
|
+
/**
|
|
277
|
+
* TotalTokens is the total number of tokens consumed.
|
|
278
|
+
*/
|
|
279
|
+
total_tokens?: number;
|
|
280
|
+
};
|
|
191
281
|
/**
|
|
192
282
|
* Message is the generated message
|
|
193
283
|
*/
|
|
@@ -195,9 +285,33 @@ type LlmapiMessage = {
|
|
|
195
285
|
/**
|
|
196
286
|
* Content is the message content
|
|
197
287
|
*/
|
|
198
|
-
content?:
|
|
288
|
+
content?: Array<LlmapiMessageContentPart>;
|
|
199
289
|
role?: LlmapiRole;
|
|
200
290
|
};
|
|
291
|
+
/**
|
|
292
|
+
* ImageURL is used when Type=image_url
|
|
293
|
+
*/
|
|
294
|
+
type LlmapiMessageContentImage = {
|
|
295
|
+
/**
|
|
296
|
+
* Detail is the OpenAI detail hint (auto|low|high)
|
|
297
|
+
*/
|
|
298
|
+
detail?: string;
|
|
299
|
+
/**
|
|
300
|
+
* URL is the image URL or data URI
|
|
301
|
+
*/
|
|
302
|
+
url?: string;
|
|
303
|
+
};
|
|
304
|
+
type LlmapiMessageContentPart = {
|
|
305
|
+
image_url?: LlmapiMessageContentImage;
|
|
306
|
+
/**
|
|
307
|
+
* Text holds the text content when Type=text
|
|
308
|
+
*/
|
|
309
|
+
text?: string;
|
|
310
|
+
/**
|
|
311
|
+
* Type is the block type (`text` or `image_url`)
|
|
312
|
+
*/
|
|
313
|
+
type?: string;
|
|
314
|
+
};
|
|
201
315
|
type LlmapiModel = {
|
|
202
316
|
architecture?: LlmapiModelArchitecture;
|
|
203
317
|
/**
|
|
@@ -323,6 +437,80 @@ type LlmapiModelsListResponse = {
|
|
|
323
437
|
* Role is the message role (system, user, assistant)
|
|
324
438
|
*/
|
|
325
439
|
type LlmapiRole = string;
|
|
440
|
+
/**
|
|
441
|
+
* ExtraFields contains additional metadata.
|
|
442
|
+
*/
|
|
443
|
+
type LlmapiSearchExtraFields = {
|
|
444
|
+
/**
|
|
445
|
+
* RequestType is always "search".
|
|
446
|
+
*/
|
|
447
|
+
request_type?: string;
|
|
448
|
+
/**
|
|
449
|
+
* SearchProvider is the search provider used (e.g., "perplexity", "google-pse").
|
|
450
|
+
*/
|
|
451
|
+
search_provider?: string;
|
|
452
|
+
};
|
|
453
|
+
type LlmapiSearchRequest = {
|
|
454
|
+
/**
|
|
455
|
+
* Country code filter (e.g., "US", "GB", "DE").
|
|
456
|
+
*/
|
|
457
|
+
country?: string;
|
|
458
|
+
/**
|
|
459
|
+
* Maximum number of results to return (1-20). Default: 10.
|
|
460
|
+
*/
|
|
461
|
+
max_results?: number;
|
|
462
|
+
/**
|
|
463
|
+
* Maximum tokens per page to process. Default: 1024.
|
|
464
|
+
*/
|
|
465
|
+
max_tokens_per_page?: number;
|
|
466
|
+
/**
|
|
467
|
+
* Search query. Can be a single string or array of strings.
|
|
468
|
+
*/
|
|
469
|
+
query?: Array<string>;
|
|
470
|
+
/**
|
|
471
|
+
* List of domains to filter results (max 20 domains).
|
|
472
|
+
*/
|
|
473
|
+
search_domain_filter?: Array<string>;
|
|
474
|
+
/**
|
|
475
|
+
* The search provider to use.
|
|
476
|
+
*/
|
|
477
|
+
search_tool_name?: string;
|
|
478
|
+
};
|
|
479
|
+
type LlmapiSearchResponse = {
|
|
480
|
+
extra_fields?: LlmapiSearchExtraFields;
|
|
481
|
+
/**
|
|
482
|
+
* List of search results.
|
|
483
|
+
*/
|
|
484
|
+
results?: Array<LlmapiSearchResult>;
|
|
485
|
+
usage?: LlmapiSearchUsage;
|
|
486
|
+
};
|
|
487
|
+
type LlmapiSearchResult = {
|
|
488
|
+
/**
|
|
489
|
+
* Optional publication or last updated date.
|
|
490
|
+
*/
|
|
491
|
+
date?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Text snippet from the result.
|
|
494
|
+
*/
|
|
495
|
+
snippet?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Title of the search result.
|
|
498
|
+
*/
|
|
499
|
+
title?: string;
|
|
500
|
+
/**
|
|
501
|
+
* URL of the search result.
|
|
502
|
+
*/
|
|
503
|
+
url?: string;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Usage contains usage information.
|
|
507
|
+
*/
|
|
508
|
+
type LlmapiSearchUsage = {
|
|
509
|
+
/**
|
|
510
|
+
* CostMicroUSD is the cost of this search in micro-dollars (USD × 1,000,000).
|
|
511
|
+
*/
|
|
512
|
+
cost_micro_usd?: number;
|
|
513
|
+
};
|
|
326
514
|
type ResponseErrorResponse = {
|
|
327
515
|
error?: string;
|
|
328
516
|
};
|
|
@@ -380,6 +568,37 @@ type PostApiV1EmbeddingsResponses = {
|
|
|
380
568
|
200: LlmapiEmbeddingResponse;
|
|
381
569
|
};
|
|
382
570
|
type PostApiV1EmbeddingsResponse = PostApiV1EmbeddingsResponses[keyof PostApiV1EmbeddingsResponses];
|
|
571
|
+
type PostApiV1ImagesGenerationsData = {
|
|
572
|
+
/**
|
|
573
|
+
* Image generation request
|
|
574
|
+
*/
|
|
575
|
+
body: LlmapiImageGenerationRequest;
|
|
576
|
+
path?: never;
|
|
577
|
+
query?: never;
|
|
578
|
+
url: '/api/v1/images/generations';
|
|
579
|
+
};
|
|
580
|
+
type PostApiV1ImagesGenerationsErrors = {
|
|
581
|
+
/**
|
|
582
|
+
* Bad Request
|
|
583
|
+
*/
|
|
584
|
+
400: ResponseErrorResponse;
|
|
585
|
+
/**
|
|
586
|
+
* Internal Server Error
|
|
587
|
+
*/
|
|
588
|
+
500: ResponseErrorResponse;
|
|
589
|
+
/**
|
|
590
|
+
* Not Implemented
|
|
591
|
+
*/
|
|
592
|
+
501: ResponseErrorResponse;
|
|
593
|
+
};
|
|
594
|
+
type PostApiV1ImagesGenerationsError = PostApiV1ImagesGenerationsErrors[keyof PostApiV1ImagesGenerationsErrors];
|
|
595
|
+
type PostApiV1ImagesGenerationsResponses = {
|
|
596
|
+
/**
|
|
597
|
+
* OK
|
|
598
|
+
*/
|
|
599
|
+
200: LlmapiImageGenerationResponse;
|
|
600
|
+
};
|
|
601
|
+
type PostApiV1ImagesGenerationsResponse = PostApiV1ImagesGenerationsResponses[keyof PostApiV1ImagesGenerationsResponses];
|
|
383
602
|
type GetApiV1ModelsData = {
|
|
384
603
|
body?: never;
|
|
385
604
|
path?: never;
|
|
@@ -417,6 +636,33 @@ type GetApiV1ModelsResponses = {
|
|
|
417
636
|
200: LlmapiModelsListResponse;
|
|
418
637
|
};
|
|
419
638
|
type GetApiV1ModelsResponse = GetApiV1ModelsResponses[keyof GetApiV1ModelsResponses];
|
|
639
|
+
type PostApiV1SearchData = {
|
|
640
|
+
/**
|
|
641
|
+
* Search request
|
|
642
|
+
*/
|
|
643
|
+
body: LlmapiSearchRequest;
|
|
644
|
+
path?: never;
|
|
645
|
+
query?: never;
|
|
646
|
+
url: '/api/v1/search';
|
|
647
|
+
};
|
|
648
|
+
type PostApiV1SearchErrors = {
|
|
649
|
+
/**
|
|
650
|
+
* Bad Request
|
|
651
|
+
*/
|
|
652
|
+
400: ResponseErrorResponse;
|
|
653
|
+
/**
|
|
654
|
+
* Internal Server Error
|
|
655
|
+
*/
|
|
656
|
+
500: ResponseErrorResponse;
|
|
657
|
+
};
|
|
658
|
+
type PostApiV1SearchError = PostApiV1SearchErrors[keyof PostApiV1SearchErrors];
|
|
659
|
+
type PostApiV1SearchResponses = {
|
|
660
|
+
/**
|
|
661
|
+
* OK
|
|
662
|
+
*/
|
|
663
|
+
200: LlmapiSearchResponse;
|
|
664
|
+
};
|
|
665
|
+
type PostApiV1SearchResponse = PostApiV1SearchResponses[keyof PostApiV1SearchResponses];
|
|
420
666
|
type GetHealthData = {
|
|
421
667
|
body?: never;
|
|
422
668
|
path?: never;
|
|
@@ -752,12 +998,24 @@ declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(o
|
|
|
752
998
|
* Generates embeddings using the configured gateway.
|
|
753
999
|
*/
|
|
754
1000
|
declare const postApiV1Embeddings: <ThrowOnError extends boolean = false>(options: Options<PostApiV1EmbeddingsData, ThrowOnError>) => RequestResult<PostApiV1EmbeddingsResponses, PostApiV1EmbeddingsErrors, ThrowOnError>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Generate images
|
|
1003
|
+
*
|
|
1004
|
+
* Generates images using the configured LLM gateway.
|
|
1005
|
+
*/
|
|
1006
|
+
declare const postApiV1ImagesGenerations: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ImagesGenerationsData, ThrowOnError>) => RequestResult<PostApiV1ImagesGenerationsResponses, PostApiV1ImagesGenerationsErrors, ThrowOnError>;
|
|
755
1007
|
/**
|
|
756
1008
|
* List available models
|
|
757
1009
|
*
|
|
758
1010
|
* Returns a list of all available models from the configured gateway with optional filters.
|
|
759
1011
|
*/
|
|
760
1012
|
declare const getApiV1Models: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1ModelsData, ThrowOnError>) => RequestResult<GetApiV1ModelsResponses, GetApiV1ModelsErrors, ThrowOnError>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Create search
|
|
1015
|
+
*
|
|
1016
|
+
* Returns a list of ranked search results
|
|
1017
|
+
*/
|
|
1018
|
+
declare const postApiV1Search: <ThrowOnError extends boolean = false>(options: Options<PostApiV1SearchData, ThrowOnError>) => RequestResult<PostApiV1SearchResponses, PostApiV1SearchErrors, ThrowOnError>;
|
|
761
1019
|
/**
|
|
762
1020
|
* Health check
|
|
763
1021
|
*
|
|
@@ -765,4 +1023,4 @@ declare const getApiV1Models: <ThrowOnError extends boolean = false>(options?: O
|
|
|
765
1023
|
*/
|
|
766
1024
|
declare const getHealth: <ThrowOnError extends boolean = false>(options?: Options<GetHealthData, ThrowOnError>) => RequestResult<GetHealthResponses, GetHealthErrors, ThrowOnError>;
|
|
767
1025
|
|
|
768
|
-
export { type ClientOptions$1 as ClientOptions, type GetApiV1ModelsData, type GetApiV1ModelsError, type GetApiV1ModelsErrors, type GetApiV1ModelsResponse, type GetApiV1ModelsResponses, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionExtraFields, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChatCompletionUsage, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiMessage, type LlmapiModel, type LlmapiModelArchitecture, type LlmapiModelPerRequestLimits, type LlmapiModelPricing, type LlmapiModelTopProvider, type LlmapiModelsListExtraFields, type LlmapiModelsListResponse, type LlmapiRole, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type ResponseErrorResponse, getApiV1Models, getHealth, postApiV1ChatCompletions, postApiV1Embeddings };
|
|
1026
|
+
export { type ClientOptions$1 as ClientOptions, type GetApiV1ModelsData, type GetApiV1ModelsError, type GetApiV1ModelsErrors, type GetApiV1ModelsResponse, type GetApiV1ModelsResponses, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionExtraFields, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChatCompletionUsage, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiImageGenerationExtraFields, type LlmapiImageGenerationImage, type LlmapiImageGenerationRequest, type LlmapiImageGenerationResponse, type LlmapiImageGenerationUsage, type LlmapiMessage, type LlmapiMessageContentImage, type LlmapiMessageContentPart, type LlmapiModel, type LlmapiModelArchitecture, type LlmapiModelPerRequestLimits, type LlmapiModelPricing, type LlmapiModelTopProvider, type LlmapiModelsListExtraFields, type LlmapiModelsListResponse, type LlmapiRole, type LlmapiSearchExtraFields, type LlmapiSearchRequest, type LlmapiSearchResponse, type LlmapiSearchResult, type LlmapiSearchUsage, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type PostApiV1ImagesGenerationsData, type PostApiV1ImagesGenerationsError, type PostApiV1ImagesGenerationsErrors, type PostApiV1ImagesGenerationsResponse, type PostApiV1ImagesGenerationsResponses, type PostApiV1SearchData, type PostApiV1SearchError, type PostApiV1SearchErrors, type PostApiV1SearchResponse, type PostApiV1SearchResponses, type ResponseErrorResponse, getApiV1Models, getHealth, postApiV1ChatCompletions, postApiV1Embeddings, postApiV1ImagesGenerations, postApiV1Search };
|
package/dist/index.d.ts
CHANGED
|
@@ -188,6 +188,96 @@ type LlmapiEmbeddingUsage = {
|
|
|
188
188
|
*/
|
|
189
189
|
total_tokens?: number;
|
|
190
190
|
};
|
|
191
|
+
/**
|
|
192
|
+
* ExtraFields contains additional metadata such as provider/model information.
|
|
193
|
+
*/
|
|
194
|
+
type LlmapiImageGenerationExtraFields = {
|
|
195
|
+
/**
|
|
196
|
+
* ModelRequested is the model identifier that the client asked for.
|
|
197
|
+
*/
|
|
198
|
+
model_requested?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Provider is the gateway that serviced this request.
|
|
201
|
+
*/
|
|
202
|
+
provider?: string;
|
|
203
|
+
/**
|
|
204
|
+
* RequestType is always "image_generation".
|
|
205
|
+
*/
|
|
206
|
+
request_type?: string;
|
|
207
|
+
};
|
|
208
|
+
type LlmapiImageGenerationImage = {
|
|
209
|
+
/**
|
|
210
|
+
* B64JSON is the base64 payload for models that can only return binary.
|
|
211
|
+
*/
|
|
212
|
+
b64_json?: string;
|
|
213
|
+
/**
|
|
214
|
+
* URL is the signed URL to download the image.
|
|
215
|
+
*/
|
|
216
|
+
url?: string;
|
|
217
|
+
};
|
|
218
|
+
type LlmapiImageGenerationRequest = {
|
|
219
|
+
/**
|
|
220
|
+
* Model is the model identifier to use for generation (e.g., "gpt-image-1").
|
|
221
|
+
*/
|
|
222
|
+
model?: string;
|
|
223
|
+
/**
|
|
224
|
+
* Prompt is the text description of the desired image.
|
|
225
|
+
*/
|
|
226
|
+
prompt?: string;
|
|
227
|
+
/**
|
|
228
|
+
* Quality targets a quality preset (e.g., "auto", "high").
|
|
229
|
+
*/
|
|
230
|
+
quality?: string;
|
|
231
|
+
/**
|
|
232
|
+
* ResponseFormat controls how the generated image is returned (e.g., "url" or "b64_json").
|
|
233
|
+
*/
|
|
234
|
+
response_format?: string;
|
|
235
|
+
/**
|
|
236
|
+
* Size controls the dimensions of the generated image (e.g., "1024x1024").
|
|
237
|
+
*/
|
|
238
|
+
size?: string;
|
|
239
|
+
};
|
|
240
|
+
type LlmapiImageGenerationResponse = {
|
|
241
|
+
/**
|
|
242
|
+
* Created is the Unix timestamp when the image was generated.
|
|
243
|
+
*/
|
|
244
|
+
created?: number;
|
|
245
|
+
extra_fields?: LlmapiImageGenerationExtraFields;
|
|
246
|
+
/**
|
|
247
|
+
* Images contains the generated images.
|
|
248
|
+
*/
|
|
249
|
+
images?: Array<LlmapiImageGenerationImage>;
|
|
250
|
+
/**
|
|
251
|
+
* Model is the model identifier that generated the image.
|
|
252
|
+
*/
|
|
253
|
+
model?: string;
|
|
254
|
+
/**
|
|
255
|
+
* Provider is the gateway that produced the image.
|
|
256
|
+
*/
|
|
257
|
+
provider?: string;
|
|
258
|
+
usage?: LlmapiImageGenerationUsage;
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Usage documents token usage (when available).
|
|
262
|
+
*/
|
|
263
|
+
type LlmapiImageGenerationUsage = {
|
|
264
|
+
/**
|
|
265
|
+
* CostMicroUSD is the inference cost for this image generation request
|
|
266
|
+
*/
|
|
267
|
+
cost_micro_usd?: number;
|
|
268
|
+
/**
|
|
269
|
+
* InputTokens is the number of tokens sent in the prompt.
|
|
270
|
+
*/
|
|
271
|
+
input_tokens?: number;
|
|
272
|
+
/**
|
|
273
|
+
* OutputTokens is the number of tokens returned by the model.
|
|
274
|
+
*/
|
|
275
|
+
output_tokens?: number;
|
|
276
|
+
/**
|
|
277
|
+
* TotalTokens is the total number of tokens consumed.
|
|
278
|
+
*/
|
|
279
|
+
total_tokens?: number;
|
|
280
|
+
};
|
|
191
281
|
/**
|
|
192
282
|
* Message is the generated message
|
|
193
283
|
*/
|
|
@@ -195,9 +285,33 @@ type LlmapiMessage = {
|
|
|
195
285
|
/**
|
|
196
286
|
* Content is the message content
|
|
197
287
|
*/
|
|
198
|
-
content?:
|
|
288
|
+
content?: Array<LlmapiMessageContentPart>;
|
|
199
289
|
role?: LlmapiRole;
|
|
200
290
|
};
|
|
291
|
+
/**
|
|
292
|
+
* ImageURL is used when Type=image_url
|
|
293
|
+
*/
|
|
294
|
+
type LlmapiMessageContentImage = {
|
|
295
|
+
/**
|
|
296
|
+
* Detail is the OpenAI detail hint (auto|low|high)
|
|
297
|
+
*/
|
|
298
|
+
detail?: string;
|
|
299
|
+
/**
|
|
300
|
+
* URL is the image URL or data URI
|
|
301
|
+
*/
|
|
302
|
+
url?: string;
|
|
303
|
+
};
|
|
304
|
+
type LlmapiMessageContentPart = {
|
|
305
|
+
image_url?: LlmapiMessageContentImage;
|
|
306
|
+
/**
|
|
307
|
+
* Text holds the text content when Type=text
|
|
308
|
+
*/
|
|
309
|
+
text?: string;
|
|
310
|
+
/**
|
|
311
|
+
* Type is the block type (`text` or `image_url`)
|
|
312
|
+
*/
|
|
313
|
+
type?: string;
|
|
314
|
+
};
|
|
201
315
|
type LlmapiModel = {
|
|
202
316
|
architecture?: LlmapiModelArchitecture;
|
|
203
317
|
/**
|
|
@@ -323,6 +437,80 @@ type LlmapiModelsListResponse = {
|
|
|
323
437
|
* Role is the message role (system, user, assistant)
|
|
324
438
|
*/
|
|
325
439
|
type LlmapiRole = string;
|
|
440
|
+
/**
|
|
441
|
+
* ExtraFields contains additional metadata.
|
|
442
|
+
*/
|
|
443
|
+
type LlmapiSearchExtraFields = {
|
|
444
|
+
/**
|
|
445
|
+
* RequestType is always "search".
|
|
446
|
+
*/
|
|
447
|
+
request_type?: string;
|
|
448
|
+
/**
|
|
449
|
+
* SearchProvider is the search provider used (e.g., "perplexity", "google-pse").
|
|
450
|
+
*/
|
|
451
|
+
search_provider?: string;
|
|
452
|
+
};
|
|
453
|
+
type LlmapiSearchRequest = {
|
|
454
|
+
/**
|
|
455
|
+
* Country code filter (e.g., "US", "GB", "DE").
|
|
456
|
+
*/
|
|
457
|
+
country?: string;
|
|
458
|
+
/**
|
|
459
|
+
* Maximum number of results to return (1-20). Default: 10.
|
|
460
|
+
*/
|
|
461
|
+
max_results?: number;
|
|
462
|
+
/**
|
|
463
|
+
* Maximum tokens per page to process. Default: 1024.
|
|
464
|
+
*/
|
|
465
|
+
max_tokens_per_page?: number;
|
|
466
|
+
/**
|
|
467
|
+
* Search query. Can be a single string or array of strings.
|
|
468
|
+
*/
|
|
469
|
+
query?: Array<string>;
|
|
470
|
+
/**
|
|
471
|
+
* List of domains to filter results (max 20 domains).
|
|
472
|
+
*/
|
|
473
|
+
search_domain_filter?: Array<string>;
|
|
474
|
+
/**
|
|
475
|
+
* The search provider to use.
|
|
476
|
+
*/
|
|
477
|
+
search_tool_name?: string;
|
|
478
|
+
};
|
|
479
|
+
type LlmapiSearchResponse = {
|
|
480
|
+
extra_fields?: LlmapiSearchExtraFields;
|
|
481
|
+
/**
|
|
482
|
+
* List of search results.
|
|
483
|
+
*/
|
|
484
|
+
results?: Array<LlmapiSearchResult>;
|
|
485
|
+
usage?: LlmapiSearchUsage;
|
|
486
|
+
};
|
|
487
|
+
type LlmapiSearchResult = {
|
|
488
|
+
/**
|
|
489
|
+
* Optional publication or last updated date.
|
|
490
|
+
*/
|
|
491
|
+
date?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Text snippet from the result.
|
|
494
|
+
*/
|
|
495
|
+
snippet?: string;
|
|
496
|
+
/**
|
|
497
|
+
* Title of the search result.
|
|
498
|
+
*/
|
|
499
|
+
title?: string;
|
|
500
|
+
/**
|
|
501
|
+
* URL of the search result.
|
|
502
|
+
*/
|
|
503
|
+
url?: string;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Usage contains usage information.
|
|
507
|
+
*/
|
|
508
|
+
type LlmapiSearchUsage = {
|
|
509
|
+
/**
|
|
510
|
+
* CostMicroUSD is the cost of this search in micro-dollars (USD × 1,000,000).
|
|
511
|
+
*/
|
|
512
|
+
cost_micro_usd?: number;
|
|
513
|
+
};
|
|
326
514
|
type ResponseErrorResponse = {
|
|
327
515
|
error?: string;
|
|
328
516
|
};
|
|
@@ -380,6 +568,37 @@ type PostApiV1EmbeddingsResponses = {
|
|
|
380
568
|
200: LlmapiEmbeddingResponse;
|
|
381
569
|
};
|
|
382
570
|
type PostApiV1EmbeddingsResponse = PostApiV1EmbeddingsResponses[keyof PostApiV1EmbeddingsResponses];
|
|
571
|
+
type PostApiV1ImagesGenerationsData = {
|
|
572
|
+
/**
|
|
573
|
+
* Image generation request
|
|
574
|
+
*/
|
|
575
|
+
body: LlmapiImageGenerationRequest;
|
|
576
|
+
path?: never;
|
|
577
|
+
query?: never;
|
|
578
|
+
url: '/api/v1/images/generations';
|
|
579
|
+
};
|
|
580
|
+
type PostApiV1ImagesGenerationsErrors = {
|
|
581
|
+
/**
|
|
582
|
+
* Bad Request
|
|
583
|
+
*/
|
|
584
|
+
400: ResponseErrorResponse;
|
|
585
|
+
/**
|
|
586
|
+
* Internal Server Error
|
|
587
|
+
*/
|
|
588
|
+
500: ResponseErrorResponse;
|
|
589
|
+
/**
|
|
590
|
+
* Not Implemented
|
|
591
|
+
*/
|
|
592
|
+
501: ResponseErrorResponse;
|
|
593
|
+
};
|
|
594
|
+
type PostApiV1ImagesGenerationsError = PostApiV1ImagesGenerationsErrors[keyof PostApiV1ImagesGenerationsErrors];
|
|
595
|
+
type PostApiV1ImagesGenerationsResponses = {
|
|
596
|
+
/**
|
|
597
|
+
* OK
|
|
598
|
+
*/
|
|
599
|
+
200: LlmapiImageGenerationResponse;
|
|
600
|
+
};
|
|
601
|
+
type PostApiV1ImagesGenerationsResponse = PostApiV1ImagesGenerationsResponses[keyof PostApiV1ImagesGenerationsResponses];
|
|
383
602
|
type GetApiV1ModelsData = {
|
|
384
603
|
body?: never;
|
|
385
604
|
path?: never;
|
|
@@ -417,6 +636,33 @@ type GetApiV1ModelsResponses = {
|
|
|
417
636
|
200: LlmapiModelsListResponse;
|
|
418
637
|
};
|
|
419
638
|
type GetApiV1ModelsResponse = GetApiV1ModelsResponses[keyof GetApiV1ModelsResponses];
|
|
639
|
+
type PostApiV1SearchData = {
|
|
640
|
+
/**
|
|
641
|
+
* Search request
|
|
642
|
+
*/
|
|
643
|
+
body: LlmapiSearchRequest;
|
|
644
|
+
path?: never;
|
|
645
|
+
query?: never;
|
|
646
|
+
url: '/api/v1/search';
|
|
647
|
+
};
|
|
648
|
+
type PostApiV1SearchErrors = {
|
|
649
|
+
/**
|
|
650
|
+
* Bad Request
|
|
651
|
+
*/
|
|
652
|
+
400: ResponseErrorResponse;
|
|
653
|
+
/**
|
|
654
|
+
* Internal Server Error
|
|
655
|
+
*/
|
|
656
|
+
500: ResponseErrorResponse;
|
|
657
|
+
};
|
|
658
|
+
type PostApiV1SearchError = PostApiV1SearchErrors[keyof PostApiV1SearchErrors];
|
|
659
|
+
type PostApiV1SearchResponses = {
|
|
660
|
+
/**
|
|
661
|
+
* OK
|
|
662
|
+
*/
|
|
663
|
+
200: LlmapiSearchResponse;
|
|
664
|
+
};
|
|
665
|
+
type PostApiV1SearchResponse = PostApiV1SearchResponses[keyof PostApiV1SearchResponses];
|
|
420
666
|
type GetHealthData = {
|
|
421
667
|
body?: never;
|
|
422
668
|
path?: never;
|
|
@@ -752,12 +998,24 @@ declare const postApiV1ChatCompletions: <ThrowOnError extends boolean = false>(o
|
|
|
752
998
|
* Generates embeddings using the configured gateway.
|
|
753
999
|
*/
|
|
754
1000
|
declare const postApiV1Embeddings: <ThrowOnError extends boolean = false>(options: Options<PostApiV1EmbeddingsData, ThrowOnError>) => RequestResult<PostApiV1EmbeddingsResponses, PostApiV1EmbeddingsErrors, ThrowOnError>;
|
|
1001
|
+
/**
|
|
1002
|
+
* Generate images
|
|
1003
|
+
*
|
|
1004
|
+
* Generates images using the configured LLM gateway.
|
|
1005
|
+
*/
|
|
1006
|
+
declare const postApiV1ImagesGenerations: <ThrowOnError extends boolean = false>(options: Options<PostApiV1ImagesGenerationsData, ThrowOnError>) => RequestResult<PostApiV1ImagesGenerationsResponses, PostApiV1ImagesGenerationsErrors, ThrowOnError>;
|
|
755
1007
|
/**
|
|
756
1008
|
* List available models
|
|
757
1009
|
*
|
|
758
1010
|
* Returns a list of all available models from the configured gateway with optional filters.
|
|
759
1011
|
*/
|
|
760
1012
|
declare const getApiV1Models: <ThrowOnError extends boolean = false>(options?: Options<GetApiV1ModelsData, ThrowOnError>) => RequestResult<GetApiV1ModelsResponses, GetApiV1ModelsErrors, ThrowOnError>;
|
|
1013
|
+
/**
|
|
1014
|
+
* Create search
|
|
1015
|
+
*
|
|
1016
|
+
* Returns a list of ranked search results
|
|
1017
|
+
*/
|
|
1018
|
+
declare const postApiV1Search: <ThrowOnError extends boolean = false>(options: Options<PostApiV1SearchData, ThrowOnError>) => RequestResult<PostApiV1SearchResponses, PostApiV1SearchErrors, ThrowOnError>;
|
|
761
1019
|
/**
|
|
762
1020
|
* Health check
|
|
763
1021
|
*
|
|
@@ -765,4 +1023,4 @@ declare const getApiV1Models: <ThrowOnError extends boolean = false>(options?: O
|
|
|
765
1023
|
*/
|
|
766
1024
|
declare const getHealth: <ThrowOnError extends boolean = false>(options?: Options<GetHealthData, ThrowOnError>) => RequestResult<GetHealthResponses, GetHealthErrors, ThrowOnError>;
|
|
767
1025
|
|
|
768
|
-
export { type ClientOptions$1 as ClientOptions, type GetApiV1ModelsData, type GetApiV1ModelsError, type GetApiV1ModelsErrors, type GetApiV1ModelsResponse, type GetApiV1ModelsResponses, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionExtraFields, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChatCompletionUsage, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiMessage, type LlmapiModel, type LlmapiModelArchitecture, type LlmapiModelPerRequestLimits, type LlmapiModelPricing, type LlmapiModelTopProvider, type LlmapiModelsListExtraFields, type LlmapiModelsListResponse, type LlmapiRole, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type ResponseErrorResponse, getApiV1Models, getHealth, postApiV1ChatCompletions, postApiV1Embeddings };
|
|
1026
|
+
export { type ClientOptions$1 as ClientOptions, type GetApiV1ModelsData, type GetApiV1ModelsError, type GetApiV1ModelsErrors, type GetApiV1ModelsResponse, type GetApiV1ModelsResponses, type GetHealthData, type GetHealthError, type GetHealthErrors, type GetHealthResponse, type GetHealthResponses, type HandlersHealthResponse, type LlmapiChatCompletionExtraFields, type LlmapiChatCompletionRequest, type LlmapiChatCompletionResponse, type LlmapiChatCompletionUsage, type LlmapiChoice, type LlmapiEmbeddingData, type LlmapiEmbeddingExtraFields, type LlmapiEmbeddingRequest, type LlmapiEmbeddingResponse, type LlmapiEmbeddingUsage, type LlmapiImageGenerationExtraFields, type LlmapiImageGenerationImage, type LlmapiImageGenerationRequest, type LlmapiImageGenerationResponse, type LlmapiImageGenerationUsage, type LlmapiMessage, type LlmapiMessageContentImage, type LlmapiMessageContentPart, type LlmapiModel, type LlmapiModelArchitecture, type LlmapiModelPerRequestLimits, type LlmapiModelPricing, type LlmapiModelTopProvider, type LlmapiModelsListExtraFields, type LlmapiModelsListResponse, type LlmapiRole, type LlmapiSearchExtraFields, type LlmapiSearchRequest, type LlmapiSearchResponse, type LlmapiSearchResult, type LlmapiSearchUsage, type Options, type PostApiV1ChatCompletionsData, type PostApiV1ChatCompletionsError, type PostApiV1ChatCompletionsErrors, type PostApiV1ChatCompletionsResponse, type PostApiV1ChatCompletionsResponses, type PostApiV1EmbeddingsData, type PostApiV1EmbeddingsError, type PostApiV1EmbeddingsErrors, type PostApiV1EmbeddingsResponse, type PostApiV1EmbeddingsResponses, type PostApiV1ImagesGenerationsData, type PostApiV1ImagesGenerationsError, type PostApiV1ImagesGenerationsErrors, type PostApiV1ImagesGenerationsResponse, type PostApiV1ImagesGenerationsResponses, type PostApiV1SearchData, type PostApiV1SearchError, type PostApiV1SearchErrors, type PostApiV1SearchResponse, type PostApiV1SearchResponses, type ResponseErrorResponse, getApiV1Models, getHealth, postApiV1ChatCompletions, postApiV1Embeddings, postApiV1ImagesGenerations, postApiV1Search };
|