@@ -162,6 +162,9 @@ message GetCompletionsRequest {
162162 // With parallel tool calls, multiple tool calls can occur within a single turn,
163163 // so max_turns does not necessarily equal the total number of tool calls.
164164 optional int32 max_turns = 25 ;
165+
166+ // Allow the users to control what optional fields to be returned in the response.
167+ repeated IncludeOption include = 26 ;
165168}
166169
167170message GetChatCompletionResponse {
@@ -280,6 +283,9 @@ message CompletionMessage {
280283
281284 // The encrypted content.
282285 string encrypted_content = 5 ;
286+
287+ // The citations that the model used to answer the question.
288+ repeated InlineCitation citations = 6 ;
283289}
284290
285291// Holds the differences (deltas) that when concatenated make up the entire
@@ -315,6 +321,57 @@ message Delta {
315321
316322 // The encrypted content.
317323 string encrypted_content = 5 ;
324+
325+ // The citations that the model used to answer the question.
326+ repeated InlineCitation citations = 6 ;
327+ }
328+
329+ message InlineCitation {
330+ // The globally unique id of the citation per response.
331+ string id = 1 ;
332+
333+ // The index where the inline citation should be inserted in the complete text response.
334+ int32 start_index = 2 ;
335+
336+ // The citation type.
337+ oneof citation {
338+ // The citation returned from the web search tool.
339+ WebCitation web_citation = 3 ;
340+
341+ // The citation returned from the X search tool.
342+ XCitation x_citation = 4 ;
343+
344+ // The citation returned from the collections search tool.
345+ CollectionsCitation collections_citation = 5 ;
346+ }
347+ }
348+
349+ message WebCitation {
350+ // The url of the web page that the citation is from.
351+ string url = 1 ;
352+ }
353+
354+ message XCitation {
355+ // The url of the X post or profile that the citation is from.
356+ // The url is always a x.com url.
357+ string url = 1 ;
358+ }
359+
360+ message CollectionsCitation {
361+ // The id of the file that the citation is from.
362+ string file_id = 1 ;
363+
364+ // The id of the chunk that the citation is from.
365+ string chunk_id = 2 ;
366+
367+ // The content of the chunk that the citation is from.
368+ string chunk_content = 3 ;
369+
370+ // The relevance score of the citation.
371+ float score = 4 ;
372+
373+ // The ids of the collections that the citation is from.
374+ repeated string collection_ids = 5 ;
318375}
319376
320377// Holding the log probabilities of the sampling.
@@ -377,6 +434,32 @@ message FileContent {
377434 string file_id = 1 ;
378435}
379436
437+ enum IncludeOption {
438+ // Default value / invalid option.
439+ INCLUDE_OPTION_INVALID = 0 ;
440+
441+ // Include the encrypted output from the web search tool in the response.
442+ INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT = 1 ;
443+
444+ // Include the encrypted output from the X search tool in the response.
445+ INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT = 2 ;
446+
447+ // Include the plaintext output from the code execution tool in the response.
448+ INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT = 3 ;
449+
450+ // Include the plaintext output from the collections search tool in the response.
451+ INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT = 4 ;
452+
453+ // Include the plaintext output from the document search tool in the response.
454+ INCLUDE_OPTION_DOCUMENT_SEARCH_CALL_OUTPUT = 5 ;
455+
456+ // Include the plaintext output from the MCP tool in the response.
457+ INCLUDE_OPTION_MCP_CALL_OUTPUT = 6 ;
458+
459+ // Include the inline citations in the final response.
460+ INCLUDE_OPTION_INLINE_CITATIONS = 7 ;
461+ }
462+
380463// A message in a conversation. This message is part of the model input. Each
381464// message originates from a "role", which indicates the entity type who sent
382465// the message. Messages can contain multiple content elements such as text and
@@ -879,6 +962,9 @@ message RequestSettings {
879962
880963 // Whether to use encrypted thinking for thinking trace rehydration.
881964 bool use_encrypted_content = 13 ;
965+
966+ // Allow the users to control what optional fields to be returned in the response.
967+ repeated IncludeOption include = 14 ;
882968}
883969
884970// Request to retrieve a stored completion response.
0 commit comments