}> */ final class ThreadRunResponseRequiredActionSubmitToolOutputs implements ResponseContract { /** * @use ArrayAccessible}> */ use ArrayAccessible; use Fakeable; /** * @param array $toolCalls */ private function __construct( public array $toolCalls, ) { } /** * Acts as static factory, and returns a new Response instance. * * @param array{tool_calls: array} $attributes */ public static function from(array $attributes): self { $toolCalls = array_map(fn (array $toolCall): ThreadRunResponseRequiredActionFunctionToolCall => ThreadRunResponseRequiredActionFunctionToolCall::from($toolCall), $attributes['tool_calls']); return new self( $toolCalls, ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'tool_calls' => array_map(fn (ThreadRunResponseRequiredActionFunctionToolCall $toolCall): array => $toolCall->toArray(), $this->toolCalls), ]; } }