Skip to content

Releases: motosan-dev/motosan-ai

Rust v0.4.0 — Vision/Multimodal Support

21 Mar 15:35

Choose a tag to compare

What's New

Added

  • Vision / Multimodal content support — send images alongside text in messages
    • ContentBlock enum: Text { text } and Image { source } variants
    • ImageSource enum: Base64 { media_type, data } and Url { url } variants
    • Helper: Message::user_with_image(text, base64_data, media_type)
  • Retry with exponential backoff for transient errors
    • RetryPolicy struct: max_retries, base_delay_ms, max_delay_ms, jitter, respect_retry_after
    • Auto-retry on 429, 500, 502, 503 with jittered backoff
    • Retry-After header respected when present
  • ThinkStripper iterator adapter for filtering <think> blocks from streaming

Changed

  • ChatResponse.content is now Vec<ContentBlock> (was String)
  • Message content field supports both String and Vec<ContentBlock>

Published to crates.io: https://crates.io/crates/motosan-ai/0.4.0

v0.3.3

18 Mar 03:07

Choose a tag to compare

What's Changed

Python SDK

  • Remove official SDK dependencies — Anthropic and OpenAI providers rewritten with httpx directly (no anthropic/openai packages)
  • 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 — collects ToolCallStart/Args/End into ChatResponse.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

21 Mar 15:35

Choose a tag to compare

What's New

Added

  • Retry with exponential backoff for transient errors
    • max_retries parameter on Client constructor and all classmethods
    • Auto-retry on 429, 5xx, and network errors (default max_retries=3)
    • Retry-After header parsing

v0.4.1

  • Vision/multimodal support (ContentBlock, ImageSource)

v0.4.0

  • ThinkStripper for filtering <think> blocks from streaming
  • Ollama native provider

Published to PyPI: https://pypi.org/project/motosan-ai/0.4.2/

v0.3.2

16 Mar 01:12
bd135c7

Choose a tag to compare

Anthropic tool_call_id fix + ThinkStripper

Fixes

  • Anthropic stream tool_call_id (Python + Rust): tool_call_args and tool_call_end events now carry the correct tool_call_id from the preceding content_block_start. Previously None → broke downstream tool assembly.

New Features

  • ThinkStripper: Stateful <think>...</think> tag removal that handles split tags across chunk boundaries. Applied at Client.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

15 Mar 16:17
5eda3fc

Choose a tag to compare

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 single ToolCallStart
  • MiniMax + OpenAI (Rust): tool_call_args events now include tool_call_id; tool_call_end emitted per tool call with its id (not one global end)

New API

  • StreamEvent::tool_call_args_with_id(id, delta) — Rust constructor
  • StreamEvent::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

15 Mar 14:13
dffff11

Choose a tag to compare

stream() tool_use support across all providers

Breaking Changes

None — all new fields have defaults, fully backward compatible.

New Features

  • StreamEvent extended with tool call metadata: tool_call_id, tool_call_name, tool_call_args_delta, event_type
  • StreamEventType enum: 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 tools in the streaming request body

Python SDK (motosan-ai 0.3.0)

Rust SDK (motosan-ai 0.3.0)

Closes

  • #101 — [Python] stream() 不支援 tool_use blocks
  • #103 — [Rust] stream() 加 tool_use 支援

Python v0.2.1 — Ollama Provider

15 Mar 13:37
892cd14

Choose a tag to compare

What's New

Added

  • Ollama provider (Provider.Ollama)
    • OpenAI-compatible endpoint (/v1/chat/completions) — zero new dependencies
    • Native OllamaProvider via POST /api/chat with NDJSON streaming
    • think mode for reasoning models (qwen3-thinking, deepseek-r1)
    • keep_alive / num_ctx configuration
    • Client.ollama(native=True) to switch between compat and native modes
    • Tool calls with auto-generated UUID when Ollama omits id
    • Default model: llama3.2

Install

pip install motosan-ai==0.2.1

Usage

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

12 Mar 15:21

Choose a tag to compare

What's Changed

Rust SDK

  • stream_with(ChatRequest) — New method on Client mirroring chat_with, allowing full request control (system prompt, max_tokens, tools, temperature) for streaming calls (#88, PR #90)
  • Default max_tokens for Anthropic — Anthropic provider now defaults to max_tokens = 4096 when not explicitly set, preventing HTTP 400 errors (#89, PR #91)

Bug Fixes

  • client.stream(messages) no longer fails on Anthropic when max_tokens is omitted
  • client.chat(messages) no longer fails on Anthropic when max_tokens is omitted

Full Changelog: v0.1.3...v0.1.4

v0.1.3

11 Mar 13:34

Choose a tag to compare

Highlights

  • Adds multi-turn tool-use support across providers.
  • Message now supports assistant-side tool_calls with assistant_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-ai crate version 0.1.3 on crates.io.

v0.1.2

11 Mar 13:06

Choose a tag to compare

Highlights

  • Backport tool-call response wiring to release branch.
  • ChatResponse now includes tool_calls consistently across Anthropic/OpenAI/MiniMax.
  • Added integration coverage for tool-call extraction behavior.

Rust Crate

  • Published motosan-ai crate version 0.1.2 on crates.io.