CMDCRAGArcana.Pipeline.Policy (cmdc_rag_arcana v0.5.0)

Copy Markdown View Source

Pipeline preset 路由策略。

企业平台可按 tenant、collection、risk level 和 use case 把请求路由到 固定 preset。字段为 nil"*" 或空 collection 时表示通配。

Summary

Functions

判断 policy 是否匹配当前配置。

构建 policy。

转换为稳定 map。

Types

t()

@type t() :: %CMDCRAGArcana.Pipeline.Policy{
  collections: [String.t()],
  metadata: map(),
  preset_id: String.t(),
  risk_level: String.t() | atom() | nil,
  tenant_id: String.t() | nil,
  use_case: String.t() | nil
}

Functions

matches?(policy, config)

@spec matches?(t(), CMDCRAGArcana.Config.t()) :: boolean()

判断 policy 是否匹配当前配置。

new(policy)

@spec new(t() | keyword() | map()) :: t()

构建 policy。

to_map(policy)

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

转换为稳定 map。