providerplaneai
    Preparing search index...

    MistralProvider: concrete BaseProvider implementation for Mistral AI.

    Responsibilities:

    • Own the official Mistral SDK client
    • Register supported Mistral v1 capabilities
    • Delegate capability execution to capability-specific adapters

    Supported v1 capabilities:

    • chat
    • chatStream
    • embed
    • moderation
    • imageAnalysis
    • imageAnalysisStream
    • ocr
    • audio transcription
    • audio transcription stream
    • text-to-speech
    • text-to-speech stream

    Provider capability implementation for MistralProvider.

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    Properties

    capabilities: Partial<CapabilityMap> = {}

    Support provider capabilities

    config: ProviderConnectionConfig | null = null

    Current connection config

    executors?: Map<CapabilityKeyType, CapabilityExecutor<any, any, any>>
    providerType: AIProviderType

    Type of this provider (OpenAI, Anthropic, Gemini, etc.)

    Methods

    • Resolve and merge configuration for a capability.

      Merge precedence (low → high):

      1. providerDefaults (global provider-level defaults)
      2. model capability defaults (models[modelName][capability])
      3. runtimeOptions (request-level overrides)

      Model resolution fallback: runtimeOptions.model → config.defaultModels[capability] → config.defaultModel

      Parameters

      • capability: string

        Name of the capability.

      • runtimeOptions: any = {}

        Request-level override options.

      Returns { generalParams: any; model: any; modelParams: any; providerParams: any }

      Merged configuration with keys such as model, modelParams, providerParams, and generalParams.

      When a model cannot be resolved for the requested capability.

    • Deep-merge multiple objects. Arrays override completely, objects are recursively merged, primitives override. Used for merging provider defaults, model configurations, and runtime options.

      Parameters

      • ...sources: any[]

        Objects to merge.

      Returns any

      Deep-merged object.

    • Strips keys from providerParams that must never be forwarded to an SDK constructor because they can redirect API traffic or override credentials.

      Blocked keys across all supported SDKs:

      • baseURL / baseUrl — redirects all provider traffic to an arbitrary host, causing the API key to be sent to an attacker-controlled server.
      • apiKey / authToken — would silently override the key already set from config.
      • httpAgent — custom HTTP agent can route traffic through an arbitrary proxy.
      • fetch / globalFetch — custom fetch implementations can intercept all requests.
      • httpOptions — Gemini SDK wrapper for baseUrl and custom fetch.

      Parameters

      • params: Record<string, unknown>

        Raw providerParams from caller config.

      Returns Record<string, unknown>

      Params with dangerous constructor keys removed.