← Back to Gene Catalog

kb-provenance-formatter

Native knowledge.provenance

从知识库 RAG 引用的 enriched citations 构建出处行(KbProvenanceLine)、拼装文本与导出 Markdown。纯字符串处理,无网络调用。

README

No documentation yet.

Gene authors can add a README when publishing.

Phenotype

Input

PropertyType Description
askId string 可选的 ask_id,输出到 responseFields
kbCitations array 知识库引用列表(kb-rag 输出的 enriched citations)
webCitations array 网页引用列表
includeMarkdown boolean = true 是否生成 Markdown 格式的出处文本
includeResponseFields boolean = true 是否生成 API 响应字段格式

Output

PropertyType Req Description
kb array 格式化后的知识库出处行
web array 格式化后的网页出处行
markdown string 完整 Markdown 格式(含回答、出处、审计附录)
responseFields object API 响应字段格式(含 provenance 对象)
provenanceTextKb string 知识库出处纯文本(一行一条)
provenanceTextWeb string 网页出处纯文本(一行一条)
Raw JSON Schema

inputSchema

{
  "type": "object",
  "required": [],
  "properties": {
    "askId": {
      "type": "string",
      "description": "可选的 ask_id,输出到 responseFields"
    },
    "kbCitations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "quote": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "chunk_id": {
            "type": "string"
          },
          "loc_hint": {
            "type": "string"
          },
          "article_id": {
            "type": "string"
          },
          "chunk_index": {
            "type": "number"
          },
          "source_path": {
            "type": "string"
          },
          "source_type": {
            "type": "string"
          },
          "file_display": {
            "type": "string"
          },
          "article_title": {
            "type": "string"
          },
          "kb_library_id": {
            "type": "string"
          },
          "kb_library_label": {
            "type": "string"
          },
          "file_display_kind": {
            "type": "string"
          }
        }
      },
      "description": "知识库引用列表(kb-rag 输出的 enriched citations)"
    },
    "webCitations": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "quote": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "w_index": {
            "type": "number"
          }
        }
      },
      "description": "网页引用列表"
    },
    "includeMarkdown": {
      "type": "boolean",
      "default": true,
      "description": "是否生成 Markdown 格式的出处文本"
    },
    "includeResponseFields": {
      "type": "boolean",
      "default": true,
      "description": "是否生成 API 响应字段格式"
    }
  }
}

outputSchema

{
  "type": "object",
  "required": [
    "kb",
    "web"
  ],
  "properties": {
    "kb": {
      "type": "array",
      "description": "格式化后的知识库出处行"
    },
    "web": {
      "type": "array",
      "description": "格式化后的网页出处行"
    },
    "markdown": {
      "type": "string",
      "description": "完整 Markdown 格式(含回答、出处、审计附录)"
    },
    "responseFields": {
      "type": "object",
      "description": "API 响应字段格式(含 provenance 对象)"
    },
    "provenanceTextKb": {
      "type": "string",
      "description": "知识库出处纯文本(一行一条)"
    },
    "provenanceTextWeb": {
      "type": "string",
      "description": "网页出处纯文本(一行一条)"
    }
  }
}