Skip to content

v1.17.0

Latest

Choose a tag to compare

@anthropic-sdks-releaser anthropic-sdks-releaser released this 03 Dec 18:31

Features

  • api: add the beta analytics list of projects in the new projects experience
  • api: add the organization_url_fetch_disabled error code

Bug Fixes

  • bedrock: report a missing aws/aws-sdk-php when a stream starts, not while it is read

    A Bedrock client needs aws/aws-sdk-php, with its bedrock-runtime service, to decode a streamed response. When the package is not installed, or that service was removed with Aws\Script\Composer\Composer::removeUnusedServices, the exception now comes from the call that starts the stream, such as createStream(), instead of from the first iteration over the stream. Its class and message are unchanged.

  • client: hide credential headers in var_dump and print_r of an exception

    print_r($e) and var_dump($e) now show REDACTED in place of the value of Authorization and other credential headers of $e->request. $e->request itself doesn't change.

  • client: hide secret values when a model is printed

    A property that the API marks as sensitive now prints REDACTED in var_dump, print_r and a string cast. Read the property to get its value.

    A model nested two or more levels deep now prints with its property names, like the levels above it.

  • client: keep credentials out of stack traces

    On PHP 8.2 and later, a stack trace shows Object(SensitiveParameterValue) in place of the client constructor's credentials, of unwrap()'s $secret, and of the request, its headers and its query parameters while a request is sent or its response is read. With zend.exception_ignore_args=0, serialize() on an API exception now throws.

  • client: keep the client's extra headers on calls that set their own

    To leave one of them out of a call, set that header to null in the call's extraHeaders.

  • client: leave a model unchanged when it is printed

  • client: name the host and the cause in connection error messages

  • client: use the API's error message, not the whole response body, as the error message

    The message also shows the path of the request. An error from a client that changes the URL before sending, such as the Bedrock and Vertex clients, now has the method, host and path that were sent, and so does the request of a raw response.

  • credentials: keep a base URL's password out of token endpoint errors

    A token endpoint URL that holds an @ is left out of the Token endpoint URL must use HTTPS error. Token exchange request failed and Refresh token request failed also leave out the HTTP client's reason when that URL or the reason itself holds an @, as a reason that quotes a proxy URL can. The reason is still on the previous exception. A URL that the PSR-17 request factory can't parse now fails with the same OAuthException, and the factory's InvalidArgumentException is its previous exception.

  • streaming: raise the connection error when a stream's connection drops

    A stream whose connection drops used to throw the HTTP client's \RuntimeException, and now throws Anthropic\Core\Exceptions\APIConnectionException with the original exception as getPrevious().
    APIConnectionException does not extend \RuntimeException, so code that catches \RuntimeException around a stream should catch APIConnectionException instead.
    A stream that ends before the length in its Content-Length header now throws APIConnectionException too, where it used to end as if it were complete.
    The request is not sent again.

Chores

  • docs: clarify what a federation rule's match must contain
  • docs: update example request bodies
  • docs: use example.com in example email addresses
  • internal: add this repository's review rules
  • tests: check which request an error has on the Bedrock and Vertex clients

Documentation

  • api: clarify that max_tokens applies to each model call
  • api: clarify when SCIM-provisioned RBAC groups can be changed
  • api: say to retry storage_not_ready in a minute