![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /home/fdshops/public_html/vendor/openai-php/client/src/Resources/ |
<?php declare(strict_types=1); namespace OpenAI\Resources; use OpenAI\Contracts\Resources\ImagesContract; use OpenAI\Responses\Images\CreateResponse; use OpenAI\Responses\Images\EditResponse; use OpenAI\Responses\Images\VariationResponse; use OpenAI\ValueObjects\Transporter\Payload; final class Images implements ImagesContract { use Concerns\Transportable; /** * Creates an image given a prompt. * * @see https://beta.openai.com/docs/api-reference/images/create * * @param array<string, mixed> $parameters */ public function create(array $parameters): CreateResponse { $payload = Payload::create('images/generations', $parameters); /** @var array{created: int, data: array<int, array{url?: string, b64_json?: string}>} $result */ $result = $this->transporter->requestObject($payload); return CreateResponse::from($result); } /** * Creates an edited or extended image given an original image and a prompt. * * @see https://beta.openai.com/docs/api-reference/images/create-edit * * @param array<string, mixed> $parameters */ public function edit(array $parameters): EditResponse { $payload = Payload::upload('images/edits', $parameters); /** @var array{created: int, data: array<int, array{url?: string, b64_json?: string}>} $result */ $result = $this->transporter->requestObject($payload); return EditResponse::from($result); } /** * Creates a variation of a given image. * * @see https://beta.openai.com/docs/api-reference/images/create-variation * * @param array<string, mixed> $parameters */ public function variation(array $parameters): VariationResponse { $payload = Payload::upload('images/variations', $parameters); /** @var array{created: int, data: array<int, array{url?: string, b64_json?: string}>} $result */ $result = $this->transporter->requestObject($payload); return VariationResponse::from($result); } }