Repository navigation
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-phpwhen a stream starts, not while it is readA Bedrock client needs
aws/aws-sdk-php, with itsbedrock-runtimeservice, to decode a streamed response. When the package is not installed, or that service was removed withAws\Script\Composer\Composer::removeUnusedServices, the exception now comes from the call that starts the stream, such ascreateStream(), 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)andvar_dump($e)now showREDACTEDin place of the value ofAuthorizationand other credential headers of$e->request.$e->requestitself doesn't change. -
client: hide secret values when a model is printed
A property that the API marks as sensitive now prints
REDACTEDinvar_dump,print_rand 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, ofunwrap()'s$secret, and of the request, its headers and its query parameters while a request is sent or its response is read. Withzend.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 theToken endpoint URL must use HTTPSerror.Token exchange request failedandRefresh token request failedalso 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 sameOAuthException, and the factory'sInvalidArgumentExceptionis 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 throwsAnthropic\Core\Exceptions\APIConnectionExceptionwith the original exception asgetPrevious().
APIConnectionExceptiondoes not extend\RuntimeException, so code that catches\RuntimeExceptionaround a stream should catchAPIConnectionExceptioninstead.
A stream that ends before the length in itsContent-Lengthheader now throwsAPIConnectionExceptiontoo, 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