# `LangChain.Images.GeneratedImage`
[🔗](https://github.com/brainlid/langchain/blob/v0.9.3/lib/images/generated_image.ex#L1)

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"
    })

# `t`
[🔗](https://github.com/brainlid/langchain/blob/v0.9.3/lib/images/generated_image.ex#L36)

```elixir
@type t() :: %LangChain.Images.GeneratedImage{
  content: term(),
  created_at: term(),
  image_type: term(),
  metadata: term(),
  prompt: term(),
  type: term()
}
```

# `new`
[🔗](https://github.com/brainlid/langchain/blob/v0.9.3/lib/images/generated_image.ex#L45)

```elixir
@spec new(attrs :: map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
```

Build a new GeneratedImage and return an `:ok`/`:error` tuple with the result.

# `new!`
[🔗](https://github.com/brainlid/langchain/blob/v0.9.3/lib/images/generated_image.ex#L56)

```elixir
@spec new!(attrs :: map()) :: t() | no_return()
```

Build a new GeneratedImage and return it or raise an error if invalid.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
