}}> */ final class ThreadRunResponseToolFunction implements ResponseContract { /** * @use ArrayAccessible}}> */ use ArrayAccessible; use Fakeable; private function __construct( public string $type, public ThreadRunResponseToolFunctionFunction $function, ) { } /** * Acts as static factory, and returns a new Response instance. * * @param array{type: 'function', function: array{description: string, name: string, parameters: array}} $attributes */ public static function from(array $attributes): self { return new self( $attributes['type'], ThreadRunResponseToolFunctionFunction::from($attributes['function']), ); } /** * {@inheritDoc} */ public function toArray(): array { return [ 'type' => $this->type, 'function' => $this->function->toArray(), ]; } }