PendingImageGeneration
class PendingImageGeneration
Traits
Properties
| protected array<string, string>|SerializableClosure | $headers | from ResolvesProviderOptions | |
| protected array<string, mixed>|SerializableClosure | $providerOptions | from ResolvesProviderOptions | |
| array | $attachments | ||
| string|null | $size | ||
| string|null | $quality | ||
| int|null | $timeout |
Methods
Apply the callback if the given "value" is (or resolves to) truthy.
Apply the callback if the given "value" is (or resolves to) falsy.
Specify HTTP headers for the request. Closures may only capture serializable values.
Resolve the request body options and HTTP headers for the given provider.
Get the serializable provider options recorded by queued fakes.
Create a pending image generation.
Provide the reference images that should be sent with the request.
Specify the size / aspect ratio of the generated image.
Indicate that the generated image should have a square aspect ratio.
Indicate that the generated image should have a portrait aspect ratio.
Indicate that the generated image should have a landscape aspect ratio.
Specify the quality of the generated image.
Specify the timeout for the image generation request.
Ensure all of the attachments are queueable.
Details
in
Conditionable at line 23
mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) truthy.
in
Conditionable at line 56
mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)
Apply the callback if the given "value" is (or resolves to) falsy.
in
ResolvesProviderOptions at line 24
ResolvesProviderOptions
withHeaders(array|Closure $headers)
Specify HTTP headers for the request. Closures may only capture serializable values.
in
ResolvesProviderOptions at line 38
ResolvesProviderOptions
withProviderOptions(array|Closure $options)
Specify provider-specific options for the request.
in
ResolvesProviderOptions at line 54
protected array
resolveProviderOptionsAndHeaders(Provider $provider)
Resolve the request body options and HTTP headers for the given provider.
Unlike upstream, accept the contract so custom provider implementations need not extend the base class.
in
ResolvesProviderOptions at line 67
protected array
queuedProviderOptions()
Get the serializable provider options recorded by queued fakes.
at line 42
__construct(string $prompt)
Create a pending image generation.
at line 54
PendingImageGeneration
attachments(array $attachments)
Provide the reference images that should be sent with the request.
at line 64
PendingImageGeneration
size(string $size)
Specify the size / aspect ratio of the generated image.
at line 74
PendingImageGeneration
square()
Indicate that the generated image should have a square aspect ratio.
at line 84
PendingImageGeneration
portrait()
Indicate that the generated image should have a portrait aspect ratio.
at line 94
PendingImageGeneration
landscape()
Indicate that the generated image should have a landscape aspect ratio.
at line 106
PendingImageGeneration
quality(string $quality)
Specify the quality of the generated image.
at line 116
PendingImageGeneration
timeout(int|null $timeout)
Specify the timeout for the image generation request.
at line 128
ImageResponse
generate(Provider|Lab|array|string|null $provider = null, string|null $model = null)
Generate the image.
at line 173
QueuedImageResponse
queue(Provider|Lab|array|string|null $provider = null, string|null $model = null)
Queue the generation of an image.
at line 200
protected void
ensureAttachmentsAreQueueable()
Ensure all of the attachments are queueable.