table_cite
Attach source references to table cells, query citation summaries, read full citation details, remove citations, and review cell change history while preserving table structure.
Instructions
📎 表格引用管理:為儲存格附加、查詢、移除來源引用。
引用是「平行附加層」,不改變表格資料結構。 每個引用用 AssetRef 指向具體來源(PDF section、URL、使用者輸入等)。
Operations:
add: 新增引用到儲存格
get: 查詢引用摘要(cell / row / table);完整引用用 read
read: 完整 cell/value/citation JSON 分頁,不截斷 canonical quote/locator
remove: 移除引用
cell_history: 查看儲存格變更歷史
Args: operation: 操作類型 table_id: 表格 ID row_index: 列索引 (0-based),get 時可省略取得全表引用 column_name: 欄位名,get 時可省略取得整列引用 refs: [add] 引用列表,每項為 AssetRef dict [{"source_type":"section","doc_id":"doc_xxx","asset_id":"sec_01","excerpt":"..."}] [{"source_type":"external","url":"https://doi.org/...","label":"Smith 2024"}] [{"source_type":"user_input","excerpt":"Patient reported"}] confidence: [add] Agent 信心度 0.0~1.0 notes: [add] 備註 ref_index: [remove] 移除特定引用索引(不指定則移除整個 cell 引用) text_offset: [read] 字元起點;後續頁必須保留 citation_sha256 text_limit: [read] 每頁 1..4000 字元,可能因回應上限縮短 citation_sha256: [read] 首頁回傳的 hash,拒絕混接不同 cell/value/citation
read requires a row_id (preferred) or row_index and column_name. Concatenate text_excerpt pages at one hash, verify UTF-8 SHA-256, then parse the full JSON. Follow next_text_offset until null. Readback does not verify source or meaning.
Examples: table_cite("add", "tbl_xxx", row_index=0, column_name="Drug", refs=[{"source_type":"section","doc_id":"doc_a","asset_id":"sec_01", "excerpt":"dose was 5mg"}], confidence=0.9) table_cite("get", "tbl_xxx") # 全表引用 table_cite("get", "tbl_xxx", row_index=0) # 全列引用 table_cite("cell_history", "tbl_xxx", row_index=0, column_name="Drug")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| refs | No | ||
| limit | No | ||
| notes | No | ||
| offset | No | ||
| row_id | No | ||
| table_id | Yes | ||
| operation | Yes | ||
| ref_index | No | ||
| row_index | No | ||
| confidence | No | ||
| text_limit | No | ||
| column_name | No | ||
| text_offset | No | ||
| citation_sha256 | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |