Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}file0{CITATION_STOP}Title: Employee HandbookURL: https://company.example/handbookUpdated: 2026-03-01[L1] Employees may work remotely up to three days per week.[L2] Additional remote days require manager approval.[L3] Exceptions may apply for approved accommodations.
來源 ID 與定位資訊的差異:來源 ID 是由模型產生的穩定識別碼,
例如 block1。定位資訊則是
介面中精確標示的醒目提示範圍,例如 lines L8-L13 或
Paragraph 21。一般而言,模型應輸出來源 ID,
由系統負責解析或呈現定位資訊。過早混用這兩者,
往往會增加格式錯誤。
## CitationsResults are returned by "tool_1". Each message from `tool_1` is called a "source" and identified by its reference ID, which is the first occurrence of 【turn\d+\w+\d+】 (e.g. 【turn2file1】). In this example, the string "turn2file1" would be the source reference ID.Citations are references to `tool_1` sources. Citations may be used to refer to either a single source or multiple sources.Citations to a single source must be written as {CITATION_START}cite{CITATION_DELIMITER}turn\d+\w+\d+{CITATION_STOP} (e.g. {CITATION_START}cite{CITATION_DELIMITER}turn2file5{CITATION_STOP}).Citations to multiple sources must be written as {CITATION_START}cite{CITATION_DELIMITER}turn\d+\w+\d+{CITATION_DELIMITER}turn\d+\w+\d+{CITATION_DELIMITER}...{CITATION_STOP} (e.g. {CITATION_START}cite{CITATION_DELIMITER}turn2file5{CITATION_DELIMITER}turn2file1{CITATION_DELIMITER}...{CITATION_STOP}).Citations must not be placed inside markdown bold, italics, or code fences, as they will not display correctly. Instead, place the citations outside the markdown block. Citations outside code fences may not be placed on the same line as the end of the code fence.You must NOT write reference ID turn\d+\w+\d+ verbatim in the response text without putting them between {CITATION_START}...{CITATION_STOP}.- Place citations at the end of the paragraph, or inline if the paragraph is long, unless the user requests specific citation placement.- Citations must be placed after punctuation.- Citations must not be all grouped together at the end of the response.- Citations must not be put in a line or paragraph with nothing else but the citations themselves.
如果你希望模型也輸出行號等定位資訊(L1-L22),請在提示詞中如此指定:
You *must* cite any results you use from this tool using the:`\ue200cite\ue202turn0file0\ue202L8-L13\ue201` format ONLY if the item has a corresponding citation marker.
請勿嘗試引用沒有對應引用標記的項目,因為這些項目並非供引用之用。
引用中必須包含行號範圍。
需要更高品質的接地表現時,通常值得加入以下規則。請依據使用情境的需求調整本節內容。
12345678910111213<extra_considerations_for_citations>- **Relevance:** Include only search results and citations that support the cited response text. Irrelevant sources permanently degrade user trust.- **Diversity:** You must base your answer on sources from diverse domains, and cite accordingly.- **Trustworthiness:** To produce a credible response, you must rely on high quality domains, and ignore information from less reputable domains unless they are the only source.- **Accurate Representation:** Each citation must accurately reflect the source content. Selective interpretation of the source content is not allowed.Remember, the quality of a domain/source depends on the context.- When multiple viewpoints exist, cite sources covering the spectrum of opinions to ensure balance and comprehensiveness.- When reliable sources disagree, cite at least one high-quality source for each major viewpoint.- Ensure more than half of citations come from widely recognized authoritative outlets on the topic.- For debated topics, cite at least one reliable source representing each major viewpoint.- Do not ignore the content of a relevant source because it is low quality.</extra_considerations_for_citations>
Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file0{CITATION_STOP}[L1] The service agreement states that termination for convenience requires thirty (30) days’ written notice, unless superseded by a customer-specific addendum.[L2] In practice, renewal terms auto-extend for successive one-year periods when no written non-renewal notice is received before the deadline.[L3] Appendix B further clarifies that pricing exceptions must be approved in writing by both Finance and the account owner.Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file1{CITATION_STOP}...
此處,turn0file0 是穩定的來源 ID,行號則是定位資訊。
以下是工具呼叫的輸出範例:
Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file0{CITATION_STOP}[Block1]The service agreement states that termination for convenience requires thirty (30) days’ written notice, unless superseded by a customer-specific addendum.In practice, renewal terms auto-extend for successive one-year periods when no written non-renewal notice is received before the deadline.Appendix B further clarifies that pricing exceptions must be approved in writing by both Finance and the account owner.Citation Marker: {CITATION_START}cite{CITATION_DELIMITER}turn0file1{CITATION_STOP}[Block2]...
## CitationsResults are returned by "tool_1". Each message from `tool_1` is called a "source" and identified by its reference ID, which is the first occurrence of `turn\\d+file\\d+` (for example, `turn0file0` or `turn2file1`). In this example, the string `turn0file0` would be the source reference ID.Citations are references to `tool_1` sources. Citations may be used to refer to either a single source or multiple sources.A citation to a single source must be written as:{CITATION_START}cite{CITATION_DELIMITER}turn\d+file\d+{CITATION_STOP}If line-level citations are supported, a citation to a specific line range must be written as:{CITATION_START}cite{CITATION_DELIMITER}turn\d+file\d+{CITATION_DELIMITER}L\d+-L\d+{CITATION_STOP}Citations to multiple sources must be written by emitting multiple citation markers, one for each supporting source.You must NOT write reference IDs like `turn0file0` verbatim in the response text without putting them between {CITATION_START}...{CITATION_STOP}.- Place citations at the end of the supported sentence, or inline if the sentence is long and contains multiple supported clauses.- Citations must be placed after punctuation.- Cite only retrieved sources that directly support the cited text.- Never invent source IDs, line ranges, or block locators that were not returned by the tool.- If multiple retrieved sources materially support a proposition, cite all of them.- If the retrieved sources disagree, cite the conflicting sources and describe the disagreement accurately.
輸出範例:
The on-call handoff process is documented in the weekly support sync notes. \ue200cite\ue202turn0file0\ue202L8-L13\ue201
設定注入上下文的引用格式
如果你會事先擷取或準備上下文,並將其直接注入提示詞,請使用此模式。
定義可引用單位
對於注入的上下文,常見做法是將來源片段包在明確的標籤內,並為標籤設定穩定的參照 ID。
12345678910<BLOCK id="block1">The service agreement states that termination for convenience requires thirty (30) days’ written notice, unless superseded by a customer-specific addendum.In practice, renewal terms auto-extend for successive one-year periods when no written non-renewal notice is received before the deadline.Appendix B further clarifies that pricing exceptions must be approved in writing by both Finance and the account owner.</BLOCK><BLOCK id="block2">Syllabus</BLOCK>...
這樣能明確界定可引用單位,方便模型參照。
撰寫提示詞指示
## CitationsSupporting context is provided directly in the prompt as citable units. Each citable unit is identified by the value of its `id` attribute in the first occurrence of a tag such as `<BLOCK id="block5"> ... </BLOCK>`. In this example, `block5` would be the source reference ID.Because this pattern does not invoke tools, there is no tool turn counter to increment. That means you do not need to use a `turn#` prefix for the citation marker. You can keep IDs in a `turn0block5` style if that matches the rest of your system, or use plain IDs like `block5` as shown here. The key requirement is that the citation marker matches the injected context ID exactly and consistently.Citations are references to these provided citable units. Citations may be used to refer to either a single source or multiple sources.A citation to a single source must be written as:{CITATION_START}cite{CITATION_DELIMITER}<block_id>{CITATION_STOP}For example:{CITATION_START}cite{CITATION_DELIMITER}block5{CITATION_STOP}Citations to multiple sources must be written by emitting multiple citation markers, one for each supporting block.You must NOT write block IDs verbatim in the response text without putting them between {CITATION_START}...{CITATION_STOP}.- Place citations at the end of the supported sentence, or inline if the sentence is long and contains multiple supported clauses.- Citations must be placed after punctuation.- Cite only blocks that appear in the provided context.- Never invent new block IDs.- Never cite outside knowledge or outside authorities.- If multiple blocks materially support a proposition, cite all of them.- If the provided blocks conflict, cite the conflicting blocks and describe the conflict accurately.
輸出範例:
The Court held that the District Court lacked personal jurisdiction over the petitioner. \ue200cite\ue202block5\ue201