struct
AI::Provider::ImageModel::File
- AI::Provider::ImageModel::File
- Struct
- Value
- Object
Overview
An image file that can be used for image editing or variation generation.
Included Modules
- JSON::Serializable
Defined in:
ai/provider/image_model/image_model.crConstructors
- .new(pull : JSON::PullParser)
- .new(type : FileType, media_type : String | Nil = nil, data : String | Bytes | Nil = nil, url : String | Nil = nil, provider_options : Shared::ProviderOptions | Nil = nil)
- .new(*, __pull_for_json_serializable pull : JSON::PullParser)
-
.new_file(*, media_type : String, data : String | Bytes, provider_options : Shared::ProviderOptions | Nil = nil) : File
Creates a file with binary or base64 data.
-
.new_url(*, url : String, provider_options : Shared::ProviderOptions | Nil = nil) : File
Creates a URL file reference.
Instance Method Summary
-
#data : String | Bytes | Nil
File data as base64 encoded string or binary (for file type).
-
#media_type : String | Nil
The IANA media type of the file (for file type).
-
#provider_options : Shared::ProviderOptions | Nil
Optional provider-specific options for the file.
-
#type : FileType
The type of file reference (file data or URL).
-
#url : String | Nil
The URL of the image file (for url type).