From 2b43ad4486ac626ef9d3f240ac57dab8f1dc3613 Mon Sep 17 00:00:00 2001 From: mowangjuanzi Date: Sun, 2 Mar 2025 21:22:47 +0800 Subject: [PATCH] Update CreateResponseMessage.php --- src/Responses/Chat/CreateResponseMessage.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Responses/Chat/CreateResponseMessage.php b/src/Responses/Chat/CreateResponseMessage.php index 48ae62931..bc2954bc0 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; } }