View Source LangChain.Images.GeneratedImage (LangChain v0.3.1)
Represents a generated image where we have either the base64 encoded contents or a temporary URL to it.
Example
Created when an image generation request completes and we have an image.
GeneratedImage.new!(%{
image_type: :png,
type: :url,
content: "https://example.com/my_image.png",
prompt: "The prompt used for image generation"
})
Summary
Functions
Build a new GeneratedImage and return an :ok
/:error
tuple with the result.
Build a new GeneratedImage and return it or raise an error if invalid.
Types
Functions
@spec new(attrs :: map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
Build a new GeneratedImage and return an :ok
/:error
tuple with the result.
Build a new GeneratedImage and return it or raise an error if invalid.