Per-call credentials for the Qdrant package: resolve(opts) is the one place opts, context and the local default are merged.

Context Vars

Optional
  • qdrant.url
  • qdrant.api.key

Values

DEFAULT_URL

DEFAULT_URL: Str "http://localhost:6333"

Functions

resolve

fn (opts: Map): Map

The instance and key for one call: opts over the context variables over the default URL (see resolve-from). Per-call credentials stay in the call; nothing is written to ctx, so parallel flows and tenants never share them. A credential from opts is masked in the run's call records.

Example

::qdrant::api/resolve({url: "https://tenant-b.qdrant.example", api-key: "tenant-b-key"}).url
// "https://tenant-b.qdrant.example"
Context Vars: qdrant.url, qdrant.api.key

resolve-from

fn (opts: Map, ctx-values: Map): Map

The one resolver, pure: {url, api-key} for a call from opts first, then ctx-values (a Map of context variables), then the local default URL. api-key is "" when the call sends no auth header, which is valid for a local Qdrant, so a missing key is not an error here.

A key is never sent anywhere it wasn't meant for: when opts has a url and no api-key, the context key is not used, because it belongs to the context instance. {url: ..., api-key: ""} and {url: ...} both mean "no auth". An api-key in opts always replaces the context key. Nothing is written to ctx. Exposed for testing; resolve feeds it the context.

Example

::qdrant::api/resolve-from({}, {"qdrant.url": "http://qdrant:6333"})  // {url: "http://qdrant:6333", api-key: ""}

// A per-call URL never borrows the context key
::qdrant::api/resolve-from({url: "https://b.example"}, {"qdrant.api.key": "ctx-key"})  // {url: "https://b.example", api-key: ""}