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

Functions for working with `LangChain.GeneratedImage` files.

# `save_images`
[🔗](https://github.com/brainlid/langchain/blob/v0.13.0/lib/images.ex#L16)

```elixir
@spec save_images(
  [LangChain.Images.GeneratedImage.t()],
  path :: String.t(),
  filename_prefix :: String.t()
) :: {:ok, [String.t()]} | {:error, String.t()}
```

Save a list of `%GeneratedImage{}` images.

Pipe friendly for handling the result a `LangChain.Images.OpenAIImage.call/1`
where it handles a success or passes the error result through.

# `save_to_file`
[🔗](https://github.com/brainlid/langchain/blob/v0.13.0/lib/images.ex#L54)

```elixir
@spec save_to_file(LangChain.Images.GeneratedImage.t(), String.t()) ::
  :ok | {:error, String.t()}
```

Save the generated image file to a local directory. If the GeneratedFile is an
URL, it is first downloaded then saved. If the is a Base64 encoded image, it
is decoded and saved.

---

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