Perplexed.Config (Perplexed v0.1.0)

Copy Markdown View Source

Perplexed's settings.

A host passes them when it starts Perplexed, {Perplexed, settings} in its supervision tree; they are kept in :persistent_term. A setting not given there falls back to config :perplexed, so a standalone project can use ordinary application config.

KeyUsed by
:modelPerplexed.answer/2 default model
:providerDefault search provider spec
:ladderDefault scrape ladder
:pricesSearch price overrides, by provider spec
:cloudflare_account_idCloudflare search, Browser Run
:cloudflare_api_tokenCloudflare search, Browser Run
:cloudflare_gateway_idCloudflare search (default "default")
:deepseek_api_keyDeepSeek search
:firecrawl_api_keyFirecrawl search and scrape
:pdf_converterPerplexed.PdfConverter implementation
:url_validatorPerplexed.UrlGuard override

Summary

Functions

The started settings.

A credential for provider: the call's opts[:credentials][key] when given, else the setting. {:ok, value}, or an :authentication error naming the missing key when it is unset or blank.

The setting for key, or default when unset.

Functions

all()

@spec all() :: keyword()

The started settings.

credential(key, provider, opts \\ [])

@spec credential(atom(), atom(), keyword()) ::
  {:ok, String.t()} | {:error, {:authentication, map()}}

A credential for provider: the call's opts[:credentials][key] when given, else the setting. {:ok, value}, or an :authentication error naming the missing key when it is unset or blank.

get(key, default \\ nil)

@spec get(atom(), term()) :: term()

The setting for key, or default when unset.