struct

AI::Provider::ImageModel::File

Inherits JSON::Serializable < Struct < Value < Object

An image file that can be used for image editing or variation generation.

Constructors

new(type : FileType, media_type : String | Nil = nil, data : String | Bytes | Nil = nil, url : String | Nil = nil, provider_options : Shared::ProviderOptions | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source
new_file(*, media_type : String, data : String | Bytes, provider_options : Shared::ProviderOptions | Nil = nil) : File

Creates a file with binary or base64 data.

Source
new_url(*, url : String, provider_options : Shared::ProviderOptions | Nil = nil) : File

Creates a URL file reference.

Source

Instance methods

data

File data as base64 encoded string or binary (for file type).

Source
media_type

The IANA media type of the file (for file type).

Source
provider_options

Optional provider-specific options for the file.

Source
type

The type of file reference (file data or URL).

Source
url

The URL of the image file (for url type).

Source