Error types for a Rust library, and a different answer for a binary
A library's error type is public API that callers match on. A binary mostly needs a clear message with context. thiserror and anyhow fit those two jobs.
Topic · 6 stories
6 stories tagged api-design on AI Tamer, newest first.
A library's error type is public API that callers match on. A binary mostly needs a clear message with context. thiserror and anyhow fit those two jobs.
Rust doctests can demonstrate forbidden API use, but compile_fail only checks that compilation fails. A misspelled import can make the lesson appear tested.
A model can request several functions in one turn. The application must decide how to schedule them, match their results, and handle partial failure.
A response can satisfy two JSON Schema branches and still fail validation. This example shows how overlapping object shapes cause that result and how to make the branches distinct.
A list of expected fields does not close a JSON object. Here is how to decide when model-generated objects should reject unknown keys.
A practical guide to server-sent events, WebSockets, provider event streams, tool calls, disconnects and buffering in AI applications.