Skip to content

Commit f2ee2fa

Browse files
authored
Add end_index for InlineCitation (#20)
Add `end_index` for `InlineCitation` to render the span inline citation.
1 parent 230d001 commit f2ee2fa

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

proto/xai/api/v1/chat.proto

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,25 @@ message Delta {
326326
}
327327

328328
message InlineCitation {
329-
// The globally unique id of the citation per response.
329+
// The display number for this citation (e.g., "1", "2", "3").
330+
// This ID is reused when the same source is cited multiple times in a
331+
// response, ensuring consistent numbering (e.g., the same URL always shows as
332+
// [1]).
330333
string id = 1;
331334

332-
// The index where the inline citation should be inserted in the complete text response.
335+
// The character position in the response text where the citation markdown
336+
// link begins. This is the index of the first '[' character in the citation
337+
// format [[id]](url). Uses inclusive indexing (the character at this index is
338+
// part of the citation).
333339
int32 start_index = 2;
334340

341+
// The character position in the response text immediately after the citation
342+
// markdown link ends. This is the index after the final ']' character in the
343+
// citation format [[id]](url). Uses exclusive indexing (the character at this
344+
// index is NOT part of the citation). Together with start_index,
345+
// text[start_index:end_index] extracts the full citation link.
346+
int32 end_index = 6;
347+
335348
// The citation type.
336349
oneof citation {
337350
// The citation returned from the web search tool.

0 commit comments

Comments
 (0)