Releases: motosan-dev/motosan-ai
Releases · motosan-dev/motosan-ai
Rust v0.4.0 — Vision/Multimodal Support
What's New
Added
- Vision / Multimodal content support — send images alongside text in messages
ContentBlockenum:Text { text }andImage { source }variantsImageSourceenum:Base64 { media_type, data }andUrl { url }variants- Helper:
Message::user_with_image(text, base64_data, media_type)
- Retry with exponential backoff for transient errors
RetryPolicystruct:max_retries,base_delay_ms,max_delay_ms,jitter,respect_retry_after- Auto-retry on 429, 500, 502, 503 with jittered backoff
Retry-Afterheader respected when present
ThinkStripperiterator adapter for filtering<think>blocks from streaming
Changed
ChatResponse.contentis nowVec<ContentBlock>(wasString)Messagecontent field supports bothStringandVec<ContentBlock>
Published to crates.io: https://crates.io/crates/motosan-ai/0.4.0
v0.3.3
What's Changed
Python SDK
- Remove official SDK dependencies — Anthropic and OpenAI providers rewritten with
httpxdirectly (noanthropic/openaipackages) - Fix OAuth
chat()tool_calls — now correctly collects tool calls from stream events - Fix OAuth system prompt — sent as separate blocks instead of merged string
- All mock tests migrated to
respx
Rust SDK
- Fix OAuth
chat()tool_calls — collectsToolCallStart/Args/EndintoChatResponse.tool_calls - Fix OAuth system prompt — prefix block with
cache_control+ user system as separate block
Both SDKs
- 7 live Anthropic integration tests — chat, stream, system prompt, temperature, tool use (single + multi-turn), stream + tool use
- Pre-push gate (
scripts/pre-push-gate.sh) — blocks push unless unit + live tests pass - Updated all docs: READMEs, AGENTS.md, architecture doc, CHANGELOGs
Python v0.4.2 — Retry with Backoff
What's New
Added
- Retry with exponential backoff for transient errors
max_retriesparameter onClientconstructor and all classmethods- Auto-retry on 429, 5xx, and network errors (default
max_retries=3) Retry-Afterheader parsing
v0.4.1
- Vision/multimodal support (
ContentBlock,ImageSource)
v0.4.0
ThinkStripperfor filtering<think>blocks from streaming- Ollama native provider
Published to PyPI: https://pypi.org/project/motosan-ai/0.4.2/
v0.3.2
Anthropic tool_call_id fix + ThinkStripper
Fixes
- Anthropic stream tool_call_id (Python + Rust):
tool_call_argsandtool_call_endevents now carry the correcttool_call_idfrom the precedingcontent_block_start. PreviouslyNone→ broke downstream tool assembly.
New Features
- ThinkStripper: Stateful
<think>...</think>tag removal that handles split tags across chunk boundaries. Applied atClient.stream()level — all providers benefit automatically. ThinkStripper.flush()for remaining buffered text on stream end
Install
- Python:
pip install motosan-ai==0.3.2 - Rust:
cargo add motosan-ai@0.3.2
Closes
v0.3.1
Streaming tool call fixes (Ollama + MiniMax + OpenAI)
Fixes
- Ollama (Rust + Python):
stream()now emits proper 3-event sequence (Start → Args → End) per tool call, instead of cramming everything into a singleToolCallStart - MiniMax + OpenAI (Rust):
tool_call_argsevents now includetool_call_id;tool_call_endemitted per tool call with its id (not one global end)
New API
StreamEvent::tool_call_args_with_id(id, delta)— Rust constructorStreamEvent::tool_call_end_with_id(id)— Rust constructor
Install
- Python:
pip install motosan-ai==0.3.1 - Rust:
cargo add motosan-ai@0.3.1
Closes
v0.3.0
stream() tool_use support across all providers
Breaking Changes
None — all new fields have defaults, fully backward compatible.
New Features
StreamEventextended with tool call metadata:tool_call_id,tool_call_name,tool_call_args_delta,event_typeStreamEventTypeenum:text|tool_call_start|tool_call_args|tool_call_end- All 4 providers (Anthropic, OpenAI, MiniMax, Ollama) now parse and emit tool_use events during streaming
- All providers now send
toolsin the streaming request body
Python SDK (motosan-ai 0.3.0)
pip install motosan-ai==0.3.0- https://pypi.org/project/motosan-ai/0.3.0/
Rust SDK (motosan-ai 0.3.0)
cargo add motosan-ai@0.3.0- https://crates.io/crates/motosan-ai/0.3.0
- Helper constructors:
StreamEvent::text(),::done(),::tool_call_start(),::tool_call_args(),::tool_call_end()
Closes
Python v0.2.1 — Ollama Provider
What's New
Added
- Ollama provider (
Provider.Ollama)- OpenAI-compatible endpoint (
/v1/chat/completions) — zero new dependencies - Native
OllamaProviderviaPOST /api/chatwith NDJSON streaming thinkmode for reasoning models (qwen3-thinking, deepseek-r1)keep_alive/num_ctxconfigurationClient.ollama(native=True)to switch between compat and native modes- Tool calls with auto-generated UUID when Ollama omits
id - Default model:
llama3.2
- OpenAI-compatible endpoint (
Install
pip install motosan-ai==0.2.1Usage
from motosan_ai import Client
# OpenAI-compatible (default)
client = Client.ollama(model="llama3.2")
# Native with think mode
client = Client.ollama(model="qwen3", native=True, think=True)
response = await client.chat([{"role": "user", "content": "hello"}])v0.1.4 — stream_with + Anthropic max_tokens fix
What's Changed
Rust SDK
stream_with(ChatRequest)— New method onClientmirroringchat_with, allowing full request control (system prompt, max_tokens, tools, temperature) for streaming calls (#88, PR #90)- Default
max_tokensfor Anthropic — Anthropic provider now defaults tomax_tokens = 4096when not explicitly set, preventing HTTP 400 errors (#89, PR #91)
Bug Fixes
client.stream(messages)no longer fails on Anthropic whenmax_tokensis omittedclient.chat(messages)no longer fails on Anthropic whenmax_tokensis omitted
Full Changelog: v0.1.3...v0.1.4
v0.1.3
Highlights
- Adds multi-turn tool-use support across providers.
Messagenow supports assistant-sidetool_callswithassistant_with_tool_calls().- Anthropic/OpenAI/MiniMax request serialization now preserves assistant tool call context between turns.
- Includes new multi-turn integration tests for all three providers.
Rust Crate
- Published
motosan-aicrate version0.1.3on crates.io.
v0.1.2
Highlights
- Backport tool-call response wiring to release branch.
ChatResponsenow includestool_callsconsistently across Anthropic/OpenAI/MiniMax.- Added integration coverage for tool-call extraction behavior.
Rust Crate
- Published
motosan-aicrate version0.1.2on crates.io.