CMDCTest.RAG.Policy (cmdc_test v0.2.0)

Copy Markdown View Source

RAG / GraphRAG 测试策略 helper。

目标是让集成测试可以一行生成 ctx.user_data,默认把 RAG runtime 指向 CMDCTest.RAG.* fake backend,同时保留 collection ACL、pipeline preset 与 GraphRAG opt-in 配置。

Summary

Functions

生成 collection policy fixture。

生成 GraphRAG routing policy fixture。

生成 GraphRAG profile fixture。

生成 pipeline preset fixture。

生成可放进 CMDC.Context.user_data 的 RAG 测试配置。

Functions

collection_policy(collection \\ "policies", opts \\ [])

@spec collection_policy(String.t(), keyword() | map()) :: map()

生成 collection policy fixture。

graph_policy(collections \\ ["policies"], opts \\ [])

@spec graph_policy([String.t()], keyword() | map()) :: map()

生成 GraphRAG routing policy fixture。

graph_profile(opts \\ [])

@spec graph_profile(keyword() | map()) :: map()

生成 GraphRAG profile fixture。

pipeline_preset(opts \\ [])

@spec pipeline_preset(keyword() | map()) :: map()

生成 pipeline preset fixture。

user_data(opts \\ [])

@spec user_data(keyword() | map()) :: map()

生成可放进 CMDC.Context.user_data 的 RAG 测试配置。