View Source LangChain.Images.OpenAIImage (LangChain v0.3.0-rc.0)
Represents the OpenAI Images API endpoint for working with DALL-E-2 and DALL-E-3.
Parses and validates inputs for making a request from the OpenAI Image API.
Converts responses into more specialized LangChain
data structures and
provide functions for saving generated images.
Summary
Functions
Calls the OpenAI API passing the OpenAIImage struct with configuration.
Return the params formatted for an API request.
Setup a OpenAIImage client configuration.
Setup a OpenAIImage client configuration and return it or raise an error if invalid.
Types
Functions
@spec call(t()) :: {:ok, [LangChain.Images.GeneratedImage.t()]} | {:error, String.t()}
Calls the OpenAI API passing the OpenAIImage struct with configuration.
When successful, it returns {:ok, generated_images}
where that is a list of
LangChain.Images.GeneratedImage
structs.
Return the params formatted for an API request.
@spec new(attrs :: map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Setup a OpenAIImage client configuration.
Setup a OpenAIImage client configuration and return it or raise an error if invalid.