Zep.Task (Zep v1.0.0)

Copy Markdown View Source

Status polling for asynchronous, long-running Zep operations (e.g. bulk ingestion, pattern detection jobs).

Summary

Functions

Polls a task until it reaches a terminal status ("completed" or "failed"), or :timeout elapses.

Fetches the current status of a task by task_id.

Functions

await(client_or_opts, task_id, opts \\ [])

@spec await(Zep.Client.t() | keyword(), String.t(), keyword()) ::
  {:ok, Zep.Schemas.Task.t()} | {:error, :timeout | term()}

Polls a task until it reaches a terminal status ("completed" or "failed"), or :timeout elapses.

Options

  • :poll_interval - ms between polls (default 1000)
  • :timeout - overall ms budget before giving up (default 60_000)

get(client_or_opts, task_id)

@spec get(Zep.Client.t() | keyword(), String.t()) ::
  {:ok, Zep.Schemas.Task.t()} | {:error, term()}

Fetches the current status of a task by task_id.