CMDCRAGArcana.Pipeline.StepSpec (cmdc_rag_arcana v0.4.0)

Copy Markdown View Source

Arcana Pipeline step 的白名单配置。

本结构只表达企业预配置 preset 中允许的 step 和 option。它不会接受 runtime function、prompt function 或未知 option,避免 Agent 通过 tool args 动态拼装不可治理的 Pipeline。

Summary

Functions

返回允许的 Arcana Pipeline step。

构建并校验 step spec。

转换为可传给 Arcana step 的 keyword opts。

转换为稳定 map,供 Tool 输出和 docs 使用。

Types

step()

@type step() ::
  :gate
  | :select
  | :rewrite
  | :expand
  | :decompose
  | :search
  | :reason
  | :rerank
  | :answer
  | :self_correct
  | :ground

t()

@type t() :: %CMDCRAGArcana.Pipeline.StepSpec{
  enabled?: boolean(),
  name: step(),
  opts: map()
}

Functions

allowed_steps()

@spec allowed_steps() :: [step()]

返回允许的 Arcana Pipeline step。

new!(spec)

@spec new!(t() | atom() | String.t() | keyword() | map()) :: t()

构建并校验 step spec。

to_keyword(step_spec)

@spec to_keyword(t()) :: keyword()

转换为可传给 Arcana step 的 keyword opts。

to_map(spec)

@spec to_map(t()) :: map()

转换为稳定 map,供 Tool 输出和 docs 使用。