Thanks for your anthropic client. I assume, you left out tool calls for your client.
When you provide tools for claude to use, the response content will not contain a "text" attribute, but the attributes for the tool, therefor "id", "name" and "input". This will break your implementation:
`?php
namespace Anthropic\Response;
final class CreateResponseMessage
{
private function __construct(
public readonly string $type,
public readonly string $content,
) {
}
public static function from(array $attributes)
{
return new self(
$attributes['type'],
$attributes['text'],
);
}
public function toArray()
{
return [
'type' => $this->type,
'content' => $this->content,
];
}
Thanks for your anthropic client. I assume, you left out tool calls for your client.
When you provide tools for claude to use, the response content will not contain a "text" attribute, but the attributes for the tool, therefor "id", "name" and "input". This will break your implementation:
`?php
namespace Anthropic\Response;
final class CreateResponseMessage {
}`
Here is the OpenAi PHP CreateMessageResponse equivalent: https://github.com/openai-php/client/blob/main/src/Responses/Chat/CreateResponseMessage.php