FakeImageGateway
class FakeImageGateway implements ImageGateway
Properties
| protected int | $currentResponseIndex | ||
| protected bool | $preventStrayGenerations |
Methods
generateImage(ImageProvider $provider, string $model, string $prompt, array $attachments = [], string|null $size = null, string|null $quality = null, int|null $timeout = null, array $providerOptions = [])
Generate an image.
nextResponse(ImageProvider $provider, string $model, ImagePrompt $prompt)
Get the next response instance.
marshalResponse(mixed $response, ImageProvider $provider, string $model, ImagePrompt $prompt)
Marshal the given response into a full response instance.
preventStrayImages(bool $prevent = true)
Indicate that an exception should be thrown if any image generation is not faked.
Details
at line 29
__construct(Closure|array $responses = [])
Create an image gateway with fake responses.
at line 41
ImageResponse
generateImage(ImageProvider $provider, string $model, string $prompt, array $attachments = [], string|null $size = null, string|null $quality = null, int|null $timeout = null, array $providerOptions = [])
Generate an image.
at line 59
protected ImageResponse
nextResponse(ImageProvider $provider, string $model, ImagePrompt $prompt)
Get the next response instance.
at line 79
protected ImageResponse
marshalResponse(mixed $response, ImageProvider $provider, string $model, ImagePrompt $prompt)
Marshal the given response into a full response instance.
at line 114
FakeImageGateway
preventStrayImages(bool $prevent = true)
Indicate that an exception should be thrown if any image generation is not faked.
When the shared manager holds this fake gateway, the setting affects every request in the worker.