When using the Guzzle client and middleware to log requests/responses in the \Anthropic\Transporters\HttpTransporter::requestObject() method, when calling $response->getBody()->getContents() the result is an empty string. This is a well known old issue https://github.com/guzzle/guzzle/issues/1582
and it produce an error: Syntax error
Perhaps to solve the problem it is worth using cast to string or calling the __toString() method or rewind body
Description
When using the Guzzle client and middleware to log requests/responses in the \Anthropic\Transporters\HttpTransporter::requestObject() method, when calling $response->getBody()->getContents() the result is an empty string. This is a well known old issue https://github.com/guzzle/guzzle/issues/1582
and it produce an error: Syntax error
Perhaps to solve the problem it is worth using cast to string or calling the __toString() method or rewind body
Steps To Reproduce
OpenAI PHP Client Version
v0.8.5
PHP Version
8.1.20
Notes
No response