llmwire - v2.2.0
    Preparing search index...

    Class BaseProviderAbstract

    Hierarchy (View Summary)

    Implements

    Index
    _supportedModels: string[] = []
    baseConfig: BaseProviderConfig
    • get baseURL(): string | undefined

      Origin this provider talks to; shown in PROVIDER_UNREACHABLE hints.

      Returns string | undefined

    • The last successful discovery, while younger than modelCacheTtlMs (default 5 min; 0 disables).

      Returns string[] | null

    • Provider-specific reading of an error body. Return the fields you can tell from it (code, providerCode, hint, retryAfterMs); the status code default fills the rest.

      Parameters

      • _status: number
      • _json: any
      • _text: string

      Returns Refinement

    • A fresh AIError for a failure this provider detects itself (no key, no model, blocked answer).

      Parameters

      • code: AIErrorCode
      • message: string
      • extra: { details?: unknown; hint?: string; model?: string } = {}

      Returns AIError

    • JSON request with the reply's status and headers (request ids live there).

      Type Parameters

      • T = any

      Parameters

      Returns Promise<HttpResult<T>>

    • Streaming request: the body as an async iterable of bytes, idle-guarded. Non-2xx throws [HttpError].

      Parameters

      Returns Promise<AsyncIterable<Uint8Array>>

    • Streams a completion. The default runs the ordinary [process] and hands back its answer as a single chunk, so every provider can be consumed as a stream even where the upstream API has no streaming endpoint -- callers write one code path instead of two. Providers that do stream override it.

      Parameters

      Returns AsyncGenerator<AIStreamChunk, void, void>

    • Records what discovery found, keeping any seeded models first so the caller's chosen default stays the default.

      Parameters

      • ids: string[]

      Returns string[]

    • Any thrown value → AIError carrying this provider's classification.

      Parameters

      • error: unknown
      • Optionalmodel: string

      Returns AIError