CMDCRAGArcana.ProgressEvent (cmdc_rag_arcana v0.4.0)

Copy Markdown View Source

RAG 后台任务进度事件的统一 payload。

Summary

Functions

发送 telemetry 与可选 CMDC EventBus plugin event。

构建统一进度事件。

返回 progress plugin event 名称。

Types

event()

@type event() :: :started | :progress | :completed | :failed | atom()

kind()

@type kind() :: :ingestion | :reembed | :graph

t()

@type t() :: %CMDCRAGArcana.ProgressEvent{
  collection: String.t() | nil,
  current: non_neg_integer() | nil,
  document_id: String.t() | nil,
  error: String.t() | nil,
  event: event(),
  kind: kind(),
  metadata: map(),
  occurred_at_ms: integer(),
  operation: atom() | nil,
  percent: float() | nil,
  result: map() | nil,
  run_id: String.t() | nil,
  session_id: String.t() | nil,
  status: atom() | nil,
  tenant_id: String.t() | nil,
  total: non_neg_integer() | nil,
  version_id: String.t() | nil
}

Functions

emit(kind, event, attrs, opts \\ [])

@spec emit(kind(), event(), map() | keyword(), keyword()) :: t()

发送 telemetry 与可选 CMDC EventBus plugin event。

new(kind, event, attrs \\ %{})

@spec new(kind(), event(), map() | keyword()) :: t()

构建统一进度事件。

plugin_event(atom)

@spec plugin_event(kind()) :: atom()

返回 progress plugin event 名称。