struct AI::Provider::ImageModel::File

Overview

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

Included Modules

Defined in:

ai/provider/image_model/image_model.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(pull : JSON::PullParser) #

[View source]
def self.new(type : FileType, media_type : String | Nil = nil, data : String | Bytes | Nil = nil, url : String | Nil = nil, provider_options : Shared::ProviderOptions | Nil = nil) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]
def self.new_file(*, media_type : String, data : String | Bytes, provider_options : Shared::ProviderOptions | Nil = nil) : File #

Creates a file with binary or base64 data.


[View source]
def self.new_url(*, url : String, provider_options : Shared::ProviderOptions | Nil = nil) : File #

Creates a URL file reference.


[View source]

Instance Method Detail

def data : String | Bytes | Nil #

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


[View source]
def media_type : String | Nil #

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


[View source]
def provider_options : Shared::ProviderOptions | Nil #

Optional provider-specific options for the file.


[View source]
def type : FileType #

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


[View source]
def url : String | Nil #

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


[View source]