Skip to main content

Mistral Target adapter for Waken — routes waken Events to Mistral AI's chat API.

Project description

waken-mistral

CI License: MIT

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

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

waken_mistral-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

waken_mistral-0.1.0-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

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

Hashes for waken_mistral-0.1.0.tar.gz
Algorithm Hash digest
SHA256 109c3105e525e13ec257a10bb37f4614fab11bba5f45b65b2d51a0a0ed9f525e
MD5 3af0fb0576ec4c8b8503c70f82334a40
BLAKE2b-256 5411f2cd294b30eadd98cb2c598e39cdc35131111e27694038b5d443fbaa5cf5

See more details on using hashes here.

Provenance

The following attestation bundles were made for waken_mistral-0.1.0.tar.gz:

Publisher: publish.yml on WakenHQ/waken-mistral

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for waken_mistral-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f8973d353002cffd209c989f727433eb36671e4c18046c76f22d25bbf5c95d6
MD5 934fcf44c833b4cce03f2c0534851248
BLAKE2b-256 4b6b824deb9c2c49c828b195935332c760c42631793e66f480d68e5bf7026287

See more details on using hashes here.

Provenance

The following attestation bundles were made for waken_mistral-0.1.0-py3-none-any.whl:

Publisher: publish.yml on WakenHQ/waken-mistral

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page