feat(llm): introduce request-local source reference aliases

Replace raw chunk/document/KB IDs in LLM context with short cN/dN/bN/wN
aliases, decode tool arguments on the way in, and expand compact <ref/>
citations to the public <kb>/<web> format before user-facing output.
This commit is contained in:
wizardchen
2026-07-16 21:23:20 +08:00
committed by lyingbug
parent 79e8f3d894
commit 014164ae44
33 changed files with 1962 additions and 149 deletions
+4 -4
View File
@@ -43,20 +43,20 @@ Do not use when:
- Can check document processing status (parse_status)
## IDs
- knowledge_ids: regular documents knowledges
- faq_ids: individual FAQ entries. Returns the standard question and answers, not the container title.`,
- knowledge_ids: regular documents, using the short dN IDs from retrieval results
- faq_ids: individual FAQ entries, using the short cN chunk IDs. Returns the standard question and answers, not the container title.`,
schema: json.RawMessage(`{
"type": "object",
"properties": {
"knowledge_ids": {
"type": "array",
"items": { "type": "string" },
"description": "Document/knowledge IDs for regular documents"
"description": "Short dN document IDs for regular documents"
},
"faq_ids": {
"type": "array",
"items": { "type": "string" },
"description": "FAQ entry IDs (= chunk_id from grep_chunks). Use instead of knowledge_ids for a single FAQ Q&A."
"description": "Short cN FAQ chunk IDs from retrieval results. Use instead of knowledge_ids for a single FAQ Q&A."
}
}
}`),