LIUS LLM API
這是 LIUS 道教 AI 對外公開 contract:先取已發布館藏,再生成有 citation 的回答。核心端點支援 CORS、OPTIONS與OpenAPI JSON。
Contracts
| Endpoint | Method | 用途 |
|---|---|---|
| /api/llm-rag | GET / POST | 公開館藏檢索;回傳 hits、context_blocks、citation、answerability、retrieval_policy。 |
| /api/llm-rag/answer | GET / POST | 先 retrieve,再以固定模板輸出有 citation 的回答草稿;沒有來源就不輸出定論。 |
| /api/llm/generate | POST | demo 用生成端點;narrative / publishing / grant 會先走正式 RAG contract。 |
| /api/llm/infrastructure-manifest | GET | 五件套研究基礎設施 manifest,適合 AI agent、搜尋引擎與審查引用。 |
| /api/llm/openapi.json | GET | OpenAPI 3.1 contract;支援 CORS,供外部工具與前端匯入。 |
| /api/llm/benchmark.jsonl | GET | DaoEval v0.1 公開題庫 JSONL;支援 suite、layer、limit query。 |
| /api/llm/leaderboard.json | GET | Draft / official gate 分離的 leaderboard JSON;正式 verified runs 目前為 0。 |
| /api/llm/runner-spec.json | GET | 外部重跑規格:runner、grader、provider env names、score formula 與 secret policy。 |
| /api/llm/whitepaper-ris | GET | DaoEval RIS citation,供 Zotero、Mendeley 等文獻工具匯入。 |
| /api/llm/whitepaper-csl-json | GET | DaoEval CSL JSON citation,供 citeproc 與學術 agent 直接解析。 |
| /CITATION.cff | GET | Citation File Format;供 GitHub、Zenodo 與軟體引用工具辨識。 |
Retrieve
curl -sS https://lius.cc/api/llm-rag \
-H 'content-type: application/json' \
-H 'X-Request-ID: demo-001' \
-d '{"q":"城隍 職司","n":5,"types":["deity","paper"]}'Answer
curl -sS https://lius.cc/api/llm-rag/answer \
-H 'content-type: application/json' \
-d '{"q":"三朝醮的流程重點是什麼?","n":4,"types":["ritual","paper"]}'OpenAPI
curl -sS https://lius.cc/api/llm/openapi.json
Response Contract
X-Request-ID
每次請求的追蹤 id;可由 client 指定,也會在 response header 回傳。
hits
原始 top-N 已發布 LIUS 節點,含 url、type、score 與 citation。
context_blocks
可直接注入模型的引用文本,每段以 [1]、[2] 標號。
answerability
檢索結果是否足以回答;低信心時應保留疑問。
retrieval_policy
公開檢索策略與限制,目前 visibility 為 published_only。