93 Commits

Author SHA1 Message Date
4c7f1cde0a feat: streaming Conversations API support (v1.2.0)
Add conversation_stream module with full streaming support for the
Mistral Conversations API:

- ConversationEvent enum matching API SSE event types: ResponseStarted,
  MessageOutput (text deltas), FunctionCall, ResponseDone (with usage),
  ResponseError, tool execution, agent handoff events
- parse_sse_line() handles SSE format (skips event: lines, parses
  data: JSON, handles [DONE] and comments)
- accumulate() collects streaming events into a ConversationResponse
- create_conversation_stream_async() and
  append_conversation_stream_async() client methods
- Byte-boundary buffering in sse_to_conversation_events — handles
  JSON split across TCP frames
- Integration tests hit real Mistral API: create stream, append stream,
  stream/non-stream output equivalence
v1.2.0
2026-03-24 21:16:39 +00:00
a29c3c0109 feat: add Agents API, Conversations API, and multimodal support (v1.1.0)
Agents API (beta): create, get, update, delete, list agents with tools,
handoffs, completion args, and guardrails support.

Conversations API (beta): create, append, history, messages, restart,
delete, list conversations. Supports agent-backed and model-only
conversations with function calling and handoff execution modes.

Multimodal: ChatMessageContent enum (Text/Parts) with ContentPart
variants for text and image_url. Backwards-compatible constructors.
new_user_message_with_images() for mixed content messages.

Chat: reasoning field on ChatResponseChoice for Magistral models.
HTTP: PATCH methods for agent updates.

81 tests (30 live API integration + 35 serde unit + 16 existing).
2026-03-21 20:58:25 +00:00
d5eb16dffc chore: update maintainer info and project metadata
- Change author to Sunbeam Studios
- Remove GitHub-specific files (.github/, renovate, README.template)
- Remove .env.example (replaced by .envrc workflow)
- Replace Makefile with justfile
- Update CHANGELOG with v1.0.0 fork notes
- Update Cargo.toml homepage to sunbeam.pt
2026-03-20 19:03:19 +00:00
4dee5cfe0f build: configure sunbeam cargo registry for publishing
- Add .cargo/config.toml with sunbeam registry index
- Set publish target to sunbeam registry in Cargo.toml
- Update homepage and repository URLs to Gitea
2026-03-20 18:15:58 +00:00
ab2ecec351 docs: replace CONTRIBUTING.md and clean up README
- Replace old CONTRIBUTING.md with comprehensive contributing guide
- Remove fork notice from README header
2026-03-20 18:08:40 +00:00
5e6fac99a9 docs: update doc comments with current Mistral API links
Some checks failed
Test / Test (push) Has been cancelled
Test / Test Documentation (push) Has been cancelled
Test / Test Examples (push) Has been cancelled
- Update crate-level docs with full API coverage description
- Fix stale docs.mistral.ai URLs to current endpoint references
- Point ChatMessageRole to chat completions API docs
- Point ModelListData to models API docs
2026-03-20 18:02:30 +00:00
63f0edf574 docs: update README and examples for v1.0.0
- Rewrite README with all new endpoints and current model names
- Add available models table with constructors
- Add FIM and OCR examples
- Update all examples for string-based Model type
- Update streaming example for Option<String> delta content
- Use serde_json::json!() for tool schemas in examples
- Add .envrc to .gitignore
2026-03-20 18:00:51 +00:00
ce96bcfeeb test: update all tests for v1.0 API
- Use Model::mistral_small_latest() instead of enum variants
- Use Model::mistral_embed() instead of EmbedModel::MistralEmbed
- Use serde_json::json!() for tool parameter schemas
- Update ChatParams for Option<f32> temperature field
- Update streaming test comments for new delta.content type
2026-03-20 17:57:44 +00:00
4d6eca62ef feat: add FIM, files, fine-tuning, batch, OCR, audio, moderation, and agent endpoints
New API endpoints with sync + async support:
- FIM (fill-in-the-middle) completions for code completion
- Files API: upload, list, get, delete, get URL
- Fine-tuning: create, list, get, cancel, start jobs
- Batch jobs: create, list, get, cancel
- OCR: document text extraction with page/table options
- Audio transcription: speech-to-text with diarization
- Moderations and classifications: content safety
- Agent completions: run pre-configured agents
2026-03-20 17:56:28 +00:00
bbb6aaed1c refactor!: modernize core types and client for latest Mistral API
BREAKING CHANGE: Model is now a string-based struct with constructor
methods instead of a closed enum. EmbedModel is removed — use
Model::mistral_embed() instead. Tool parameters now accept
serde_json::Value (JSON Schema) instead of limited enum types.

- Replace Model enum with flexible Model(String) supporting all
  current models: Large 3, Small 4, Medium 3.1, Magistral, Codestral,
  Devstral, Pixtral, Voxtral, Ministral, and arbitrary strings
- Remove EmbedModel enum (consolidated into Model)
- Chat: add frequency_penalty, presence_penalty, stop, n, min_tokens,
  parallel_tool_calls, reasoning_effort, json_schema response format
- Embeddings: add output_dimension and output_dtype fields
- Tools: accept raw JSON Schema, add tool call IDs and Required choice
- Stream delta content is now Option<String> for tool call chunks
- Add Length, ModelLength, Error finish reason variants
- DRY HTTP transport with shared response handlers
- Add DELETE method support and model get/delete endpoints
- Make model_list fields more lenient with Option/default for API compat
2026-03-20 17:54:29 +00:00
83396773ce build: update dependencies, remove strum, add reqwest multipart
- Bump thiserror 1.x → 2.x
- Remove strum (no longer needed after Model enum replacement)
- Add reqwest multipart feature for file upload support
- Relax version pins to semver ranges
- Bump package version to 1.0.0
2026-03-20 17:54:09 +00:00
Ivan Gabriele
9ad6a1dc84 ci(release): v0.14.0 v0.14.0 2024-08-27 09:28:58 +02:00
Ivan Gabriele
7c464830ee docs(changelog): update 2024-08-27 09:28:50 +02:00
francois-caddet
161b33c725 feat(constants): update model constants (#17)
* feat(Model)!: Update model constants

- Add new models Mistral Nemo and Codestral Mamba
- Add aliases to models constant to be deserialized seemlessly from the versioned forme (e.g.: "mistral-large-2407")
- The commonly named Mistral Large 2 is now `constants::Model::MistralLargeLatest` when the old one is `Model::MistralLarge`

* tests(Model): Update the tests to check the new model variants.
2024-08-27 09:25:59 +02:00
Ivan Gabriele
79a410b298 ci(release): v0.13.0 v0.13.0 2024-08-22 01:15:08 +02:00
Ivan Gabriele
4a45ad337f docs(changelog): update 2024-08-22 01:15:00 +02:00
Ivan Gabriele
2114916941 fix(client)!: update ModelListData struct following API changes
BREAKING CHANGE: `v1::model_list::ModelListData` struct has been updated.
2024-08-22 01:09:27 +02:00
francois-caddet
9bfbf2e9dc fix(client): remove the Content-Type from the headers of the reqwest builders. (#14)
They apparently are conflicting with reqwest internal stufs.

fix #13
2024-08-22 00:45:06 +02:00
Ivan Gabriele
67aa5bbaef ci(release): v0.12.0 v0.12.0 2024-07-24 20:23:22 +02:00
Ivan Gabriele
415fd98167 docs(changelog): update 2024-07-24 20:23:01 +02:00
Federico G. Schwindt
8e9f7a5386 feat: mark Function trait as Send (#12)
Allow to use Client in places that are also Send.
2024-07-24 20:16:11 +02:00
Federico G. Schwindt
3afeec1d58 feat: implement the Debug trait for Client (#11)
This is useful if you want to include client::Client in your own
implementation and derive Debug.
2024-07-24 20:08:25 +02:00
Ivan Gabriele
0c097aa56d ci(release): v0.11.0 v0.11.0 2024-06-22 14:05:11 +02:00
Ivan Gabriele
e6539c0ccf docs(changelog): update 2024-06-22 14:05:04 +02:00
Ivan Gabriele
30156c5273 test: remove useless setup in constants test 2024-06-22 14:02:52 +02:00
Ivan Gabriele
ecd0c3028f feat(constants): add OpenMixtral8x22b, MistralTiny & CodestralLatest to Model enum 2024-06-22 13:22:57 +02:00
Ivan Gabriele
0df67b1b25 fix(chat): implement Clone trait for ChatParams & ResponseFormat 2024-06-22 13:09:15 +02:00
Ivan Gabriele
f7d012b280 ci(release): v0.10.0 v0.10.0 2024-06-07 16:55:50 +02:00
Ivan Gabriele
5b5bd2d68e docs(changelog): update 2024-06-07 16:55:39 +02:00
Xavier Gillard
2fc0642a5e feat(chat): add the 'system' and 'tool' message roles (#10)
* add the 'system' and 'tool' message roles (see: https://docs.mistral.ai/capabilities/completion/ )

* docs(chat): add offical doc link in ChatMessageRole

* ci(github): listen to pull_request event in Test workflow

---------

Co-authored-by: Ivan Gabriele <ivan.gabriele@protonmail.com>
2024-06-07 16:49:55 +02:00
Ivan Gabriele
cf68a77320 feat(chat)!: change safe_prompt, temperature & top_p to non-Option types
BREAKING CHANGE:
- `Chat::ChatParams.safe_prompt` & `Chat::ChatRequest.safe_prompt` are now `bool` instead of `Option<bool>`. Default is `false`.
- `Chat::ChatParams.temperature` & `Chat::ChatRequest.temperature` are now `f32` instead of `Option<f32>`. Default is `0.7`.
- `Chat::ChatParams.top_p` & `Chat::ChatRequest.top_p` are now `f32` instead of `Option<f32>`. Default is `1.0`.
2024-06-07 16:00:10 +02:00
Ivan Gabriele
e61ace9a18 test(chat): simplify chat response message content check to cover variations 2024-06-07 14:36:49 +02:00
Ivan Gabriele
64034402ca build(makefile): fix env file loading 2024-06-07 14:36:48 +02:00
Nick Anderson
85c3611afb feat(chat): add response_format for JSON return values 2024-06-07 14:36:37 +02:00
seurimas
da5fe54115 fix(chat): skip serializing tool_calls if null, to avoid 422 error 2024-06-07 14:12:22 +02:00
Ivan Gabriele
7a5e0679c1 ci(release): v0.9.0 v0.9.0 2024-04-13 14:06:55 +02:00
Ivan Gabriele
99d9d099e2 docs(changelog): update 2024-04-13 13:56:20 +02:00
Ivan Gabriele
91fb775132 ci(makefile): fix conventional-changelog-cli suffix 2024-04-13 13:55:22 +02:00
Ivan Gabriele
7474aa6730 ci(makefile): prefix conventional-changelog with npx 2024-04-13 13:54:05 +02:00
Ivan Gabriele
6a99eca49c fix!: fix typo in OpenMixtral8x7b model name (#8)
BREAKING CHANGE: `Model.OpenMistral8x7b` has been renamed to `Model.OpenMixtral8x7b`.
2024-04-13 13:49:54 +02:00
renovate[bot]
fccd59c0cc fix(deps): update rust crate reqwest to 0.12.0 (#6)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-13 13:38:35 +02:00
Ivan Gabriele
a463cb3106 docs(github): update issue templates 2024-03-10 04:36:08 +01:00
Ivan Gabriele
8bee874bd4 ci(release): v0.8.0 v0.8.0 2024-03-09 11:45:06 +01:00
Ivan Gabriele
16464a4c3d docs(changelog): update 2024-03-09 11:44:57 +01:00
Ivan Gabriele
a4c2d4623d ci(github): fix examples test 2024-03-09 11:43:06 +01:00
Ivan Gabriele
ab91154d35 docs(readme): update examples 2024-03-09 11:41:39 +01:00
Ivan Gabriele
74bf8a96ee feat!: add function calling support to client.chat() & client.chat_async()
BREAKING CHANGE: Too many to count in this version. Check the README examples.
2024-03-09 11:40:07 +01:00
Ivan Gabriele
9430d42382 ci(release): v0.7.0 v0.7.0 2024-03-05 02:49:59 +01:00
Ivan Gabriele
e7d844dce9 docs(changelog): update 2024-03-05 02:49:52 +01:00
Ivan Gabriele
29566f7948 ci(github): split documentation tests into a separate job 2024-03-05 02:48:24 +01:00