@polyweave/mistral (1.0.5)
Published 2026-07-10 23:59:02 +00:00 by Dvorak
Installation
@polyweave:registry=https://hub.kl1.tenere.ai/api/packages/Polyweave/npm/npm install @polyweave/mistral@1.0.5"@polyweave/mistral": "1.0.5"About this package
@polyweave/mistral
Mistral AI adapter for Polyweave - supports chat (streaming, tools, vision, reasoning), embeddings, FIM code completion, and audio transcription via Mistral API.
Synopsis
import { createMistralAdapter } from '@polyweave/mistral';
const adapter = createMistralAdapter({ apiKey: 'YOUR_API_KEY' });
adapter.source.pipe(someSink);
adapter.sink.write({ type: 'PARAM', content: { key: 'model', value: 'mistral-small-latest' } });
adapter.sink.write({ type: 'TEXT', content: { text: 'What is the capital of France?' } });
Install
npm install @polyweave/mistral
API
createMistralAdapter(config)
Returns an IFrameDuplex stream adapter. Configuration options:
| Option | Type | Default | Description |
|---|---|---|---|
apiKey |
string | process.env.MISTRAL_API_KEY |
Mistral API key |
baseURL |
string | 'https://api.mistral.ai' |
API base URL |
timeout |
number | 60000 |
Request timeout in ms |
Frame Types
- Input:
TEXT,AUDIO,EMBEDDING,FIM,TOOL_RESULT,PARAM,COST_CHECK,START,END - Output:
TEXT,TOOL_CALL,RECEIPT,ERROR,COST,END
Tasks
Route via task PARAM: embeddings/embed, fim/code/completion. Default: chat completion with tool calling support.
Tests
npm test
Requirements
- Node.js >= 18.0.0
@polyweave/core(peer)@polyweave/errors(peer)
License
MIT
Dependencies
Development Dependencies
| ID | Version |
|---|---|
| @rigor/core | * |
Peer Dependencies
| ID | Version |
|---|---|
| @polyweave/core | * |
| @polyweave/costs | * |
| @polyweave/errors | * |
Keywords
polyweave
mistral
ai
adapter