CMDCTest.RAG.Fixtures (cmdc_test v0.3.1)

Copy Markdown View Source

RAG / GraphRAG 测试 fixture 工厂。

这些 fixture 使用 cmdc_rag_arcana 的稳定 JSON 形状,但不依赖真实 Arcana、 Ecto Repo、GraphStore 或 LLM。集成方可以直接把返回值喂给 Tool / Gateway / Eval / AgentOps contract test。

Summary

Functions

生成 answer 工具 JSON。

生成一个 Arcana chunk 风格的检索结果。

生成默认 top-k chunk 列表。

生成 citation map。默认保留 provenance,不填正文。

生成 RAG 插件事件 payload。

生成 GraphRAG evidence map。

生成 rag_graph_search 工具 JSON。

生成 GraphRAG 状态 map。

生成 rag_graph_status 工具 JSON。

生成知识库索引状态 map。

生成 rag_ingest_status 工具 JSON。

生成 rag_pipeline_answer 工具 JSON。

生成 Phase 18 RAG 三元插件事件。

生成 rag_search / rag_answer 共享结果 map。

生成 search 工具 JSON。

Functions

answer_tool_json(attrs \\ [])

@spec answer_tool_json(keyword() | map()) :: String.t()

生成 answer 工具 JSON。

chunk(attrs \\ [])

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

生成一个 Arcana chunk 风格的检索结果。

chunks(attrs \\ [])

@spec chunks(keyword() | map()) :: [map()]

生成默认 top-k chunk 列表。

citation(attrs \\ [])

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

生成 citation map。默认保留 provenance,不填正文。

event_payload(name, attrs \\ [])

@spec event_payload(atom(), keyword() | map()) :: map()

生成 RAG 插件事件 payload。

graph_evidence(attrs \\ [])

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

生成 GraphRAG evidence map。

graph_search_tool_json(attrs \\ [])

@spec graph_search_tool_json(keyword() | map()) :: String.t()

生成 rag_graph_search 工具 JSON。

graph_status(attrs \\ [])

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

生成 GraphRAG 状态 map。

graph_status_tool_json(attrs \\ [])

@spec graph_status_tool_json(keyword() | map()) :: String.t()

生成 rag_graph_status 工具 JSON。

ingest_status(attrs \\ [])

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

生成知识库索引状态 map。

ingest_status_tool_json(attrs \\ [])

@spec ingest_status_tool_json(keyword() | map()) :: String.t()

生成 rag_ingest_status 工具 JSON。

pipeline_tool_json(attrs \\ [])

@spec pipeline_tool_json(keyword() | map()) :: String.t()

生成 rag_pipeline_answer 工具 JSON。

plugin_event(name, attrs \\ [])

@spec plugin_event(atom(), keyword() | map()) :: {:plugin_event, atom(), map()}

生成 Phase 18 RAG 三元插件事件。

result(attrs \\ [])

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

生成 rag_search / rag_answer 共享结果 map。

search_tool_json(attrs \\ [])

@spec search_tool_json(keyword() | map()) :: String.t()

生成 search 工具 JSON。