diff --git a/src/Responses/Chat/CreateResponseMessage.php b/src/Responses/Chat/CreateResponseMessage.php index 48ae6293..bc2954bc 100644 --- a/src/Responses/Chat/CreateResponseMessage.php +++ b/src/Responses/Chat/CreateResponseMessage.php @@ -14,6 +14,7 @@ private function __construct( public readonly ?string $content, public readonly array $toolCalls, public readonly ?CreateResponseFunctionCall $functionCall, + public readonly ?string $reasoningContent, ) {} /** @@ -30,6 +31,7 @@ public static function from(array $attributes): self $attributes['content'] ?? null, $toolCalls, isset($attributes['function_call']) ? CreateResponseFunctionCall::from($attributes['function_call']) : null, + $attributes['reasoning_content'] ?? null, ); } @@ -51,6 +53,10 @@ public function toArray(): array $data['tool_calls'] = array_map(fn (CreateResponseToolCall $toolCall): array => $toolCall->toArray(), $this->toolCalls); } + if ($this->reasoningContent) { + $data['reasoning_content'] = $this->reasoningContent; + } + return $data; } }