Zep.Config (Zep v1.0.0)

Copy Markdown View Source

Resolves client configuration from explicit options, application environment, and OS environment variables, in that order of precedence.

config :zep,
  api_key: "z_...",
  base_url: "https://api.getzep.com",
  receive_timeout: 30_000

Any of these may be overridden per-call by passing a %Zep.Client{} built with Zep.Client.new/1, or by passing the same keys as opts to a resource function.

Summary

Functions

Builds a %Zep.Config{} by merging (in increasing precedence)

Types

t()

@type t() :: %Zep.Config{
  api_key: String.t() | nil,
  base_url: String.t(),
  finch_pool_options: keyword(),
  max_retries: non_neg_integer(),
  receive_timeout: pos_integer()
}

Functions

resolve(opts \\ [])

@spec resolve(keyword()) :: t()

Builds a %Zep.Config{} by merging (in increasing precedence):

  1. library defaults
  2. Application.get_env(:zep, ...)
  3. the ZEP_API_KEY / ZEP_BASE_URL OS environment variables
  4. the opts keyword list passed in

Raises Zep.ConfigError if no API key can be resolved.