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 のように、UI 上でハイライト表示される正確な箇所を指します。一般に、モデルはソース 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.
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>
引用の解析
モデルが引用を出力したら、応答テキストから引用を抽出する必要があります。これにより、ソース ID の解決やリンクの表示、ユーザーに回答を表示する前の未処理マーカーの削除ができます。
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]...
行単位ではなくブロック単位で引用する場合は、取得した各ブロックに固有の安定したソース ID を付け、{CITATION_START}cite{CITATION_DELIMITER}turn0file0{CITATION_STOP} のように、同じ 2 フィールドの引用形式を引き続き使うことを推奨します。まったく別の引用種別を新たに作る必要はありません。
プロンプトの指示の作成
## 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