MistralBackendAdapter
Defined in: backend/src/providers/mistral.ts:79
Backend adapter interface.
Backend adapters handle actual API calls to AI providers. They transform universal IR into provider-specific API requests and normalize responses back to IR.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MistralBackendAdapter(
config):MistralBackendAdapter
Defined in: backend/src/providers/mistral.ts:85
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”MistralBackendAdapter
Properties
Section titled “Properties”metadata
Section titled “metadata”
readonlymetadata:AdapterMetadata
Defined in: backend/src/providers/mistral.ts:80
Adapter metadata for identification and capabilities.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”estimateCost()
Section titled “estimateCost()”estimateCost(
request):Promise<number|null>
Defined in: backend/src/providers/mistral.ts:288
Optional: Estimate cost for a request.
Parameters
Section titled “Parameters”request
Section titled “request”IR request to estimate cost for
Returns
Section titled “Returns”Promise<number | null>
Estimated cost in USD (or null if unavailable)
Implementation of
Section titled “Implementation of”execute()
Section titled “execute()”execute(
request,signal?):Promise<IRChatResponse>
Defined in: backend/src/providers/mistral.ts:112
Execute non-streaming chat completion request.
Parameters
Section titled “Parameters”request
Section titled “request”Universal IR request
signal?
Section titled “signal?”AbortSignal
Optional AbortSignal for cancellation
Returns
Section titled “Returns”Promise<IRChatResponse>
Universal IR response
Throws
Section titled “Throws”If API key is invalid
Throws
Section titled “Throws”If request is invalid for this provider
Throws
Section titled “Throws”If provider API returns error
Throws
Section titled “Throws”If network request fails
Throws
Section titled “Throws”If response parsing fails
Implementation of
Section titled “Implementation of”executeStream()
Section titled “executeStream()”executeStream(
request,signal?):IRChatStream
Defined in: backend/src/providers/mistral.ts:151
Execute streaming chat completion request.
Parameters
Section titled “Parameters”request
Section titled “request”Universal IR request
signal?
Section titled “signal?”AbortSignal
Optional AbortSignal for cancellation
Returns
Section titled “Returns”Universal IR stream of chunks
Throws
Section titled “Throws”If API key is invalid
Throws
Section titled “Throws”If request is invalid for this provider
Throws
Section titled “Throws”If provider API returns error
Throws
Section titled “Throws”If network request fails
Throws
Section titled “Throws”If stream parsing or processing fails
Implementation of
Section titled “Implementation of”fromIR()
Section titled “fromIR()”fromIR(
request):MistralRequest
Defined in: backend/src/providers/mistral.ts:387
Convert IR request to Mistral format.
Public method for testing and debugging - see what will be sent to Mistral.
Parameters
Section titled “Parameters”request
Section titled “request”Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”healthCheck()
Section titled “healthCheck()”healthCheck():
Promise<boolean>
Defined in: backend/src/providers/mistral.ts:275
Optional: Health check to verify backend is available.
Returns
Section titled “Returns”Promise<boolean>
true if backend is healthy and available
Implementation of
Section titled “Implementation of”invalidateModelCache()
Section titled “invalidateModelCache()”invalidateModelCache():
MistralBackendAdapter
Defined in: backend/src/providers/mistral.ts:377
Returns
Section titled “Returns”MistralBackendAdapter
listModels()
Section titled “listModels()”listModels(
options?):Promise<ListModelsResult>
Defined in: backend/src/providers/mistral.ts:296
List available Mistral models.
Parameters
Section titled “Parameters”options?
Section titled “options?”Returns
Section titled “Returns”Promise<ListModelsResult>
Implementation of
Section titled “Implementation of”toIR()
Section titled “toIR()”toIR(
response,originalRequest,latencyMs):IRChatResponse
Defined in: backend/src/providers/mistral.ts:418
Convert Mistral response to IR format.
Public method for testing and debugging - parse Mistral responses manually.
Parameters
Section titled “Parameters”response
Section titled “response”originalRequest
Section titled “originalRequest”latencyMs
Section titled “latencyMs”number