Repository navigation
1.10.0
·
26 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
What's Changed
Factory::withApiVersion()sets theanthropic-versionheader, so you can opt into API version2026-10-21; the default stays2023-06-01.- Responses keep every field the API sends:
toArray()and array access return fields this release doesn't type yet and fields sent asnull, in the API's order, so a response's content can be sent back to the API unchanged. - Messages responses type the MCP connector blocks (
mcp_tool_usewithserver_name,mcp_tool_resultwithis_error,mcp_tool_listing), advisor results,toolset_nameon computer and browser tool calls, compactionencrypted_contentandtool_changes(and keepsignatureintoArray()), the fallbacktrigger,input_transformations, and fallback credit (stop_details->fallback_credit_token,usage->fallbackCredit). - Streamed Messages events type every field the non-streamed message has: a block start's
signature,caller,toolset_name,server_name,is_errorand the other block fields; amessage_delta'sstop_details(the category of a streamed refusal) andcontainer;context_managementandinput_transformationson the events; a compaction delta'sencrypted_contentand a thinking delta'sestimated_tokens. - Models responses type
lifecycle,line,deprecated_atandretires_at, theserver_toolscapability,xhigheffort, thedisabledandbetween_toolsthinking types, and the betaallowed_fallback_modelsandcompactioncapability. - A batch result's error has its
requestId, andtoArray()includesrequest_idbeside the type and message. meta()types the organization and workspace ID headers,retry-afterand the fast mode rate limits; they also stay incustom.- Token counts type the beta
context_management.original_input_tokensascontextManagement. - Streams and batch results are read 64 KiB at a time instead of byte by byte.
- A Messages stream yields event types the client doesn't know yet instead of dropping them;
pingis still skipped. assertNotSent()accepts a number, likeassertSent(), andClientFakeaccepts a PSR-7 stream for content methods such asfiles()->download().- Classes are no longer
final, so you can extend them;fake()on a subclass of a response builds from the parent's fixture. - The docs cover the newer API features: mid-conversation system messages and tool changes, compaction on demand, the computer and browser toolsets, programmatic tool calling, the MCP connector, the advisor tool, fast mode, fallback credit, refusal categories and streamed refusals, and the current models.
Fixes
- A streamed request that fails with a 4xx or 5xx, such as a 529 overload, throws
ErrorExceptionwith the API's error type instead ofTransporterException. - Every response with a status of 400 or above throws
ErrorException(RateLimitExceptionfor a 429), even when the body isn't the API's JSON. A proxy's HTML page or a plain-text 503 used to throwUnserializableResponseor aTypeError, andfiles()->download()returned the error page as the file. The message is the first line of the page's text. - A tool call without parameters comes out of
toArray()withinputas anArrayObject, which encodes as{}: the API rejects a replayed"input": []. - Streaming an on-demand compaction no longer throws a
TypeError: a block that arrives whole with stringcontentis read as a string. - A model or a list page without some of the documented-nullable fields no longer throws; an errored batch result builds again from its own
toArray(). - A response without
stop_sequenceno longer raises a warning. - A base URI ending in
/no longer doubles the slash in request paths. - In
fake()overrides, a nested item whosetypediffers from the default's replaces it, so a fakedtool_useblock no longer carries the default text. - The tool use docs no longer tell you to skip a tool call made from code execution: such a call is paused code waiting for your result, and the docs show how to answer it.
Deprecated
- The Text Completions resource and
completions()are marked deprecated: the API rejects/v1/completerequests on current models. Use the Messages API.
Upgrading
Streams are read per the SSE spec, so a hand-written fake stream needs a blank line between events. UPGRADING.md lists the other changes that can affect code written against 1.8.
Full Changelog: 1.8.0...1.10.0