@xberg-io/liter-llm 2.0.1 → 2.0.3

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated by alef — DO NOT EDIT.
2
- // alef:hash:dcf86ef638e55c8ff83fc5348d3b0956f1df8e68e355d7ff816ee026e432cee1
2
+ // alef:hash:cc9a913abbd03a30283354585d62e51b3c0f62f9b464836dcc01d70a519f1bfc
3
3
  // To regenerate: alef generate
4
4
  // To verify freshness: alef verify
5
5
  /* eslint-disable */
@@ -89,7 +89,12 @@ export declare function completionCost(model: string, promptTokens: number, comp
89
89
  * when `prompt_tokens` is below every tier threshold) use the base rates
90
90
  * unchanged, matching the original flat-rate behaviour.
91
91
  */
92
- export declare function completionCostWithCache(model: string, promptTokens: number, cachedTokens: number, completionTokens: number): number | null;
92
+ export declare function completionCostWithCache(
93
+ model: string,
94
+ promptTokens: number,
95
+ cachedTokens: number,
96
+ completionTokens: number,
97
+ ): number | null;
93
98
 
94
99
  /**
95
100
  * Return the set of complex provider names.
@@ -133,7 +138,13 @@ export declare function countTokens(model: string, text: string): number;
133
138
  * @throws Returns `LiterLlmError` if the underlying HTTP client cannot be
134
139
  * constructed, or if the resolved provider configuration is invalid.
135
140
  */
136
- export declare function createClient(apiKey: string, baseUrl?: string | undefined | null, timeoutSecs?: number | undefined | null, maxRetries?: number | undefined | null, modelHint?: string | undefined | null): DefaultClient;
141
+ export declare function createClient(
142
+ apiKey: string,
143
+ baseUrl?: string | undefined | null,
144
+ timeoutSecs?: number | undefined | null,
145
+ maxRetries?: number | undefined | null,
146
+ modelHint?: string | undefined | null,
147
+ ): DefaultClient;
137
148
 
138
149
  /**
139
150
  * Create a new LLM client from a JSON string.
@@ -209,9 +220,7 @@ export declare function installCatalogOverlayFromStr(catalogJson: string): void;
209
220
  * Providers returning an array of typed parts (e.g. after an image-generation
210
221
  * or audio-synthesis request) deserialise into `AssistantContent.Parts(_)`.
211
222
  */
212
- export type AssistantContent =
213
- | string
214
- | Array<__AlefWireAssistantPart>
223
+ export type AssistantContent = string | Array<__AlefWireAssistantPart>;
215
224
 
216
225
  /** Assistant's response to a user message. */
217
226
  export interface AssistantMessage {
@@ -220,25 +229,25 @@ export interface AssistantMessage {
220
229
  *
221
230
  * `None` is valid when the model replies with tool calls only.
222
231
  */
223
- readonly content?: AssistantContent
232
+ readonly content?: AssistantContent;
224
233
  /** Optional name for the assistant. */
225
- readonly name?: string
234
+ readonly name?: string;
226
235
  /** Tool calls the model wants to execute, if any. */
227
- readonly toolCalls?: Array<ToolCall>
236
+ readonly toolCalls?: Array<ToolCall>;
228
237
  /**
229
238
  * Refusal reason, if the model declined to respond per safety policies.
230
239
  *
231
240
  * OpenAI's response schema requires this key to be present even when null,
232
241
  * so it is deliberately not `skip_serializing_if`.
233
242
  */
234
- readonly refusal?: string
243
+ readonly refusal?: string;
235
244
  /** Deprecated legacy function_call field; retained for API compatibility. */
236
- readonly functionCall?: FunctionCall
245
+ readonly functionCall?: FunctionCall;
237
246
  /**
238
247
  * Reasoning/thinking tokens returned by the provider, if any (e.g. DeepSeek R1, Qwen
239
248
  * `reasoning_content`, or Anthropic extended thinking).
240
249
  */
241
- readonly reasoningContent?: string
250
+ readonly reasoningContent?: string;
242
251
  }
243
252
 
244
253
  /**
@@ -248,10 +257,10 @@ export interface AssistantMessage {
248
257
  * parts-spec discriminator (`"type": "text"`, `"type": "output_image"`, …).
249
258
  */
250
259
  export type AssistantPart =
251
- | { type: 'text'; text: string }
252
- | { type: 'refusal'; refusal: string }
253
- | { type: 'output_image'; imageUrl: ImageUrl }
254
- | { type: 'output_audio'; audio: AudioContent }
260
+ | { type: "text"; text: string }
261
+ | { type: "refusal"; refusal: string }
262
+ | { type: "output_image"; imageUrl: ImageUrl }
263
+ | { type: "output_audio"; audio: AudioContent };
255
264
 
256
265
  /**
257
266
  * Audio content part for speech-capable models.
@@ -261,27 +270,24 @@ export type AssistantPart =
261
270
  */
262
271
  export interface AudioContent {
263
272
  /** Base64-encoded audio data. */
264
- readonly data?: string
273
+ readonly data?: string;
265
274
  /** Audio format (e.g., "wav", "mp3", "ogg"). */
266
- readonly format?: string
275
+ readonly format?: string;
267
276
  }
268
277
 
269
278
  /** Auth configuration block. */
270
279
  export interface AuthConfig {
271
280
  /** Auth scheme classification. */
272
- readonly authType: AuthType
281
+ readonly authType: AuthType;
273
282
  /**
274
283
  * Name of the environment variable that holds the API key (e.g. `"OPENAI_API_KEY"`).
275
284
  * Holds the variable name, never the secret value.
276
285
  */
277
- readonly envVar?: string
286
+ readonly envVar?: string;
278
287
  }
279
288
 
280
289
  /** How the API key is sent in the HTTP request. */
281
- export type AuthHeaderFormat =
282
- | { type: 'Bearer' }
283
- | { type: 'ApiKey'; apiKey: string }
284
- | { type: 'None' }
290
+ export type AuthHeaderFormat = { type: "Bearer" } | { type: "ApiKey"; apiKey: string } | { type: "None" };
285
291
 
286
292
  /** Auth scheme used by a provider. */
287
293
  export declare enum AuthType {
@@ -298,65 +304,65 @@ export declare enum AuthType {
298
304
  /** Query parameters for listing batches. */
299
305
  export interface BatchListQuery {
300
306
  /** Maximum number of results to return. Defaults to 20. */
301
- readonly limit?: number
307
+ readonly limit?: number;
302
308
  /** Pagination cursor: return results after this batch ID. */
303
- readonly after?: string
309
+ readonly after?: string;
304
310
  }
305
311
 
306
312
  /** Response from listing batches. */
307
313
  export interface BatchListResponse {
308
314
  /** Object type (always `"list"`). */
309
- readonly object?: string
315
+ readonly object?: string;
310
316
  /** List of batch objects. */
311
- readonly data?: Array<BatchObject>
317
+ readonly data?: Array<BatchObject>;
312
318
  /** Whether more results are available. */
313
- readonly hasMore?: boolean
319
+ readonly hasMore?: boolean;
314
320
  /** First batch ID in the result set (for pagination). */
315
- readonly firstId?: string
321
+ readonly firstId?: string;
316
322
  /** Last batch ID in the result set (for pagination). */
317
- readonly lastId?: string
323
+ readonly lastId?: string;
318
324
  }
319
325
 
320
326
  /** A batch job object. */
321
327
  export interface BatchObject {
322
328
  /** Unique batch ID. */
323
- readonly id?: string
329
+ readonly id?: string;
324
330
  /** Object type (always `"batch"`). */
325
- readonly object?: string
331
+ readonly object?: string;
326
332
  /** API endpoint (e.g., `"/v1/chat/completions"`). */
327
- readonly endpoint?: string
333
+ readonly endpoint?: string;
328
334
  /** ID of the input file. */
329
- readonly inputFileId?: string
335
+ readonly inputFileId?: string;
330
336
  /** Completion window (e.g., `"24h"`). */
331
- readonly completionWindow?: string
337
+ readonly completionWindow?: string;
332
338
  /** Current job status. */
333
- readonly status?: BatchStatus
339
+ readonly status?: BatchStatus;
334
340
  /** ID of the output file (present when completed). */
335
- readonly outputFileId?: string
341
+ readonly outputFileId?: string;
336
342
  /** ID of the error file (present if some requests failed). */
337
- readonly errorFileId?: string
343
+ readonly errorFileId?: string;
338
344
  /** Unix timestamp of batch creation. */
339
- readonly createdAt?: number
345
+ readonly createdAt?: number;
340
346
  /** Unix timestamp of completion (if completed). */
341
- readonly completedAt?: number
347
+ readonly completedAt?: number;
342
348
  /** Unix timestamp of failure (if failed). */
343
- readonly failedAt?: number
349
+ readonly failedAt?: number;
344
350
  /** Unix timestamp of expiration (if expired). */
345
- readonly expiredAt?: number
351
+ readonly expiredAt?: number;
346
352
  /** Request processing counts. */
347
- readonly requestCounts?: BatchRequestCounts
353
+ readonly requestCounts?: BatchRequestCounts;
348
354
  /** Metadata attached to the batch. */
349
- readonly metadata?: JsonValue
355
+ readonly metadata?: JsonValue;
350
356
  }
351
357
 
352
358
  /** Request processing counts for a batch. */
353
359
  export interface BatchRequestCounts {
354
360
  /** Total requests in the batch. */
355
- readonly total?: number
361
+ readonly total?: number;
356
362
  /** Completed requests. */
357
- readonly completed?: number
363
+ readonly completed?: number;
358
364
  /** Failed requests. */
359
- readonly failed?: number
365
+ readonly failed?: number;
360
366
  }
361
367
 
362
368
  /** Status of a batch job. */
@@ -392,43 +398,41 @@ export declare enum BatchStatus {
392
398
  */
393
399
  export interface BedrockConfig {
394
400
  /** AWS region (e.g. `"us-east-1"`). */
395
- readonly region?: string
401
+ readonly region?: string;
396
402
  /** Cross-region inference profile prefix (e.g. `"us"`). */
397
- readonly crossRegionPrefix?: string
403
+ readonly crossRegionPrefix?: string;
398
404
  /** Explicit AWS access key ID. */
399
- readonly accessKeyId?: string
405
+ readonly accessKeyId?: string;
400
406
  /** Explicit AWS secret access key. */
401
- readonly secretAccessKey?: string
407
+ readonly secretAccessKey?: string;
402
408
  /** Explicit AWS session token (temporary credentials). */
403
- readonly sessionToken?: string
409
+ readonly sessionToken?: string;
404
410
  }
405
411
 
406
412
  /** Configuration for budget enforcement. */
407
413
  export interface BudgetConfig {
408
414
  /** Maximum total spend across all models, in USD. `None` means unlimited. */
409
- readonly globalLimit?: number
415
+ readonly globalLimit?: number;
410
416
  /**
411
417
  * Per-model spending limits in USD. Models not listed here are only
412
418
  * constrained by `global_limit`.
413
419
  */
414
- readonly modelLimits?: Record<string, number>
420
+ readonly modelLimits?: Record<string, number>;
415
421
  /** Whether to reject requests or merely warn when a limit is exceeded. */
416
- readonly enforcement?: Enforcement
422
+ readonly enforcement?: Enforcement;
417
423
  }
418
424
 
419
425
  /** Storage backend for the response cache. */
420
- export type CacheBackend =
421
- | { type: 'memory' }
422
- | { type: 'open_dal'; scheme: string; config: Record<string, string> }
426
+ export type CacheBackend = { type: "memory" } | { type: "open_dal"; scheme: string; config: Record<string, string> };
423
427
 
424
428
  /** Configuration for the response cache. */
425
429
  export interface CacheConfig {
426
430
  /** Maximum number of cached entries. */
427
- readonly maxEntries?: number
431
+ readonly maxEntries?: number;
428
432
  /** Time-to-live for each cached entry. */
429
- readonly ttl?: number
433
+ readonly ttl?: number;
430
434
  /** Storage backend to use. */
431
- readonly backend?: CacheBackend
435
+ readonly backend?: CacheBackend;
432
436
  }
433
437
 
434
438
  /**
@@ -444,53 +448,53 @@ export interface CatalogRefreshConfig {
444
448
  * `Ok(``RefreshOutcome.Disabled``)` without touching the network,
445
449
  * the filesystem, or the overlay registry.
446
450
  */
447
- readonly enabled?: boolean
451
+ readonly enabled?: boolean;
448
452
  /**
449
453
  * Source URL to fetch `catalog.json` from. Must be `https`. Defaults to
450
454
  * `DEFAULT_CATALOG_URL`; configurable so self-hosted mirrors work.
451
455
  */
452
- readonly sourceUrl?: string
456
+ readonly sourceUrl?: string;
453
457
  /**
454
458
  * How long a cached `catalog.json` remains valid before a network
455
459
  * refetch is attempted, in seconds.
456
460
  */
457
- readonly ttlSeconds?: number
461
+ readonly ttlSeconds?: number;
458
462
  /**
459
463
  * Filesystem path for the on-disk cache. `None` uses a default path
460
464
  * under `std.env.temp_dir()`.
461
465
  */
462
- readonly cachePath?: string
466
+ readonly cachePath?: string;
463
467
  }
464
468
 
465
469
  /** A streamed chunk of a chat completion response. */
466
470
  export interface ChatCompletionChunk {
467
471
  /** Unique identifier for this stream. */
468
- readonly id?: string
472
+ readonly id?: string;
469
473
  /**
470
474
  * Always `"chat.completion.chunk"` from OpenAI-compatible APIs. Stored
471
475
  * as a plain `String` so non-standard provider values do not fail parsing.
472
476
  */
473
- readonly object?: string
477
+ readonly object?: string;
474
478
  /** Unix timestamp of chunk creation. */
475
- readonly created?: number
479
+ readonly created?: number;
476
480
  /** Model used to generate the chunk. */
477
- readonly model?: string
481
+ readonly model?: string;
478
482
  /** Streaming choices (delta updates). */
479
- readonly choices?: Array<StreamChoice>
483
+ readonly choices?: Array<StreamChoice>;
480
484
  /** Token usage (typically only in the final chunk). */
481
- readonly usage?: Usage
485
+ readonly usage?: Usage;
482
486
  /** Fingerprint of the system configuration (OpenAI-specific). */
483
- readonly systemFingerprint?: string
487
+ readonly systemFingerprint?: string;
484
488
  /** Service tier used (OpenAI-specific). */
485
- readonly serviceTier?: string
489
+ readonly serviceTier?: string;
486
490
  }
487
491
 
488
492
  /** Chat completion request (compatible with OpenAI and similar APIs). */
489
493
  export interface ChatCompletionRequest {
490
494
  /** Model ID (e.g., `"gpt-4o-mini"`, `"claude-3-5-sonnet"`). */
491
- readonly model?: string
495
+ readonly model?: string;
492
496
  /** Conversation history from oldest to newest. */
493
- readonly messages?: Array<Message>
497
+ readonly messages?: Array<Message>;
494
498
  /**
495
499
  * Sampling temperature. Higher increases randomness, lower is more deterministic.
496
500
  * Defaults to 1.0.
@@ -504,81 +508,81 @@ export interface ChatCompletionRequest {
504
508
  * value is forwarded and the provider decides. Consult the target provider's reference
505
509
  * rather than assuming `[0.0, 2.0]` is portable.
506
510
  */
507
- readonly temperature?: number
511
+ readonly temperature?: number;
508
512
  /**
509
513
  * Nucleus sampling parameter. Lower is more focused.
510
514
  *
511
515
  * Accepted ranges vary by provider (most document `[0.0, 1.0]`, but this is not
512
516
  * universal — check the target provider's own documentation for its exact bounds).
513
517
  */
514
- readonly topP?: number
518
+ readonly topP?: number;
515
519
  /** Number of chat completions to generate. Defaults to 1. */
516
- readonly n?: number
520
+ readonly n?: number;
517
521
  /**
518
522
  * Whether to stream the response.
519
523
  *
520
524
  * Managed by the client layer — do not set directly.
521
525
  */
522
- readonly stream?: boolean
526
+ readonly stream?: boolean;
523
527
  /** Stop sequence(s) that halt token generation. */
524
- readonly stop?: StopSequence
528
+ readonly stop?: StopSequence;
525
529
  /** Max output tokens. Different from max_completion_tokens in some providers. */
526
- readonly maxTokens?: number
530
+ readonly maxTokens?: number;
527
531
  /** Presence penalty in `[-2.0, 2.0]`. Positive discourages repeated topics. */
528
- readonly presencePenalty?: number
532
+ readonly presencePenalty?: number;
529
533
  /** Frequency penalty in `[-2.0, 2.0]`. Positive discourages repeated tokens. */
530
- readonly frequencyPenalty?: number
534
+ readonly frequencyPenalty?: number;
531
535
  /**
532
536
  * Token bias map. Uses `BTreeMap` (sorted keys) for deterministic
533
537
  * serialization order — important when hashing or signing requests.
534
538
  */
535
- readonly logitBias?: Record<string, number>
539
+ readonly logitBias?: Record<string, number>;
536
540
  /** User identifier for request tracking and abuse detection. */
537
- readonly user?: string
541
+ readonly user?: string;
538
542
  /** Tools the model can invoke. */
539
- readonly tools?: Array<ChatCompletionTool>
543
+ readonly tools?: Array<ChatCompletionTool>;
540
544
  /** Tool usage mode (auto, required, none, or specific tool). */
541
- readonly toolChoice?: ToolChoice
545
+ readonly toolChoice?: ToolChoice;
542
546
  /** Whether the model can call multiple tools in parallel. Defaults to true. */
543
- readonly parallelToolCalls?: boolean
547
+ readonly parallelToolCalls?: boolean;
544
548
  /** Output format constraint (text, JSON, JSON schema). */
545
- readonly responseFormat?: ResponseFormat
549
+ readonly responseFormat?: ResponseFormat;
546
550
  /** Streaming options (e.g., include_usage). */
547
- readonly streamOptions?: StreamOptions
551
+ readonly streamOptions?: StreamOptions;
548
552
  /** Random seed for reproducible outputs. Provider support varies. */
549
- readonly seed?: number
553
+ readonly seed?: number;
550
554
  /** Reasoning effort level (minimal, low, medium, high, max) for extended-thinking models. */
551
- readonly reasoningEffort?: ReasoningEffort
555
+ readonly reasoningEffort?: ReasoningEffort;
552
556
  /**
553
557
  * Output modalities to request from the model.
554
558
  *
555
559
  * For OpenAI audio models, pass `["text", "audio"]`. Vertex AI / Gemini
556
560
  * translates these to `generationConfig.responseModalities` (uppercase).
557
561
  */
558
- readonly modalities?: Array<Modality>
562
+ readonly modalities?: Array<Modality>;
559
563
  /** Whether to return log probabilities of the output tokens. */
560
- readonly logprobs?: boolean
564
+ readonly logprobs?: boolean;
561
565
  /**
562
566
  * Number of most-likely tokens to return log probabilities for, `0..=20`.
563
567
  * Requires `logprobs` to be `true`.
564
568
  */
565
- readonly topLogprobs?: number
569
+ readonly topLogprobs?: number;
566
570
  /**
567
571
  * Upper bound on generated tokens, including reasoning tokens.
568
572
  *
569
573
  * Supersedes `max_tokens` on OpenAI reasoning models, which reject
570
574
  * `max_tokens` outright.
571
575
  */
572
- readonly maxCompletionTokens?: number
576
+ readonly maxCompletionTokens?: number;
573
577
  /**
574
578
  * Latency tier to process the request under (e.g. `"auto"`, `"default"`,
575
579
  * `"flex"`).
576
580
  */
577
- readonly serviceTier?: string
581
+ readonly serviceTier?: string;
578
582
  /** Whether to store the completion for later retrieval by the provider. */
579
- readonly store?: boolean
583
+ readonly store?: boolean;
580
584
  /** Developer-defined tags attached to the completion. */
581
- readonly metadata?: Record<string, string>
585
+ readonly metadata?: Record<string, string>;
582
586
  /**
583
587
  * Predicted output, for latency reduction when much of the response is
584
588
  * known ahead of time.
@@ -586,61 +590,61 @@ export interface ChatCompletionRequest {
586
590
  * Untyped: the shape is provider-defined and still evolving, and the
587
591
  * value is forwarded verbatim.
588
592
  */
589
- readonly prediction?: JsonValue
593
+ readonly prediction?: JsonValue;
590
594
  /**
591
595
  * Audio output parameters, required when `modalities` includes `audio`.
592
596
  *
593
597
  * Untyped for the same reason as `prediction`.
594
598
  */
595
- readonly audio?: JsonValue
599
+ readonly audio?: JsonValue;
596
600
  /**
597
601
  * Web-search tool configuration for search-enabled models.
598
602
  *
599
603
  * Untyped for the same reason as `prediction`.
600
604
  */
601
- readonly webSearchOptions?: JsonValue
605
+ readonly webSearchOptions?: JsonValue;
602
606
  /**
603
607
  * Provider-specific extra parameters merged into the request body.
604
608
  * Use for guardrails, safety settings, grounding config, etc.
605
609
  */
606
- readonly extraBody?: JsonValue
610
+ readonly extraBody?: JsonValue;
607
611
  }
608
612
 
609
613
  /** Chat completion response from the API. */
610
614
  export interface ChatCompletionResponse {
611
615
  /** Unique identifier for this response. */
612
- readonly id?: string
616
+ readonly id?: string;
613
617
  /**
614
618
  * Always `"chat.completion"` from OpenAI-compatible APIs. Stored as a
615
619
  * plain `String` so non-standard provider values do not break deserialization.
616
620
  */
617
- readonly object?: string
621
+ readonly object?: string;
618
622
  /** Unix timestamp of response creation. */
619
- readonly created?: number
623
+ readonly created?: number;
620
624
  /** Model used to generate the response. */
621
- readonly model?: string
625
+ readonly model?: string;
622
626
  /** List of completion choices. */
623
- readonly choices?: Array<Choice>
627
+ readonly choices?: Array<Choice>;
624
628
  /** Token usage statistics. */
625
- readonly usage?: Usage
629
+ readonly usage?: Usage;
626
630
  /** Fingerprint of the system configuration (OpenAI-specific). */
627
- readonly systemFingerprint?: string
631
+ readonly systemFingerprint?: string;
628
632
  /** Service tier used (OpenAI-specific). */
629
- readonly serviceTier?: string
633
+ readonly serviceTier?: string;
630
634
  }
631
635
 
632
636
  /** A tool the model can invoke (currently, all tools are functions). */
633
637
  export interface ChatCompletionTool {
634
638
  /** Tool type (always "function" in OpenAI spec). */
635
- readonly toolType: ToolType
639
+ readonly toolType: ToolType;
636
640
  /** Function definition with name, description, and JSON schema parameters. */
637
- readonly function: FunctionDefinition
641
+ readonly function: FunctionDefinition;
638
642
  }
639
643
 
640
644
  /** A single completion choice. */
641
645
  export interface Choice {
642
646
  /** Index of this choice in the choices array. */
643
- readonly index?: number
647
+ readonly index?: number;
644
648
  /**
645
649
  * The assistant's message response.
646
650
  *
@@ -649,16 +653,16 @@ export interface Choice {
649
653
  * keyed on `role`, so a stored field would emit the key twice inside a
650
654
  * request. OpenAI's response schema requires it here.
651
655
  */
652
- readonly message?: AssistantMessage
656
+ readonly message?: AssistantMessage;
653
657
  /** Why the model stopped generating (stop, length, tool_calls, content_filter, etc.). */
654
- readonly finishReason?: FinishReason
658
+ readonly finishReason?: FinishReason;
655
659
  /**
656
660
  * Per-token log probabilities, when the request asked for them.
657
661
  *
658
662
  * Required by OpenAI's response schema as an always-present, nullable key,
659
663
  * so this is deliberately not `skip_serializing_if`.
660
664
  */
661
- readonly logprobs?: JsonValue
665
+ readonly logprobs?: JsonValue;
662
666
  }
663
667
 
664
668
  /**
@@ -679,7 +683,7 @@ export interface ChunkMiddleware {
679
683
  * - `Ok(None)` — drop this chunk silently.
680
684
  * - `Err(e)` — propagate as a stream error.
681
685
  */
682
- process(chunk?: ChatCompletionChunk | undefined | null): ChatCompletionChunk | null
686
+ process(chunk?: ChatCompletionChunk | undefined | null): ChatCompletionChunk | null;
683
687
  }
684
688
 
685
689
  /** Observable state of a circuit breaker. */
@@ -694,51 +698,51 @@ export declare enum CircuitState {
694
698
 
695
699
  /** A single content part in a user message — text, image, document, or audio. */
696
700
  export type ContentPart =
697
- | { type: 'text'; text: string }
698
- | { type: 'image_url'; imageUrl: ImageUrl }
699
- | { type: 'document'; document: DocumentContent }
700
- | { type: 'input_audio'; inputAudio: AudioContent }
701
+ | { type: "text"; text: string }
702
+ | { type: "image_url"; imageUrl: ImageUrl }
703
+ | { type: "document"; document: DocumentContent }
704
+ | { type: "input_audio"; inputAudio: AudioContent };
701
705
 
702
706
  /** Request to create a batch job. */
703
707
  export interface CreateBatchRequest {
704
708
  /** ID of the uploaded input file (JSONL format). */
705
- readonly inputFileId?: string
709
+ readonly inputFileId?: string;
706
710
  /** API endpoint (e.g., `"/v1/chat/completions"`). */
707
- readonly endpoint?: string
711
+ readonly endpoint?: string;
708
712
  /** Completion window (e.g., `"24h"`). */
709
- readonly completionWindow?: string
713
+ readonly completionWindow?: string;
710
714
  /** Optional metadata to attach to the batch. */
711
- readonly metadata?: JsonValue
715
+ readonly metadata?: JsonValue;
712
716
  }
713
717
 
714
718
  /** Request to upload a file. */
715
719
  export interface CreateFileRequest {
716
720
  /** Base64-encoded file data. */
717
- readonly file?: string
721
+ readonly file?: string;
718
722
  /** Purpose for the file. */
719
- readonly purpose?: FilePurpose
723
+ readonly purpose?: FilePurpose;
720
724
  /** Optional filename to associate with the upload. */
721
- readonly filename?: string
725
+ readonly filename?: string;
722
726
  }
723
727
 
724
728
  /** Request to create images from a text prompt. */
725
729
  export interface CreateImageRequest {
726
730
  /** Text description of the image to generate. */
727
- readonly prompt?: string
731
+ readonly prompt?: string;
728
732
  /** Model ID (e.g., `"dall-e-3"`). Optional; API may use default if unset. */
729
- readonly model?: string
733
+ readonly model?: string;
730
734
  /** Number of images to generate. Defaults to 1. */
731
- readonly n?: number
735
+ readonly n?: number;
732
736
  /** Image size (e.g., `"1024x1024"`, `"1792x1024"`). */
733
- readonly size?: string
737
+ readonly size?: string;
734
738
  /** Image quality: `"standard"` or `"hd"`. */
735
- readonly quality?: string
739
+ readonly quality?: string;
736
740
  /** Style: `"natural"` or `"vivid"` (DALL-E 3 only). */
737
- readonly style?: string
741
+ readonly style?: string;
738
742
  /** Response format: `"url"` or `"b64_json"`. */
739
- readonly responseFormat?: string
743
+ readonly responseFormat?: string;
740
744
  /** User identifier for request tracking. */
741
- readonly user?: string
745
+ readonly user?: string;
742
746
  }
743
747
 
744
748
  /**
@@ -770,19 +774,19 @@ export interface CreateResponseRequest {
770
774
  * stripped and does **not** re-route the request, which stays pinned to the
771
775
  * provider the client was constructed with.
772
776
  */
773
- readonly model?: string
777
+ readonly model?: string;
774
778
  /** Input data to process (e.g., a document to extract from). */
775
- readonly input?: JsonValue
779
+ readonly input?: JsonValue;
776
780
  /** Instructions for processing the input. */
777
- readonly instructions?: string
781
+ readonly instructions?: string;
778
782
  /** Available tools the model can use. */
779
- readonly tools?: Array<ResponseTool>
783
+ readonly tools?: Array<ResponseTool>;
780
784
  /** Sampling temperature in `[0.0, 2.0]`. Defaults to 1.0. */
781
- readonly temperature?: number
785
+ readonly temperature?: number;
782
786
  /** Maximum output tokens. */
783
- readonly maxOutputTokens?: number
787
+ readonly maxOutputTokens?: number;
784
788
  /** Optional metadata. */
785
- readonly metadata?: JsonValue
789
+ readonly metadata?: JsonValue;
786
790
  /**
787
791
  * Extra top-level parameters shallow-merged into the request body, OpenAI-Python
788
792
  * style (`{**body, **extra_body}`) — keys here override identically named fields
@@ -797,55 +801,55 @@ export interface CreateResponseRequest {
797
801
  * A non-object value cannot be merged into the body root and is dropped with a
798
802
  * warning rather than sent.
799
803
  */
800
- readonly extraBody?: JsonValue
804
+ readonly extraBody?: JsonValue;
801
805
  /**
802
806
  * Whether to stream the response.
803
807
  *
804
808
  * Managed by the client layer — do not set directly.
805
809
  */
806
- readonly stream?: boolean
810
+ readonly stream?: boolean;
807
811
  }
808
812
 
809
813
  /** Request to generate speech audio from text. */
810
814
  export interface CreateSpeechRequest {
811
815
  /** Model ID (e.g., `"tts-1"`, `"tts-1-hd"`). */
812
- readonly model?: string
816
+ readonly model?: string;
813
817
  /** Text to synthesize into speech. */
814
- readonly input?: string
818
+ readonly input?: string;
815
819
  /** Voice name (e.g., `"alloy"`, `"echo"`, `"fable"`, `"onyx"`, `"nova"`, `"shimmer"`). */
816
- readonly voice?: string
820
+ readonly voice?: string;
817
821
  /** Audio format (e.g., `"mp3"`, `"opus"`, `"aac"`, `"flac"`, `"wav"`, `"pcm"`). */
818
- readonly responseFormat?: string
822
+ readonly responseFormat?: string;
819
823
  /** Playback speed in `[0.25, 4.0]`. Defaults to 1.0. */
820
- readonly speed?: number
824
+ readonly speed?: number;
821
825
  }
822
826
 
823
827
  /** Request to transcribe audio into text. */
824
828
  export interface CreateTranscriptionRequest {
825
829
  /** Model ID (e.g., `"whisper-1"`). */
826
- readonly model?: string
830
+ readonly model?: string;
827
831
  /** Base64-encoded audio file data. */
828
- readonly file?: string
832
+ readonly file?: string;
829
833
  /** Language ISO-639-1 code (e.g., `"en"`, `"fr"`, `"de"`). Optional; model auto-detects. */
830
- readonly language?: string
834
+ readonly language?: string;
831
835
  /** Optional text to guide the model (improves accuracy for domain-specific terms). */
832
- readonly prompt?: string
836
+ readonly prompt?: string;
833
837
  /** Output format (e.g., `"json"`, `"text"`, `"vtt"`, `"srt"`, `"verbose_json"`). */
834
- readonly responseFormat?: string
838
+ readonly responseFormat?: string;
835
839
  /** Sampling temperature in `[0.0, 1.0]`. Higher increases variability. Defaults to 0. */
836
- readonly temperature?: number
840
+ readonly temperature?: number;
837
841
  }
838
842
 
839
843
  /** Configuration for registering a custom LLM provider at runtime. */
840
844
  export interface CustomProviderConfig {
841
845
  /** Unique name for this provider (e.g., "my-provider"). */
842
- readonly name: string
846
+ readonly name: string;
843
847
  /** Base URL for the provider's API (e.g., `<https://api.my-provider.com/v1>`). */
844
- readonly baseUrl: string
848
+ readonly baseUrl: string;
845
849
  /** Authentication header format. */
846
- readonly authHeader: AuthHeaderFormat
850
+ readonly authHeader: AuthHeaderFormat;
847
851
  /** Model name prefixes that route to this provider (e.g., `["my-"]`). */
848
- readonly modelPrefixes: Array<string>
852
+ readonly modelPrefixes: Array<string>;
849
853
  }
850
854
 
851
855
  /**
@@ -856,9 +860,9 @@ export interface CustomProviderConfig {
856
860
  */
857
861
  export interface DecodedDataUrl {
858
862
  /** MIME type extracted from the URL prefix (verbatim, not normalised). */
859
- readonly mime?: string
863
+ readonly mime?: string;
860
864
  /** Decoded base64 payload. */
861
- readonly data?: Uint8Array
865
+ readonly data?: Uint8Array;
862
866
  }
863
867
 
864
868
  /**
@@ -879,27 +883,29 @@ export interface DecodedDataUrl {
879
883
  * headers are cached at construction to avoid redundant encoding on every request.
880
884
  */
881
885
  export declare class DefaultClient {
882
- chat(req?: ChatCompletionRequest | undefined | null): Promise<ChatCompletionResponse>
883
- chatStream(req?: ChatCompletionRequest | undefined | null): Promise<AsyncGenerator<ChatCompletionChunk, void, undefined>>
884
- embed(req?: EmbeddingRequest | undefined | null): Promise<EmbeddingResponse>
885
- listModels(): Promise<ModelsListResponse>
886
- imageGenerate(req?: CreateImageRequest | undefined | null): Promise<ImagesResponse>
887
- speech(req?: CreateSpeechRequest | undefined | null): Promise<Uint8Array>
888
- transcribe(req?: CreateTranscriptionRequest | undefined | null): Promise<TranscriptionResponse>
889
- moderate(req?: ModerationRequest | undefined | null): Promise<ModerationResponse>
890
- rerank(req?: RerankRequest | undefined | null): Promise<RerankResponse>
891
- search(req?: SearchRequest | undefined | null): Promise<SearchResponse>
892
- ocr(req?: OcrRequest | undefined | null): Promise<OcrResponse>
893
- createFile(req?: CreateFileRequest | undefined | null): Promise<FileObject>
894
- retrieveFile(fileId: string): Promise<FileObject>
895
- deleteFile(fileId: string): Promise<DeleteResponse>
896
- listFiles(query?: FileListQuery | undefined | null): Promise<FileListResponse>
897
- fileContent(fileId: string): Promise<Uint8Array>
898
- createBatch(req?: CreateBatchRequest | undefined | null): Promise<BatchObject>
899
- retrieveBatch(batchId: string): Promise<BatchObject>
900
- listBatches(query?: BatchListQuery | undefined | null): Promise<BatchListResponse>
901
- cancelBatch(batchId: string): Promise<BatchObject>
902
- fetchBatchForPolling(batchId: string): Promise<BatchObject>
886
+ chat(req?: ChatCompletionRequest | undefined | null): Promise<ChatCompletionResponse>;
887
+ chatStream(
888
+ req?: ChatCompletionRequest | undefined | null,
889
+ ): Promise<AsyncGenerator<ChatCompletionChunk, void, undefined>>;
890
+ embed(req?: EmbeddingRequest | undefined | null): Promise<EmbeddingResponse>;
891
+ listModels(): Promise<ModelsListResponse>;
892
+ imageGenerate(req?: CreateImageRequest | undefined | null): Promise<ImagesResponse>;
893
+ speech(req?: CreateSpeechRequest | undefined | null): Promise<Uint8Array>;
894
+ transcribe(req?: CreateTranscriptionRequest | undefined | null): Promise<TranscriptionResponse>;
895
+ moderate(req?: ModerationRequest | undefined | null): Promise<ModerationResponse>;
896
+ rerank(req?: RerankRequest | undefined | null): Promise<RerankResponse>;
897
+ search(req?: SearchRequest | undefined | null): Promise<SearchResponse>;
898
+ ocr(req?: OcrRequest | undefined | null): Promise<OcrResponse>;
899
+ createFile(req?: CreateFileRequest | undefined | null): Promise<FileObject>;
900
+ retrieveFile(fileId: string): Promise<FileObject>;
901
+ deleteFile(fileId: string): Promise<DeleteResponse>;
902
+ listFiles(query?: FileListQuery | undefined | null): Promise<FileListResponse>;
903
+ fileContent(fileId: string): Promise<Uint8Array>;
904
+ createBatch(req?: CreateBatchRequest | undefined | null): Promise<BatchObject>;
905
+ retrieveBatch(batchId: string): Promise<BatchObject>;
906
+ listBatches(query?: BatchListQuery | undefined | null): Promise<BatchListResponse>;
907
+ cancelBatch(batchId: string): Promise<BatchObject>;
908
+ fetchBatchForPolling(batchId: string): Promise<BatchObject>;
903
909
  /**
904
910
  * Poll a batch until it reaches a terminal status (Completed, Failed, Expired, Cancelled).
905
911
  *
@@ -909,43 +915,43 @@ export declare class DefaultClient {
909
915
  * Returns `BatchWaitError.Timeout` if the configured timeout is exceeded.
910
916
  * Returns `BatchWaitError.Client` for underlying client errors.
911
917
  */
912
- waitForBatch(batchId: string, config?: WaitForBatchConfig | undefined | null): Promise<BatchObject>
913
- createResponse(req?: CreateResponseRequest | undefined | null): Promise<ResponseObject>
914
- retrieveResponse(responseId: string): Promise<ResponseObject>
915
- cancelResponse(responseId: string): Promise<ResponseObject>
918
+ waitForBatch(batchId: string, config?: WaitForBatchConfig | undefined | null): Promise<BatchObject>;
919
+ createResponse(req?: CreateResponseRequest | undefined | null): Promise<ResponseObject>;
920
+ retrieveResponse(responseId: string): Promise<ResponseObject>;
921
+ cancelResponse(responseId: string): Promise<ResponseObject>;
916
922
  }
917
923
 
918
924
  /** Response from a delete operation. */
919
925
  export interface DeleteResponse {
920
926
  /** ID of the deleted resource. */
921
- readonly id?: string
927
+ readonly id?: string;
922
928
  /** Object type. */
923
- readonly object?: string
929
+ readonly object?: string;
924
930
  /** Confirmation that the resource was deleted. */
925
- readonly deleted?: boolean
931
+ readonly deleted?: boolean;
926
932
  }
927
933
 
928
934
  /** Developer message (system-like message for Claude models). */
929
935
  export interface DeveloperMessage {
930
936
  /** Developer-specific instructions or context. */
931
- readonly content?: string
937
+ readonly content?: string;
932
938
  /** Optional name for the developer message source. */
933
- readonly name?: string
939
+ readonly name?: string;
934
940
  }
935
941
 
936
942
  /** PDF/document content part for vision-capable models. */
937
943
  export interface DocumentContent {
938
944
  /** Base64-encoded document data or URL. */
939
- readonly data?: string
945
+ readonly data?: string;
940
946
  /** MIME type (e.g., "application/pdf", "text/csv"). */
941
- readonly mediaType?: string
947
+ readonly mediaType?: string;
942
948
  }
943
949
 
944
950
  /** A content part in a multimodal embedding input. */
945
951
  export type EmbeddingContentPart =
946
- | { type: 'text'; text: string }
947
- | { type: 'image_url'; imageUrl: ImageUrl }
948
- | { type: 'image_base64'; imageBase64: string }
952
+ | { type: "text"; text: string }
953
+ | { type: "image_url"; imageUrl: ImageUrl }
954
+ | { type: "image_base64"; imageBase64: string };
949
955
 
950
956
  /** The format in which the embedding vectors are returned. */
951
957
  export declare enum EmbeddingFormat {
@@ -956,10 +962,7 @@ export declare enum EmbeddingFormat {
956
962
  }
957
963
 
958
964
  /** Text, texts, or multimodal content to embed. */
959
- export type EmbeddingInput =
960
- | string
961
- | Array<string>
962
- | Array<__AlefWireEmbeddingContentPart>
965
+ export type EmbeddingInput = string | Array<string> | Array<__AlefWireEmbeddingContentPart>;
963
966
 
964
967
  /** A single embedding vector. */
965
968
  export interface EmbeddingObject {
@@ -967,7 +970,7 @@ export interface EmbeddingObject {
967
970
  * Always `"embedding"` from OpenAI-compatible APIs. Stored as a plain
968
971
  * `String` so non-standard provider values do not break deserialization.
969
972
  */
970
- readonly object: string
973
+ readonly object: string;
971
974
  /**
972
975
  * The embedding vector.
973
976
  *
@@ -976,23 +979,23 @@ export interface EmbeddingObject {
976
979
  * little-endian `f32` bytes. Base64 responses are decoded on read; this
977
980
  * field always serializes back out as a JSON float array.
978
981
  */
979
- readonly embedding: Array<number>
982
+ readonly embedding: Array<number>;
980
983
  /** Index in the batch (corresponds to input order). */
981
- readonly index: number
984
+ readonly index: number;
982
985
  }
983
986
 
984
987
  /** Embedding request. */
985
988
  export interface EmbeddingRequest {
986
989
  /** Model ID (e.g., `"text-embedding-3-small"`). */
987
- readonly model?: string
990
+ readonly model?: string;
988
991
  /** Text, texts, or multimodal content to embed. */
989
- readonly input?: EmbeddingInput
992
+ readonly input?: EmbeddingInput;
990
993
  /** Output format: float (native) or base64. */
991
- readonly encodingFormat?: EmbeddingFormat
994
+ readonly encodingFormat?: EmbeddingFormat;
992
995
  /** Requested embedding dimensions (if supported by the model). */
993
- readonly dimensions?: number
996
+ readonly dimensions?: number;
994
997
  /** User identifier for request tracking. */
995
- readonly user?: string
998
+ readonly user?: string;
996
999
  }
997
1000
 
998
1001
  /** Embedding response. */
@@ -1001,13 +1004,13 @@ export interface EmbeddingResponse {
1001
1004
  * Always `"list"` from OpenAI-compatible APIs. Stored as a plain
1002
1005
  * `String` so non-standard provider values do not break deserialization.
1003
1006
  */
1004
- readonly object: string
1007
+ readonly object: string;
1005
1008
  /** List of embeddings. */
1006
- readonly data: Array<EmbeddingObject>
1009
+ readonly data: Array<EmbeddingObject>;
1007
1010
  /** Model used to generate embeddings. */
1008
- readonly model: string
1011
+ readonly model: string;
1009
1012
  /** Token usage (input tokens only; embeddings have zero output tokens). */
1010
- readonly usage?: Usage
1013
+ readonly usage?: Usage;
1011
1014
  }
1012
1015
 
1013
1016
  /** How budget limits are enforced. */
@@ -1027,39 +1030,39 @@ export declare enum Enforcement {
1027
1030
  /** Query parameters for listing files. */
1028
1031
  export interface FileListQuery {
1029
1032
  /** Filter by file purpose (e.g., `"batch"`, `"fine-tune"`). */
1030
- readonly purpose?: string
1033
+ readonly purpose?: string;
1031
1034
  /** Maximum number of results to return. Defaults to 20. */
1032
- readonly limit?: number
1035
+ readonly limit?: number;
1033
1036
  /** Pagination cursor: return results after this file ID. */
1034
- readonly after?: string
1037
+ readonly after?: string;
1035
1038
  }
1036
1039
 
1037
1040
  /** Response from listing files. */
1038
1041
  export interface FileListResponse {
1039
1042
  /** Object type (always `"list"`). */
1040
- readonly object?: string
1043
+ readonly object?: string;
1041
1044
  /** List of file objects. */
1042
- readonly data?: Array<FileObject>
1045
+ readonly data?: Array<FileObject>;
1043
1046
  /** Whether more results are available. */
1044
- readonly hasMore?: boolean
1047
+ readonly hasMore?: boolean;
1045
1048
  }
1046
1049
 
1047
1050
  /** An uploaded file object. */
1048
1051
  export interface FileObject {
1049
1052
  /** Unique file ID. */
1050
- readonly id?: string
1053
+ readonly id?: string;
1051
1054
  /** Object type (always `"file"`). */
1052
- readonly object?: string
1055
+ readonly object?: string;
1053
1056
  /** File size in bytes. */
1054
- readonly bytes?: number
1057
+ readonly bytes?: number;
1055
1058
  /** Unix timestamp of file creation. */
1056
- readonly createdAt?: number
1059
+ readonly createdAt?: number;
1057
1060
  /** Filename. */
1058
- readonly filename?: string
1061
+ readonly filename?: string;
1059
1062
  /** File purpose. */
1060
- readonly purpose?: string
1063
+ readonly purpose?: string;
1061
1064
  /** Processing status (e.g., `"uploaded"`, `"processed"`). */
1062
- readonly status?: string
1065
+ readonly status?: string;
1063
1066
  }
1064
1067
 
1065
1068
  /** Purpose of an uploaded file. */
@@ -1097,27 +1100,27 @@ export declare enum FinishReason {
1097
1100
  /** Function call details. */
1098
1101
  export interface FunctionCall {
1099
1102
  /** Function name. */
1100
- readonly name: string
1103
+ readonly name: string;
1101
1104
  /** Arguments as a JSON string (parse with serde_json.from_str). */
1102
- readonly arguments: string
1105
+ readonly arguments: string;
1103
1106
  }
1104
1107
 
1105
1108
  /** Function definition exposed to the model. */
1106
1109
  export interface FunctionDefinition {
1107
1110
  /** Name of the function. Required and must be alphanumeric + underscores. */
1108
- readonly name: string
1111
+ readonly name: string;
1109
1112
  /** Human-readable description explaining what the function does. */
1110
- readonly description?: string
1113
+ readonly description?: string;
1111
1114
  /** JSON Schema defining the function's parameters. */
1112
- readonly parameters?: JsonValue
1115
+ readonly parameters?: JsonValue;
1113
1116
  /** If true, enforce strict JSON schema validation for arguments. */
1114
- readonly strict?: boolean
1117
+ readonly strict?: boolean;
1115
1118
  }
1116
1119
 
1117
1120
  /** Deprecated legacy function-role message body. */
1118
1121
  export interface FunctionMessage {
1119
- readonly content?: string
1120
- readonly name?: string
1122
+ readonly content?: string;
1123
+ readonly name?: string;
1121
1124
  }
1122
1125
 
1123
1126
  /**
@@ -1134,7 +1137,7 @@ export interface HealthChecker {
1134
1137
  * move it into the returned future without a clone, making the
1135
1138
  * `'static + Send` bound on the future trivially satisfiable.
1136
1139
  */
1137
- check(upstream: string): Promise<HealthStatus>
1140
+ check(upstream: string): Promise<HealthStatus>;
1138
1141
  }
1139
1142
 
1140
1143
  /** The result of a single health probe. */
@@ -1148,11 +1151,11 @@ export declare enum HealthStatus {
1148
1151
  /** A single generated image, returned as either a URL or base64 data. */
1149
1152
  export interface Image {
1150
1153
  /** Image URL (if response_format was "url"). */
1151
- readonly url?: string
1154
+ readonly url?: string;
1152
1155
  /** Base64-encoded image data (if response_format was "b64_json"). */
1153
- readonly b64Json?: string
1156
+ readonly b64Json?: string;
1154
1157
  /** The final prompt used to generate the image (DALL-E 3). */
1155
- readonly revisedPrompt?: string
1158
+ readonly revisedPrompt?: string;
1156
1159
  }
1157
1160
 
1158
1161
  /** Image detail level controlling token cost and processing. */
@@ -1168,9 +1171,9 @@ export declare enum ImageDetail {
1168
1171
  /** Response containing generated images. */
1169
1172
  export interface ImagesResponse {
1170
1173
  /** Unix timestamp of image creation. */
1171
- readonly created?: number
1174
+ readonly created?: number;
1172
1175
  /** List of generated images. */
1173
- readonly data?: Array<Image>
1176
+ readonly data?: Array<Image>;
1174
1177
  }
1175
1178
 
1176
1179
  /**
@@ -1184,59 +1187,59 @@ export interface ImagesResponse {
1184
1187
  */
1185
1188
  export interface ImageUrl {
1186
1189
  /** URL of the image (data URI or HTTP/HTTPS URL). */
1187
- readonly url?: string
1190
+ readonly url?: string;
1188
1191
  /** Detail level: low (512x512), high (2x2 tiles), or auto (model-selected). */
1189
- readonly detail?: ImageDetail
1192
+ readonly detail?: ImageDetail;
1190
1193
  }
1191
1194
 
1192
1195
  /** Configuration for the global per-client in-flight request limit. */
1193
1196
  export interface InFlightLimitConfig {
1194
1197
  /** Maximum simultaneously outstanding provider requests. `None` means unlimited. */
1195
- readonly maxInFlight?: number
1198
+ readonly maxInFlight?: number;
1196
1199
  }
1197
1200
 
1198
1201
  /** An intent prototype: `(intent_name, prototype_embedding, target_model_id)`. */
1199
1202
  export interface IntentPrototype {
1200
1203
  /** Human-readable name for the intent (used in logs/metrics). */
1201
- readonly name: string
1204
+ readonly name: string;
1202
1205
  /** Pre-computed embedding vector for this intent. */
1203
- readonly embedding: Array<number>
1206
+ readonly embedding: Array<number>;
1204
1207
  /** Model to route to when this intent is detected. */
1205
- readonly model: string
1208
+ readonly model: string;
1206
1209
  }
1207
1210
 
1208
1211
  /** JSON Schema specification for constrained output. */
1209
1212
  export interface JsonSchemaFormat {
1210
1213
  /** Name of the schema (must be unique in the request). */
1211
- readonly name?: string
1214
+ readonly name?: string;
1212
1215
  /** Description of what the schema represents. */
1213
- readonly description?: string
1216
+ readonly description?: string;
1214
1217
  /** JSON Schema object defining the output structure. */
1215
- readonly schema?: JsonValue
1218
+ readonly schema?: JsonValue;
1216
1219
  /** If true, enforce strict schema validation. */
1217
- readonly strict?: boolean
1220
+ readonly strict?: boolean;
1218
1221
  }
1219
1222
 
1220
1223
  /** Budget enforcement configuration. */
1221
1224
  export interface LlmBudgetConfig {
1222
1225
  /** Global spend limit in USD. */
1223
- readonly globalLimit?: number
1226
+ readonly globalLimit?: number;
1224
1227
  /** Per-model spend limits in USD, keyed by model name. */
1225
- readonly modelLimits?: Record<string, number>
1228
+ readonly modelLimits?: Record<string, number>;
1226
1229
  /** Enforcement mode: `"hard"` (reject over-budget requests) or `"soft"` (log only). */
1227
- readonly enforcement?: string
1230
+ readonly enforcement?: string;
1228
1231
  }
1229
1232
 
1230
1233
  /** Response cache configuration. */
1231
1234
  export interface LlmCacheConfig {
1232
1235
  /** Maximum number of cached entries. */
1233
- readonly maxEntries?: number
1236
+ readonly maxEntries?: number;
1234
1237
  /** Cache entry time-to-live, in seconds. */
1235
- readonly ttlSeconds?: number
1238
+ readonly ttlSeconds?: number;
1236
1239
  /** Cache backend name (e.g. `"memory"`, or an `opendal` scheme). */
1237
- readonly backend?: string
1240
+ readonly backend?: string;
1238
1241
  /** Backend-specific configuration key/value pairs. */
1239
- readonly backendConfig?: Record<string, string>
1242
+ readonly backendConfig?: Record<string, string>;
1240
1243
  }
1241
1244
 
1242
1245
  /**
@@ -1257,87 +1260,87 @@ export interface LlmCacheConfig {
1257
1260
  */
1258
1261
  export interface LlmConfig {
1259
1262
  /** Model identifier (e.g. `"gpt-4o"`, `"bedrock/anthropic.claude-3-sonnet-20240229-v1:0"`). */
1260
- readonly model?: string
1263
+ readonly model?: string;
1261
1264
  /** API key for authentication. */
1262
- readonly apiKey?: string
1265
+ readonly apiKey?: string;
1263
1266
  /**
1264
1267
  * Override base URL. When set, all requests go here and provider
1265
1268
  * auto-detection is skipped.
1266
1269
  */
1267
- readonly baseUrl?: string
1270
+ readonly baseUrl?: string;
1268
1271
  /** Request timeout, in seconds. */
1269
- readonly timeoutSecs?: number
1272
+ readonly timeoutSecs?: number;
1270
1273
  /** Maximum number of retries on 429 / 5xx responses. */
1271
- readonly maxRetries?: number
1274
+ readonly maxRetries?: number;
1272
1275
  /** Sampling temperature for requests built from this config. */
1273
- readonly temperature?: number
1276
+ readonly temperature?: number;
1274
1277
  /** Maximum number of tokens to generate for requests built from this config. */
1275
- readonly maxTokens?: number
1278
+ readonly maxTokens?: number;
1276
1279
  /**
1277
1280
  * Automatically load the API key from the provider's environment variable
1278
1281
  * when no explicit key is provided (default: `true`).
1279
1282
  */
1280
- readonly loadEnv?: boolean
1283
+ readonly loadEnv?: boolean;
1281
1284
  /** Extra headers sent on every request. */
1282
- readonly headers?: Record<string, string>
1285
+ readonly headers?: Record<string, string>;
1283
1286
  /** Custom provider configurations, in addition to the built-in providers. */
1284
- readonly providers?: Array<LlmProviderConfig>
1287
+ readonly providers?: Array<LlmProviderConfig>;
1285
1288
  /** Response cache configuration. */
1286
- readonly cache?: LlmCacheConfig
1289
+ readonly cache?: LlmCacheConfig;
1287
1290
  /** Budget enforcement configuration. */
1288
- readonly budget?: LlmBudgetConfig
1291
+ readonly budget?: LlmBudgetConfig;
1289
1292
  /** Per-model rate limiting configuration. */
1290
- readonly rateLimit?: LlmRateLimitConfig
1293
+ readonly rateLimit?: LlmRateLimitConfig;
1291
1294
  /** Global per-client in-flight provider request limit. */
1292
- readonly inFlightLimit?: LlmInFlightLimitConfig
1295
+ readonly inFlightLimit?: LlmInFlightLimitConfig;
1293
1296
  /** Enable per-request cost tracking. */
1294
- readonly costTracking?: boolean
1297
+ readonly costTracking?: boolean;
1295
1298
  /** Enable OpenTelemetry-compatible tracing spans. */
1296
- readonly tracing?: boolean
1299
+ readonly tracing?: boolean;
1297
1300
  /** Cooldown duration after transient errors, in seconds. */
1298
- readonly cooldownSecs?: number
1301
+ readonly cooldownSecs?: number;
1299
1302
  /** Background health check interval, in seconds. */
1300
- readonly healthCheckSecs?: number
1303
+ readonly healthCheckSecs?: number;
1301
1304
  /** AWS Bedrock configuration (region, credentials, cross-region routing). */
1302
- readonly bedrock?: BedrockConfig
1305
+ readonly bedrock?: BedrockConfig;
1303
1306
  }
1304
1307
 
1305
1308
  /** Global per-client in-flight provider request limit. */
1306
1309
  export interface LlmInFlightLimitConfig {
1307
1310
  /** Maximum simultaneously outstanding provider requests. `None` means unlimited. */
1308
- readonly maxInFlight?: number
1311
+ readonly maxInFlight?: number;
1309
1312
  }
1310
1313
 
1311
1314
  /** A custom provider configuration entry. */
1312
1315
  export interface LlmProviderConfig {
1313
1316
  /** Provider name, used to key model prefix matching. */
1314
- readonly name?: string
1317
+ readonly name?: string;
1315
1318
  /** Base URL for the provider's OpenAI-compatible API. */
1316
- readonly baseUrl?: string
1319
+ readonly baseUrl?: string;
1317
1320
  /** Header name used to carry the API key (defaults to `Authorization` when unset). */
1318
- readonly authHeader?: string
1321
+ readonly authHeader?: string;
1319
1322
  /** Model name prefixes routed to this provider (e.g. `["my-provider/"]`). */
1320
- readonly modelPrefixes?: Array<string>
1323
+ readonly modelPrefixes?: Array<string>;
1321
1324
  }
1322
1325
 
1323
1326
  /** Per-model rate limiting configuration. */
1324
1327
  export interface LlmRateLimitConfig {
1325
1328
  /** Requests per minute limit. */
1326
- readonly rpm?: number
1329
+ readonly rpm?: number;
1327
1330
  /** Tokens per minute limit. */
1328
- readonly tpm?: number
1331
+ readonly tpm?: number;
1329
1332
  /** Rate limit window, in seconds. */
1330
- readonly windowSeconds?: number
1333
+ readonly windowSeconds?: number;
1331
1334
  }
1332
1335
 
1333
1336
  /** A chat message in a conversation. */
1334
1337
  export type Message =
1335
- | { role: 'system'; system: SystemMessage }
1336
- | { role: 'user'; user: UserMessage }
1337
- | { role: 'assistant'; assistant: AssistantMessage }
1338
- | { role: 'tool'; tool: ToolMessage }
1339
- | { role: 'developer'; developer: DeveloperMessage }
1340
- | { role: 'function'; function: FunctionMessage }
1338
+ | { role: "system"; system: SystemMessage }
1339
+ | { role: "user"; user: UserMessage }
1340
+ | { role: "assistant"; assistant: AssistantMessage }
1341
+ | { role: "tool"; tool: ToolMessage }
1342
+ | { role: "developer"; developer: DeveloperMessage }
1343
+ | { role: "function"; function: FunctionMessage };
1341
1344
 
1342
1345
  /**
1343
1346
  * Output modality requested from the model.
@@ -1364,70 +1367,70 @@ export declare enum Modality {
1364
1367
  */
1365
1368
  export interface ModelInfo {
1366
1369
  /** Cost in USD per input (prompt) token. */
1367
- readonly inputCostPerToken?: number
1370
+ readonly inputCostPerToken?: number;
1368
1371
  /** Cost in USD per output (completion) token. */
1369
- readonly outputCostPerToken?: number
1372
+ readonly outputCostPerToken?: number;
1370
1373
  /** Cost in USD per cached input token (cache hit / read). */
1371
- readonly cacheReadInputTokenCost?: number
1374
+ readonly cacheReadInputTokenCost?: number;
1372
1375
  /** Cost in USD per token written to the prompt cache. */
1373
- readonly cacheCreationInputTokenCost?: number
1376
+ readonly cacheCreationInputTokenCost?: number;
1374
1377
  /** Cost in USD per input audio token. */
1375
- readonly inputCostPerAudioToken?: number
1378
+ readonly inputCostPerAudioToken?: number;
1376
1379
  /** Cost in USD per output audio token. */
1377
- readonly outputCostPerAudioToken?: number
1380
+ readonly outputCostPerAudioToken?: number;
1378
1381
  /** Cost in USD per reasoning (extended-thinking) output token. */
1379
- readonly outputCostPerReasoningToken?: number
1382
+ readonly outputCostPerReasoningToken?: number;
1380
1383
  /** Total context window size in tokens (input + output). */
1381
- readonly maxTokens?: number
1384
+ readonly maxTokens?: number;
1382
1385
  /** Maximum input (prompt) tokens accepted. */
1383
- readonly maxInputTokens?: number
1386
+ readonly maxInputTokens?: number;
1384
1387
  /** Maximum output (completion) tokens the model can generate. */
1385
- readonly maxOutputTokens?: number
1388
+ readonly maxOutputTokens?: number;
1386
1389
  /** Best-effort operating mode, e.g. `"chat"`, `"embedding"`. */
1387
- readonly mode?: string
1390
+ readonly mode?: string;
1388
1391
  /** The model accepts image input. */
1389
- readonly supportsVision?: boolean
1392
+ readonly supportsVision?: boolean;
1390
1393
  /** The model supports tool / function calling. */
1391
- readonly supportsFunctionCalling?: boolean
1394
+ readonly supportsFunctionCalling?: boolean;
1392
1395
  /** The model supports extended-thinking / reasoning tokens. */
1393
- readonly supportsReasoning?: boolean
1396
+ readonly supportsReasoning?: boolean;
1394
1397
  /** The model supports JSON-mode or `response_format` structured output. */
1395
- readonly supportsStructuredOutput?: boolean
1398
+ readonly supportsStructuredOutput?: boolean;
1396
1399
  /** The model accepts audio input. */
1397
- readonly supportsAudioInput?: boolean
1400
+ readonly supportsAudioInput?: boolean;
1398
1401
  /** The model can generate audio output. */
1399
- readonly supportsAudioOutput?: boolean
1402
+ readonly supportsAudioOutput?: boolean;
1400
1403
  /** The model supports prompt caching. */
1401
- readonly supportsPromptCaching?: boolean
1404
+ readonly supportsPromptCaching?: boolean;
1402
1405
  /**
1403
1406
  * Context-tiered pricing overrides, sorted by ascending
1404
1407
  * `min_context_tokens`. Empty when the model has flat pricing.
1405
1408
  */
1406
- readonly tiers?: Array<ModelTier>
1409
+ readonly tiers?: Array<ModelTier>;
1407
1410
  }
1408
1411
 
1409
1412
  /** A model available from the API. */
1410
1413
  export interface ModelObject {
1411
1414
  /** Model ID (e.g., `"gpt-4o"`, `"claude-3-5-sonnet"`). */
1412
- readonly id?: string
1415
+ readonly id?: string;
1413
1416
  /**
1414
1417
  * Always `"model"` from OpenAI-compatible APIs. Stored as a plain
1415
1418
  * `String` so non-standard provider values do not break deserialization.
1416
1419
  * Defaults to empty when a provider omits the field.
1417
1420
  */
1418
- readonly object?: string
1421
+ readonly object?: string;
1419
1422
  /**
1420
1423
  * Unix timestamp of model creation (or release date).
1421
1424
  *
1422
1425
  * Defaults to `0` when a provider omits it — DeepSeek and some other
1423
1426
  * OpenAI-compatible providers do not return `created` from `/v1/models`.
1424
1427
  */
1425
- readonly created?: number
1428
+ readonly created?: number;
1426
1429
  /**
1427
1430
  * Organization or entity that owns the model.
1428
1431
  * Defaults to empty when a provider omits the field.
1429
1432
  */
1430
- readonly ownedBy?: string
1433
+ readonly ownedBy?: string;
1431
1434
  }
1432
1435
 
1433
1436
  /** Response listing available models. */
@@ -1437,9 +1440,9 @@ export interface ModelsListResponse {
1437
1440
  * `String` so non-standard provider values do not break deserialization.
1438
1441
  * Defaults to empty when a provider omits the field.
1439
1442
  */
1440
- readonly object?: string
1443
+ readonly object?: string;
1441
1444
  /** List of available models. */
1442
- readonly data?: Array<ModelObject>
1445
+ readonly data?: Array<ModelObject>;
1443
1446
  }
1444
1447
 
1445
1448
  /**
@@ -1451,161 +1454,157 @@ export interface ModelTier {
1451
1454
  * The tier applies when the prompt/context token count is at least
1452
1455
  * this value.
1453
1456
  */
1454
- readonly minContextTokens?: number
1457
+ readonly minContextTokens?: number;
1455
1458
  /** Cost in USD per input (prompt) token within this tier. */
1456
- readonly inputCostPerToken?: number
1459
+ readonly inputCostPerToken?: number;
1457
1460
  /** Cost in USD per output (completion) token within this tier. */
1458
- readonly outputCostPerToken?: number
1461
+ readonly outputCostPerToken?: number;
1459
1462
  /** Cost in USD per cached input token within this tier. */
1460
- readonly cacheReadInputTokenCost?: number
1463
+ readonly cacheReadInputTokenCost?: number;
1461
1464
  /** Cost in USD per cache-write token within this tier. */
1462
- readonly cacheCreationInputTokenCost?: number
1465
+ readonly cacheCreationInputTokenCost?: number;
1463
1466
  /** Cost in USD per input audio token within this tier. */
1464
- readonly inputCostPerAudioToken?: number
1467
+ readonly inputCostPerAudioToken?: number;
1465
1468
  /** Cost in USD per output audio token within this tier. */
1466
- readonly outputCostPerAudioToken?: number
1469
+ readonly outputCostPerAudioToken?: number;
1467
1470
  /** Cost in USD per reasoning output token within this tier. */
1468
- readonly outputCostPerReasoningToken?: number
1471
+ readonly outputCostPerReasoningToken?: number;
1469
1472
  }
1470
1473
 
1471
1474
  /** Boolean flags for each moderation category. */
1472
1475
  export interface ModerationCategories {
1473
1476
  /** Sexual content. */
1474
- readonly sexual?: boolean
1477
+ readonly sexual?: boolean;
1475
1478
  /** Hate speech. */
1476
- readonly hate?: boolean
1479
+ readonly hate?: boolean;
1477
1480
  /** Harassment. */
1478
- readonly harassment?: boolean
1481
+ readonly harassment?: boolean;
1479
1482
  /** Self-harm content. */
1480
- readonly selfHarm?: boolean
1483
+ readonly selfHarm?: boolean;
1481
1484
  /** Sexual content involving minors. */
1482
- readonly sexualMinors?: boolean
1485
+ readonly sexualMinors?: boolean;
1483
1486
  /** Hate speech that threatens violence. */
1484
- readonly hateThreatening?: boolean
1487
+ readonly hateThreatening?: boolean;
1485
1488
  /** Graphic violence. */
1486
- readonly violenceGraphic?: boolean
1489
+ readonly violenceGraphic?: boolean;
1487
1490
  /** Intent to self-harm. */
1488
- readonly selfHarmIntent?: boolean
1491
+ readonly selfHarmIntent?: boolean;
1489
1492
  /** Instructions for self-harm. */
1490
- readonly selfHarmInstructions?: boolean
1493
+ readonly selfHarmInstructions?: boolean;
1491
1494
  /** Harassment that threatens violence. */
1492
- readonly harassmentThreatening?: boolean
1495
+ readonly harassmentThreatening?: boolean;
1493
1496
  /** Non-graphic violence. */
1494
- readonly violence?: boolean
1497
+ readonly violence?: boolean;
1495
1498
  }
1496
1499
 
1497
1500
  /** Confidence scores for each moderation category. */
1498
1501
  export interface ModerationCategoryScores {
1499
1502
  /** Sexual content score. */
1500
- readonly sexual?: number
1503
+ readonly sexual?: number;
1501
1504
  /** Hate speech score. */
1502
- readonly hate?: number
1505
+ readonly hate?: number;
1503
1506
  /** Harassment score. */
1504
- readonly harassment?: number
1507
+ readonly harassment?: number;
1505
1508
  /** Self-harm content score. */
1506
- readonly selfHarm?: number
1509
+ readonly selfHarm?: number;
1507
1510
  /** Sexual content involving minors score. */
1508
- readonly sexualMinors?: number
1511
+ readonly sexualMinors?: number;
1509
1512
  /** Hate speech that threatens violence score. */
1510
- readonly hateThreatening?: number
1513
+ readonly hateThreatening?: number;
1511
1514
  /** Graphic violence score. */
1512
- readonly violenceGraphic?: number
1515
+ readonly violenceGraphic?: number;
1513
1516
  /** Intent to self-harm score. */
1514
- readonly selfHarmIntent?: number
1517
+ readonly selfHarmIntent?: number;
1515
1518
  /** Instructions for self-harm score. */
1516
- readonly selfHarmInstructions?: number
1519
+ readonly selfHarmInstructions?: number;
1517
1520
  /** Harassment that threatens violence score. */
1518
- readonly harassmentThreatening?: number
1521
+ readonly harassmentThreatening?: number;
1519
1522
  /** Non-graphic violence score. */
1520
- readonly violence?: number
1523
+ readonly violence?: number;
1521
1524
  }
1522
1525
 
1523
1526
  /** Input to the moderation endpoint — a single string or multiple strings. */
1524
- export type ModerationInput =
1525
- | string
1526
- | Array<string>
1527
+ export type ModerationInput = string | Array<string>;
1527
1528
 
1528
1529
  /** Request to classify content for policy violations. */
1529
1530
  export interface ModerationRequest {
1530
1531
  /** Text or texts to check. */
1531
- readonly input?: ModerationInput
1532
+ readonly input?: ModerationInput;
1532
1533
  /** Model ID (e.g., `"text-moderation-latest"`). Optional; API uses default if unset. */
1533
- readonly model?: string
1534
+ readonly model?: string;
1534
1535
  }
1535
1536
 
1536
1537
  /** Response from the moderation endpoint. */
1537
1538
  export interface ModerationResponse {
1538
1539
  /** Unique identifier for this moderation request. */
1539
- readonly id: string
1540
+ readonly id: string;
1540
1541
  /** Model used for classification. */
1541
- readonly model: string
1542
+ readonly model: string;
1542
1543
  /** Results for each input string. */
1543
- readonly results: Array<ModerationResult>
1544
+ readonly results: Array<ModerationResult>;
1544
1545
  }
1545
1546
 
1546
1547
  /** A single moderation classification result. */
1547
1548
  export interface ModerationResult {
1548
1549
  /** True if any category was flagged. */
1549
- readonly flagged: boolean
1550
+ readonly flagged: boolean;
1550
1551
  /** Boolean flags for each moderation category. */
1551
- readonly categories: ModerationCategories
1552
+ readonly categories: ModerationCategories;
1552
1553
  /** Confidence scores for each category. */
1553
- readonly categoryScores: ModerationCategoryScores
1554
+ readonly categoryScores: ModerationCategoryScores;
1554
1555
  }
1555
1556
 
1556
1557
  /** Document input for OCR — either a URL or inline base64 data. */
1557
- export type OcrDocument =
1558
- | { type: 'document_url'; url: string }
1559
- | { type: 'base64'; data: string; mediaType: string }
1558
+ export type OcrDocument = { type: "document_url"; url: string } | { type: "base64"; data: string; mediaType: string };
1560
1559
 
1561
1560
  /** An image extracted from an OCR page. */
1562
1561
  export interface OcrImage {
1563
1562
  /** Unique image identifier within the document. */
1564
- readonly id: string
1563
+ readonly id: string;
1565
1564
  /** Base64-encoded image data (if `include_image_base64` was true). */
1566
- readonly imageBase64?: string
1565
+ readonly imageBase64?: string;
1567
1566
  }
1568
1567
 
1569
1568
  /** A single page of OCR output. */
1570
1569
  export interface OcrPage {
1571
1570
  /** Page index (0-based). */
1572
- readonly index: number
1571
+ readonly index: number;
1573
1572
  /** Extracted page content as Markdown. */
1574
- readonly markdown: string
1573
+ readonly markdown: string;
1575
1574
  /** Embedded images extracted from the page (if `include_image_base64` was true). */
1576
- readonly images?: Array<OcrImage>
1575
+ readonly images?: Array<OcrImage>;
1577
1576
  /** Page dimensions in pixels, if available. */
1578
- readonly dimensions?: PageDimensions
1577
+ readonly dimensions?: PageDimensions;
1579
1578
  }
1580
1579
 
1581
1580
  /** An OCR request. */
1582
1581
  export interface OcrRequest {
1583
1582
  /** The model/provider to use (e.g. `"mistral/mistral-ocr-latest"`). */
1584
- readonly model?: string
1583
+ readonly model?: string;
1585
1584
  /** The document to process (URL or base64). */
1586
- readonly document?: OcrDocument
1585
+ readonly document?: OcrDocument;
1587
1586
  /** Specific pages to process (1-indexed). `None` means all pages. */
1588
- readonly pages?: Array<number>
1587
+ readonly pages?: Array<number>;
1589
1588
  /** Whether to include base64-encoded images of each processed page. */
1590
- readonly includeImageBase64?: boolean
1589
+ readonly includeImageBase64?: boolean;
1591
1590
  }
1592
1591
 
1593
1592
  /** An OCR response. */
1594
1593
  export interface OcrResponse {
1595
1594
  /** Extracted pages in order. */
1596
- readonly pages: Array<OcrPage>
1595
+ readonly pages: Array<OcrPage>;
1597
1596
  /** Model/provider used for OCR. */
1598
- readonly model: string
1597
+ readonly model: string;
1599
1598
  /** Token usage, if reported by the provider. */
1600
- readonly usage?: Usage
1599
+ readonly usage?: Usage;
1601
1600
  }
1602
1601
 
1603
1602
  /** Page dimensions in pixels. */
1604
1603
  export interface PageDimensions {
1605
1604
  /** Width in pixels. */
1606
- readonly width: number
1605
+ readonly width: number;
1607
1606
  /** Height in pixels. */
1608
- readonly height: number
1607
+ readonly height: number;
1609
1608
  }
1610
1609
 
1611
1610
  /**
@@ -1618,9 +1617,9 @@ export interface PageDimensions {
1618
1617
  */
1619
1618
  export interface PromptTokensDetails {
1620
1619
  /** Cached tokens present in the prompt. Defaults to 0 when absent. */
1621
- readonly cachedTokens?: number
1620
+ readonly cachedTokens?: number;
1622
1621
  /** Audio input tokens present in the prompt. Defaults to 0 when absent. */
1623
- readonly audioTokens?: number
1622
+ readonly audioTokens?: number;
1624
1623
  }
1625
1624
 
1626
1625
  /**
@@ -1638,19 +1637,19 @@ export interface PromptTokensDetails {
1638
1637
  */
1639
1638
  export interface ProviderCapabilities {
1640
1639
  /** The provider accepts image input in chat messages. */
1641
- readonly vision?: boolean
1640
+ readonly vision?: boolean;
1642
1641
  /** The provider supports extended-thinking / reasoning tokens. */
1643
- readonly reasoning?: boolean
1642
+ readonly reasoning?: boolean;
1644
1643
  /** The provider supports JSON-mode or `response_format` structured output. */
1645
- readonly structuredOutput?: boolean
1644
+ readonly structuredOutput?: boolean;
1646
1645
  /** The provider supports tool / function calling. */
1647
- readonly functionCalling?: boolean
1646
+ readonly functionCalling?: boolean;
1648
1647
  /** The provider accepts audio as input. */
1649
- readonly audioIn?: boolean
1648
+ readonly audioIn?: boolean;
1650
1649
  /** The provider can generate audio / TTS output. */
1651
- readonly audioOut?: boolean
1650
+ readonly audioOut?: boolean;
1652
1651
  /** The provider accepts video as input. */
1653
- readonly videoIn?: boolean
1652
+ readonly videoIn?: boolean;
1654
1653
  }
1655
1654
 
1656
1655
  /**
@@ -1661,17 +1660,17 @@ export interface ProviderCapabilities {
1661
1660
  */
1662
1661
  export interface ProviderConfig {
1663
1662
  /** Provider identifier (matches the entry key in providers.json). */
1664
- readonly name: string
1663
+ readonly name: string;
1665
1664
  /** Human-readable provider name shown in UIs. */
1666
- readonly displayName?: string
1665
+ readonly displayName?: string;
1667
1666
  /** Base URL used as the default for this provider's HTTP client. */
1668
- readonly baseUrl?: string
1667
+ readonly baseUrl?: string;
1669
1668
  /** Authentication scheme metadata (auth type + env var holding the key). */
1670
- readonly auth?: AuthConfig
1669
+ readonly auth?: AuthConfig;
1671
1670
  /** Supported endpoint kinds (e.g. `chat`, `embeddings`). */
1672
- readonly endpoints?: Array<string>
1671
+ readonly endpoints?: Array<string>;
1673
1672
  /** Model-name prefixes claimed by this provider (e.g. `["gpt-", "o1-"]`). */
1674
- readonly modelPrefixes?: Array<string>
1673
+ readonly modelPrefixes?: Array<string>;
1675
1674
  /**
1676
1675
  * Parameter key renaming for this provider.
1677
1676
  *
@@ -1679,17 +1678,17 @@ export interface ProviderConfig {
1679
1678
  * to the name this provider expects (e.g. `"max_tokens"`). Applied
1680
1679
  * automatically by `ConfigDrivenProvider.transform_request`.
1681
1680
  */
1682
- readonly paramMappings?: Record<string, string>
1681
+ readonly paramMappings?: Record<string, string>;
1683
1682
  }
1684
1683
 
1685
1684
  /** Configuration for per-model rate limits. */
1686
1685
  export interface RateLimitConfig {
1687
1686
  /** Maximum requests per window. `None` means unlimited. */
1688
- readonly rpm?: number
1687
+ readonly rpm?: number;
1689
1688
  /** Maximum tokens per window. `None` means unlimited. */
1690
- readonly tpm?: number
1689
+ readonly tpm?: number;
1691
1690
  /** Fixed window duration (defaults to 60 s). */
1692
- readonly window?: number
1691
+ readonly window?: number;
1693
1692
  }
1694
1693
 
1695
1694
  /** Controls how much reasoning effort the model should use. */
@@ -1722,48 +1721,46 @@ export declare enum RefreshOutcome {
1722
1721
  }
1723
1722
 
1724
1723
  /** A document to be reranked — either a plain string or an object with a text field. */
1725
- export type RerankDocument =
1726
- | string
1727
- | { text: string }
1724
+ export type RerankDocument = string | { text: string };
1728
1725
 
1729
1726
  /** Request to rerank documents by relevance to a query. */
1730
1727
  export interface RerankRequest {
1731
1728
  /** Model ID (e.g., `"cohere/rerank-english-v3.0"`). */
1732
- readonly model?: string
1729
+ readonly model?: string;
1733
1730
  /** The search query. */
1734
- readonly query?: string
1731
+ readonly query?: string;
1735
1732
  /** Documents to rerank. */
1736
- readonly documents?: Array<RerankDocument>
1733
+ readonly documents?: Array<RerankDocument>;
1737
1734
  /** Return only the top N results. Optional. */
1738
- readonly topN?: number
1735
+ readonly topN?: number;
1739
1736
  /** Include the document content in results. Defaults to false. */
1740
- readonly returnDocuments?: boolean
1737
+ readonly returnDocuments?: boolean;
1741
1738
  }
1742
1739
 
1743
1740
  /** Response from the rerank endpoint. */
1744
1741
  export interface RerankResponse {
1745
1742
  /** Unique identifier for this rerank request. */
1746
- readonly id?: string
1743
+ readonly id?: string;
1747
1744
  /** Reranked documents in order of relevance. */
1748
- readonly results: Array<RerankResult>
1745
+ readonly results: Array<RerankResult>;
1749
1746
  /** Optional metadata about the reranking operation. */
1750
- readonly meta?: JsonValue
1747
+ readonly meta?: JsonValue;
1751
1748
  }
1752
1749
 
1753
1750
  /** A single reranked document with its relevance score. */
1754
1751
  export interface RerankResult {
1755
1752
  /** Original document index in the input list. */
1756
- readonly index: number
1753
+ readonly index: number;
1757
1754
  /** Relevance score in `[0, 1]`. Higher indicates more relevant. */
1758
- readonly relevanceScore: number
1755
+ readonly relevanceScore: number;
1759
1756
  /** Original document content (if `return_documents` was true). */
1760
- readonly document?: RerankResultDocument
1757
+ readonly document?: RerankResultDocument;
1761
1758
  }
1762
1759
 
1763
1760
  /** The text content of a reranked document, returned when `return_documents` is true. */
1764
1761
  export interface RerankResultDocument {
1765
1762
  /** Document text. */
1766
- readonly text: string
1763
+ readonly text: string;
1767
1764
  }
1768
1765
 
1769
1766
  /**
@@ -1785,88 +1782,88 @@ export interface RerankResultDocument {
1785
1782
  * returned JSON if the schema is load-bearing.
1786
1783
  */
1787
1784
  export type ResponseFormat =
1788
- | { type: 'text' }
1789
- | { type: 'json_object' }
1790
- | { type: 'json_schema'; jsonSchema: JsonSchemaFormat }
1785
+ | { type: "text" }
1786
+ | { type: "json_object" }
1787
+ | { type: "json_schema"; jsonSchema: JsonSchemaFormat };
1791
1788
 
1792
1789
  /** Response from a structured response request. */
1793
1790
  export interface ResponseObject {
1794
1791
  /** Unique response ID. */
1795
- readonly id?: string
1792
+ readonly id?: string;
1796
1793
  /** Object type (e.g., `"response"`). */
1797
- readonly object?: string
1794
+ readonly object?: string;
1798
1795
  /** Unix timestamp of response creation. */
1799
- readonly createdAt?: number
1796
+ readonly createdAt?: number;
1800
1797
  /** Model used to generate the response. */
1801
- readonly model?: string
1798
+ readonly model?: string;
1802
1799
  /** Status (e.g., `"succeeded"`, `"failed"`). */
1803
- readonly status?: string
1800
+ readonly status?: string;
1804
1801
  /** Output items from the response. */
1805
- readonly output?: Array<ResponseOutputItem>
1802
+ readonly output?: Array<ResponseOutputItem>;
1806
1803
  /** Token usage. */
1807
- readonly usage?: ResponseUsage
1804
+ readonly usage?: ResponseUsage;
1808
1805
  /** Error details (if status is "failed"). */
1809
- readonly error?: JsonValue
1806
+ readonly error?: JsonValue;
1810
1807
  }
1811
1808
 
1812
1809
  /** A single output item from the response. */
1813
1810
  export interface ResponseOutputItem {
1814
1811
  /** Output type (e.g., `"text"`, `"object"`, `"error"`). */
1815
- readonly itemType?: string
1812
+ readonly itemType?: string;
1816
1813
  /** Output content (flattened into the object). */
1817
- readonly content?: JsonValue
1814
+ readonly content?: JsonValue;
1818
1815
  }
1819
1816
 
1820
1817
  /** A tool available for the response request. */
1821
1818
  export interface ResponseTool {
1822
1819
  /** Tool type (e.g., "extractor", "search"). */
1823
- readonly toolType?: string
1820
+ readonly toolType?: string;
1824
1821
  /** Tool configuration (flattened into the object). */
1825
- readonly config?: JsonValue
1822
+ readonly config?: JsonValue;
1826
1823
  }
1827
1824
 
1828
1825
  /** Token usage for a response. */
1829
1826
  export interface ResponseUsage {
1830
1827
  /** Input tokens used. */
1831
- readonly inputTokens?: number
1828
+ readonly inputTokens?: number;
1832
1829
  /** Output tokens used. */
1833
- readonly outputTokens?: number
1830
+ readonly outputTokens?: number;
1834
1831
  /** Total tokens used. */
1835
- readonly totalTokens?: number
1832
+ readonly totalTokens?: number;
1836
1833
  }
1837
1834
 
1838
1835
  /** A search request. */
1839
1836
  export interface SearchRequest {
1840
1837
  /** The model/provider to use (e.g. `"brave/web-search"`, `"tavily/search"`). */
1841
- readonly model?: string
1838
+ readonly model?: string;
1842
1839
  /** The search query string. */
1843
- readonly query?: string
1840
+ readonly query?: string;
1844
1841
  /** Maximum number of results to return. */
1845
- readonly maxResults?: number
1842
+ readonly maxResults?: number;
1846
1843
  /** Domain filter — restrict results to specific domains. */
1847
- readonly searchDomainFilter?: Array<string>
1844
+ readonly searchDomainFilter?: Array<string>;
1848
1845
  /** Country code for localized results (ISO 3166-1 alpha-2, e.g., `"US"`, `"FR"`). */
1849
- readonly country?: string
1846
+ readonly country?: string;
1850
1847
  }
1851
1848
 
1852
1849
  /** A search response. */
1853
1850
  export interface SearchResponse {
1854
1851
  /** List of search results. */
1855
- readonly results: Array<SearchResult>
1852
+ readonly results: Array<SearchResult>;
1856
1853
  /** Model/provider that performed the search. */
1857
- readonly model: string
1854
+ readonly model: string;
1858
1855
  }
1859
1856
 
1860
1857
  /** An individual search result. */
1861
1858
  export interface SearchResult {
1862
1859
  /** Result title. */
1863
- readonly title: string
1860
+ readonly title: string;
1864
1861
  /** Result URL. */
1865
- readonly url: string
1862
+ readonly url: string;
1866
1863
  /** Text snippet or excerpt from the page. */
1867
- readonly snippet: string
1864
+ readonly snippet: string;
1868
1865
  /** Publication or last-updated date, if available. */
1869
- readonly date?: string
1866
+ readonly date?: string;
1870
1867
  }
1871
1868
 
1872
1869
  /**
@@ -1875,52 +1872,49 @@ export interface SearchResult {
1875
1872
  * The error value is shared so every follower receives the same upstream
1876
1873
  * failure without cloning the underlying error.
1877
1874
  */
1878
- export declare class SingleflightResult {
1879
- }
1875
+ export declare class SingleflightResult {}
1880
1876
 
1881
1877
  /** Name of the specific function to invoke. */
1882
1878
  export interface SpecificFunction {
1883
1879
  /** Function name. */
1884
- readonly name?: string
1880
+ readonly name?: string;
1885
1881
  }
1886
1882
 
1887
1883
  /** Directive to call a specific tool. */
1888
1884
  export interface SpecificToolChoice {
1889
1885
  /** Tool type (always "function"). */
1890
- readonly choiceType?: ToolType
1886
+ readonly choiceType?: ToolType;
1891
1887
  /** The specific function to invoke. */
1892
- readonly function?: SpecificFunction
1888
+ readonly function?: SpecificFunction;
1893
1889
  }
1894
1890
 
1895
1891
  /** Stop sequence(s) that cause the model to stop generating. */
1896
- export type StopSequence =
1897
- | string
1898
- | Array<string>
1892
+ export type StopSequence = string | Array<string>;
1899
1893
 
1900
1894
  /** A streaming choice with incremental delta. */
1901
1895
  export interface StreamChoice {
1902
1896
  /** Index of this choice in the choices array. */
1903
- readonly index?: number
1897
+ readonly index?: number;
1904
1898
  /** Incremental update to the message (content, tool calls, etc.). */
1905
- readonly delta?: StreamDelta
1899
+ readonly delta?: StreamDelta;
1906
1900
  /** Why the stream ended (present only in final chunk). */
1907
- readonly finishReason?: FinishReason
1901
+ readonly finishReason?: FinishReason;
1908
1902
  }
1909
1903
 
1910
1904
  /** Incremental delta in a stream chunk. */
1911
1905
  export interface StreamDelta {
1912
1906
  /** Role (typically present only in the first chunk). */
1913
- readonly role?: string
1907
+ readonly role?: string;
1914
1908
  /** Partial content chunk (e.g., a few words of the response). */
1915
- readonly content?: string
1909
+ readonly content?: string;
1916
1910
  /** Partial tool calls being streamed. */
1917
- readonly toolCalls?: Array<StreamToolCall>
1911
+ readonly toolCalls?: Array<StreamToolCall>;
1918
1912
  /** Deprecated legacy function_call delta; retained for API compatibility. */
1919
- readonly functionCall?: StreamFunctionCall
1913
+ readonly functionCall?: StreamFunctionCall;
1920
1914
  /** Partial refusal message. */
1921
- readonly refusal?: string
1915
+ readonly refusal?: string;
1922
1916
  /** Partial reasoning/thinking tokens (OpenAI-compatible extension used by DeepSeek R1, Qwen, etc.). */
1923
- readonly reasoningContent?: string
1917
+ readonly reasoningContent?: string;
1924
1918
  }
1925
1919
 
1926
1920
  /**
@@ -1941,27 +1935,27 @@ export declare enum StreamFormat {
1941
1935
  /** Partial function call details in a stream. */
1942
1936
  export interface StreamFunctionCall {
1943
1937
  /** Function name (typically in the first chunk). */
1944
- readonly name?: string
1938
+ readonly name?: string;
1945
1939
  /** Partial JSON arguments chunk. */
1946
- readonly arguments?: string
1940
+ readonly arguments?: string;
1947
1941
  }
1948
1942
 
1949
1943
  /** Options for streaming responses. */
1950
1944
  export interface StreamOptions {
1951
1945
  /** If true, include token usage in the final stream chunk. */
1952
- readonly includeUsage?: boolean
1946
+ readonly includeUsage?: boolean;
1953
1947
  }
1954
1948
 
1955
1949
  /** A streaming tool call being built incrementally. */
1956
1950
  export interface StreamToolCall {
1957
1951
  /** Index of this tool call in the tool_calls array. */
1958
- readonly index?: number
1952
+ readonly index?: number;
1959
1953
  /** Tool call ID (typically in the first chunk for this call). */
1960
- readonly id?: string
1954
+ readonly id?: string;
1961
1955
  /** Tool type (typically "function"). */
1962
- readonly callType?: ToolType
1956
+ readonly callType?: ToolType;
1963
1957
  /** Partial function name and arguments. */
1964
- readonly function?: StreamFunctionCall
1958
+ readonly function?: StreamFunctionCall;
1965
1959
  }
1966
1960
 
1967
1961
  /** System message guiding model behavior for the entire conversation. */
@@ -1972,25 +1966,23 @@ export interface SystemMessage {
1972
1966
  * Accepts either a plain text string or an array of content parts,
1973
1967
  * mirroring `UserContent` so that `Message.system_with_parts` works.
1974
1968
  */
1975
- readonly content?: UserContent
1969
+ readonly content?: UserContent;
1976
1970
  /** Optional name for the system message source. */
1977
- readonly name?: string
1971
+ readonly name?: string;
1978
1972
  }
1979
1973
 
1980
1974
  /** A tool call the model wants to execute. */
1981
1975
  export interface ToolCall {
1982
1976
  /** Unique ID for this call, used to reference in tool result messages. */
1983
- readonly id: string
1977
+ readonly id: string;
1984
1978
  /** Tool type (always "function"). */
1985
- readonly callType: ToolType
1979
+ readonly callType: ToolType;
1986
1980
  /** Function name and arguments. */
1987
- readonly function: FunctionCall
1981
+ readonly function: FunctionCall;
1988
1982
  }
1989
1983
 
1990
1984
  /** Tool usage mode or a specific tool to call. */
1991
- export type ToolChoice =
1992
- | __AlefWireToolChoiceMode
1993
- | __AlefWireSpecificToolChoice
1985
+ export type ToolChoice = __AlefWireToolChoiceMode | __AlefWireSpecificToolChoice;
1994
1986
 
1995
1987
  /** Tool choice mode. */
1996
1988
  export declare enum ToolChoiceMode {
@@ -2012,11 +2004,11 @@ export interface ToolMessage {
2012
2004
  * deserialises into `Text`, so tool results persisted before this field
2013
2005
  * carried structured content continue to round-trip.
2014
2006
  */
2015
- readonly content?: UserContent
2007
+ readonly content?: UserContent;
2016
2008
  /** ID of the tool call this result responds to. */
2017
- readonly toolCallId?: string
2009
+ readonly toolCallId?: string;
2018
2010
  /** Optional tool/function name. */
2019
- readonly name?: string
2011
+ readonly name?: string;
2020
2012
  }
2021
2013
 
2022
2014
  /**
@@ -2033,54 +2025,52 @@ export declare enum ToolType {
2033
2025
  /** Response from a transcription request. */
2034
2026
  export interface TranscriptionResponse {
2035
2027
  /** The transcribed text. */
2036
- readonly text?: string
2028
+ readonly text?: string;
2037
2029
  /** Detected language (ISO-639-1 code). */
2038
- readonly language?: string
2030
+ readonly language?: string;
2039
2031
  /** Total audio duration in seconds. */
2040
- readonly duration?: number
2032
+ readonly duration?: number;
2041
2033
  /** Detailed segment-level transcription (if response_format is "verbose_json"). */
2042
- readonly segments?: Array<TranscriptionSegment>
2034
+ readonly segments?: Array<TranscriptionSegment>;
2043
2035
  }
2044
2036
 
2045
2037
  /** A segment of transcribed audio with timing information. */
2046
2038
  export interface TranscriptionSegment {
2047
2039
  /** Segment index (0-based). */
2048
- readonly id?: number
2040
+ readonly id?: number;
2049
2041
  /** Start time in seconds. */
2050
- readonly start?: number
2042
+ readonly start?: number;
2051
2043
  /** End time in seconds. */
2052
- readonly end?: number
2044
+ readonly end?: number;
2053
2045
  /** Transcribed text for this segment. */
2054
- readonly text?: string
2046
+ readonly text?: string;
2055
2047
  }
2056
2048
 
2057
2049
  /** Token-usage accounting returned by the provider on each completion / embedding call. */
2058
2050
  export interface Usage {
2059
2051
  /** Prompt tokens used. Defaults to 0 when absent (some providers omit this). */
2060
- readonly promptTokens?: number
2052
+ readonly promptTokens?: number;
2061
2053
  /** Completion tokens used. Defaults to 0 when absent (e.g. embedding responses). */
2062
- readonly completionTokens?: number
2054
+ readonly completionTokens?: number;
2063
2055
  /** Total tokens used. Defaults to 0 when absent (some providers omit this). */
2064
- readonly totalTokens?: number
2056
+ readonly totalTokens?: number;
2065
2057
  /**
2066
2058
  * Breakdown of tokens used in the prompt, including cached tokens served
2067
2059
  * at the provider's discounted cache-read rate. Absent when the provider
2068
2060
  * does not return prompt-token details.
2069
2061
  */
2070
- readonly promptTokensDetails?: PromptTokensDetails
2062
+ readonly promptTokensDetails?: PromptTokensDetails;
2071
2063
  }
2072
2064
 
2073
2065
  /** User message content as either plain text or a list of multimodal parts. */
2074
- export type UserContent =
2075
- | string
2076
- | Array<__AlefWireContentPart>
2066
+ export type UserContent = string | Array<__AlefWireContentPart>;
2077
2067
 
2078
2068
  /** User message in the conversation. */
2079
2069
  export interface UserMessage {
2080
2070
  /** Message content as plain text or array of content parts (text, images, documents, audio). */
2081
- readonly content?: UserContent
2071
+ readonly content?: UserContent;
2082
2072
  /** Optional name for the user. */
2083
- readonly name?: string
2073
+ readonly name?: string;
2084
2074
  }
2085
2075
 
2086
2076
  /**
@@ -2091,13 +2081,13 @@ export interface UserMessage {
2091
2081
  */
2092
2082
  export interface WaitForBatchConfig {
2093
2083
  /** Initial interval between polls, in seconds. */
2094
- readonly initialIntervalSecs?: number
2084
+ readonly initialIntervalSecs?: number;
2095
2085
  /** Maximum interval between polls (backoff plateau), in seconds. */
2096
- readonly maxIntervalSecs?: number
2086
+ readonly maxIntervalSecs?: number;
2097
2087
  /** Exponential backoff multiplier (e.g., 1.5 increases delay by 50% each poll). */
2098
- readonly backoffMultiplier?: number
2088
+ readonly backoffMultiplier?: number;
2099
2089
  /** Optional timeout in seconds — polling fails if this duration is exceeded. */
2100
- readonly timeoutSecs?: number
2090
+ readonly timeoutSecs?: number;
2101
2091
  }
2102
2092
 
2103
2093
  /**
@@ -2167,25 +2157,36 @@ export declare function registerCustomProvider(config: CustomProviderConfig): vo
2167
2157
  */
2168
2158
  export declare function unregisterCustomProvider(name: string): boolean;
2169
2159
  export type __AlefWireImageDetail = "low" | "high" | "auto";
2170
- export type __AlefWireImageUrl = { url: string; detail?: (__AlefWireImageDetail | null) };
2160
+ export type __AlefWireImageUrl = { url: string; detail?: __AlefWireImageDetail | null };
2171
2161
  export type __AlefWireAudioContent = { data: string; format: string };
2172
- export type __AlefWireAssistantPart = ({ type: "text" } & { text: string }) | ({ type: "refusal" } & { refusal: string }) | ({ type: "output_image" } & { image_url: __AlefWireImageUrl }) | ({ type: "output_audio" } & { audio: __AlefWireAudioContent });
2173
- export type __AlefWireEmbeddingContentPart = ({ type: "text" } & { text: string }) | ({ type: "image_url" } & { image_url: __AlefWireImageUrl }) | ({ type: "image_base64" } & { image_base64: string });
2162
+ export type __AlefWireAssistantPart =
2163
+ | ({ type: "text" } & { text: string })
2164
+ | ({ type: "refusal" } & { refusal: string })
2165
+ | ({ type: "output_image" } & { image_url: __AlefWireImageUrl })
2166
+ | ({ type: "output_audio" } & { audio: __AlefWireAudioContent });
2167
+ export type __AlefWireEmbeddingContentPart =
2168
+ | ({ type: "text" } & { text: string })
2169
+ | ({ type: "image_url" } & { image_url: __AlefWireImageUrl })
2170
+ | ({ type: "image_base64" } & { image_base64: string });
2174
2171
  export type __AlefWireToolChoiceMode = "auto" | "required" | "none";
2175
2172
  export type __AlefWireToolType = "function";
2176
2173
  export type __AlefWireSpecificFunction = { name: string };
2177
- export type __AlefWireSpecificToolChoice = { type: __AlefWireToolType; "function": __AlefWireSpecificFunction };
2174
+ export type __AlefWireSpecificToolChoice = { type: __AlefWireToolType; function: __AlefWireSpecificFunction };
2178
2175
  export type __AlefWireDocumentContent = { data: string; media_type: string };
2179
- export type __AlefWireContentPart = ({ type: "text" } & { text: string }) | ({ type: "image_url" } & { image_url: __AlefWireImageUrl }) | ({ type: "document" } & { document: __AlefWireDocumentContent }) | ({ type: "input_audio" } & { input_audio: __AlefWireAudioContent });
2176
+ export type __AlefWireContentPart =
2177
+ | ({ type: "text" } & { text: string })
2178
+ | ({ type: "image_url" } & { image_url: __AlefWireImageUrl })
2179
+ | ({ type: "document" } & { document: __AlefWireDocumentContent })
2180
+ | ({ type: "input_audio" } & { input_audio: __AlefWireAudioContent });
2180
2181
 
2181
2182
  export declare class ChatStreamIterator {
2182
- next(value?: undefined): Promise<IteratorResult<ChatCompletionChunk, void>>
2183
- [Symbol.asyncIterator](): AsyncGenerator<ChatCompletionChunk, void, undefined>
2183
+ next(value?: undefined): Promise<IteratorResult<ChatCompletionChunk, void>>;
2184
+ [Symbol.asyncIterator](): AsyncGenerator<ChatCompletionChunk, void, undefined>;
2184
2185
  }
2185
2186
 
2186
2187
  export declare class LiterLlmErrorInfo {
2187
- code(): number
2188
- statusCode(): number
2189
- isTransient(): boolean
2190
- errorType(): string
2188
+ code(): number;
2189
+ statusCode(): number;
2190
+ isTransient(): boolean;
2191
+ errorType(): string;
2191
2192
  }