Mistral Target adapter for Waken — routes waken Events to Mistral AI's chat API.
Project description
waken-mistral
A Mistral Target adapter for
Waken — "nginx for AI agents." Routes
waken Events to Mistral AI's chat completion API and returns the result as
a waken Response.
Install
pip install waken-mistral
Usage
from waken import Runtime
from waken_mistral import MistralAdapter
runtime = Runtime()
runtime.target("mistral", MistralAdapter())
runtime.run()
MistralAdapter reads MISTRAL_API_KEY from the environment — that's the
mistralai SDK's own convention, nothing waken-specific. Pass api_key=...
(or any other Mistral client keyword, e.g. server_url=...) to override:
runtime.target("mistral", MistralAdapter(model="mistral-small-latest", api_key="..."))
Sessions
Unlike Claude or OpenAI, Mistral's chat completion API has no server-side
resumable session id — it's a stateless endpoint that expects the full
conversation history resent on every call. So MistralAdapter maps a waken
session_id to a plain, growing list of {"role": ..., "content": ...}
messages, appends the new user prompt and the assistant's reply to that list
on every turn, and resends the whole thing each time. History is kept
client-side, in this process's memory only — there's no persistence
layer, and it's lost on restart. That's the same tradeoff waken itself
makes for sessions in general: the runtime only stores the session id
mapping, never conversation content, so any content-level durability is the
adapter's responsibility, not the runtime's. An Event with no session_id
sends a fresh one-message list each call and is never stored.
Development
git clone https://github.com/WakenHQ/waken-mistral
cd waken-mistral
pip install -e ".[dev]"
pytest
Tests mock mistralai.client.Mistral entirely — no API key or network
access needed to run the suite.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file waken_mistral-0.1.0.tar.gz.
File metadata
- Download URL: waken_mistral-0.1.0.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
109c3105e525e13ec257a10bb37f4614fab11bba5f45b65b2d51a0a0ed9f525e
|
|
| MD5 |
3af0fb0576ec4c8b8503c70f82334a40
|
|
| BLAKE2b-256 |
5411f2cd294b30eadd98cb2c598e39cdc35131111e27694038b5d443fbaa5cf5
|
Provenance
The following attestation bundles were made for waken_mistral-0.1.0.tar.gz:
Publisher:
publish.yml on WakenHQ/waken-mistral
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waken_mistral-0.1.0.tar.gz -
Subject digest:
109c3105e525e13ec257a10bb37f4614fab11bba5f45b65b2d51a0a0ed9f525e - Sigstore transparency entry: 2082012478
- Sigstore integration time:
-
Permalink:
WakenHQ/waken-mistral@a7f3091cce936495d2fc973ff86739f7dea28e75 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WakenHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a7f3091cce936495d2fc973ff86739f7dea28e75 -
Trigger Event:
push
-
Statement type:
File details
Details for the file waken_mistral-0.1.0-py3-none-any.whl.
File metadata
- Download URL: waken_mistral-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f8973d353002cffd209c989f727433eb36671e4c18046c76f22d25bbf5c95d6
|
|
| MD5 |
934fcf44c833b4cce03f2c0534851248
|
|
| BLAKE2b-256 |
4b6b824deb9c2c49c828b195935332c760c42631793e66f480d68e5bf7026287
|
Provenance
The following attestation bundles were made for waken_mistral-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on WakenHQ/waken-mistral
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
waken_mistral-0.1.0-py3-none-any.whl -
Subject digest:
1f8973d353002cffd209c989f727433eb36671e4c18046c76f22d25bbf5c95d6 - Sigstore transparency entry: 2082012487
- Sigstore integration time:
-
Permalink:
WakenHQ/waken-mistral@a7f3091cce936495d2fc973ff86739f7dea28e75 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/WakenHQ
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a7f3091cce936495d2fc973ff86739f7dea28e75 -
Trigger Event:
push
-
Statement type: