2024-03-03 15:20:30 +01:00
|
|
|
[package]
|
|
|
|
|
name = "mistralai-client"
|
|
|
|
|
description = "Mistral AI API client library for Rust (unofficial)."
|
|
|
|
|
license = "Apache-2.0"
|
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
2026-03-24 21:16:39 +00:00
|
|
|
version = "1.2.0"
|
2024-03-03 15:39:16 +01:00
|
|
|
|
2024-03-03 15:20:30 +01:00
|
|
|
edition = "2021"
|
2024-03-03 15:39:16 +01:00
|
|
|
rust-version = "1.76.0"
|
|
|
|
|
|
2026-03-20 18:23:17 +00:00
|
|
|
authors = ["Sunbeam Studios <hello@sunbeam.pt>"]
|
2024-03-03 15:39:16 +01:00
|
|
|
categories = ["api-bindings"]
|
2026-03-20 18:23:17 +00:00
|
|
|
homepage = "https://sunbeam.pt"
|
2024-03-03 15:43:18 +01:00
|
|
|
keywords = ["mistral", "mistralai", "client", "api", "llm"]
|
2024-03-03 15:39:16 +01:00
|
|
|
readme = "README.md"
|
2026-03-20 18:11:26 +00:00
|
|
|
repository = "https://src.sunbeam.pt/studio/mistralai-client-rs"
|
|
|
|
|
publish = ["sunbeam"]
|
2024-03-03 15:20:30 +01:00
|
|
|
|
|
|
|
|
[dependencies]
|
2026-03-20 17:54:09 +00:00
|
|
|
async-stream = "0.3"
|
|
|
|
|
async-trait = "0.1"
|
|
|
|
|
env_logger = "0.11"
|
|
|
|
|
futures = "0.3"
|
|
|
|
|
log = "0.4"
|
|
|
|
|
reqwest = { version = "0.12", features = ["json", "blocking", "stream", "multipart"] }
|
|
|
|
|
serde = { version = "1", features = ["derive"] }
|
|
|
|
|
serde_json = "1"
|
|
|
|
|
thiserror = "2"
|
|
|
|
|
tokio = { version = "1", features = ["full"] }
|
|
|
|
|
tokio-stream = "0.1"
|
2024-03-03 15:20:30 +01:00
|
|
|
|
|
|
|
|
[dev-dependencies]
|
2026-03-20 17:54:09 +00:00
|
|
|
jrest = "0.2"
|