# `LangChain.Utils.BedrockConfig`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/utils/bedrock_config.ex#L1)

Configuration for AWS Bedrock.

## Examples

For applications hosted in AWS, [ExAws](https://hex.pm/packages/ex_aws) caches
temporary credentials (when running on AWS), so in the credentials function
you can pull the current cached credentials from `ExAws`.

    ChatAnthropic.new!(%{
      model: "anthropic.claude-sonnet-4-6",
      bedrock: %{
        credentials: fn ->
          ExAws.Config.new(:s3)
          |> Map.take([:access_key_id, :secret_access_key])
          |> Map.to_list()
        end,
        region: "us-west-2"
      }
    })

For applications hosted anywhere, you can configure the Bedrock settings into
the LangChain config like this (recommended for `config/runtime.exs`):

    config :langchain,
      aws_access_key_id: System.fetch_env!("AWS_ACCESS_KEY_ID"),
      aws_secret_access_key: System.fetch_env!("AWS_SECRET_ACCESS_KEY"),
      aws_region: System.get_env("AWS_REGION", "us-west-1"),
      aws_session_token: System.get_env("AWS_SESSION_TOKEN") # optional

Then, when you want to later use a Bedrock Anthropic model, this is will load
it:

      ChatAnthropic.new!(%{
        model: "anthropic.claude-sonnet-4-6",
        bedrock: BedrockConfig.from_application_env!()
      })

# `t`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/utils/bedrock_config.ex#L54)

```elixir
@type t() :: %LangChain.Utils.BedrockConfig{
  anthropic_version: term(),
  credentials: term(),
  region: term()
}
```

# `aws_sigv4_opts`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/utils/bedrock_config.ex#L65)

# `changeset`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/utils/bedrock_config.ex#L59)

# `from_application_env!`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/utils/bedrock_config.ex#L91)

Loads the Bedrock config settings from the previously configured Application settings.

`config/runtime.exs`:

    config :langchain,
      aws_access_key_id: System.fetch_env!("AWS_ACCESS_KEY_ID"),
      aws_secret_access_key: System.fetch_env!("AWS_SECRET_ACCESS_KEY"),
      aws_region: System.get_env("AWS_REGION", "us-west-1"),
      aws_session_token: System.get_env("AWS_SESSION_TOKEN") # optional

# `url`
[🔗](https://github.com/brainlid/langchain/blob/v0.6.2/lib/utils/bedrock_config.ex#L72)

---

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