Credentials for Tavily.
Per-call credentials. Every API-calling function in ::tavily
takes an optional trailing opts Map, resolved by resolve: opts
first, then the tavily.api.key context variable. Nothing from opts
is written to ctx, so one run can act for many tenants and parallel
flows don't share credentials. Credentials in opts are masked in
call records. An api-key present but blank or null is an error,
never a fallback to context.
api-key: the API key for this call
Context Vars
tavily.api.key
Functions
resolve
fn (opts: Map): Map
The credentials for one call (see resolve-from). An api-key from
opts is masked in this run's records and never written to ctx.
Example
::tavily::api/resolve({api-key: "tvly-tenant-b"}).api-key // "tvly-tenant-b"
tavily.api.key
resolve-from
fn (opts: Map, ctx-values: Map): Map
The one resolver, pure: {api-key} for a call from opts first, then
ctx-values (a Map of context variables). An Err when no API key is
set, or when api-key is in opts but blank or null (that never falls
back to context). Exposed for testing; resolve feeds it the context.
Example
// No key anywhere
is-err(::tavily::api/resolve-from({}, {})) // true
// A blank key in opts never falls back to context
is-err(::tavily::api/resolve-from({api-key: ""}, {})) // true