From b7bbf189fa8b38849a7a0358929c3fe05dcf1d57 Mon Sep 17 00:00:00 2001 From: devlooped-bot Date: Fri, 28 Nov 2025 22:10:34 +0000 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Bump=20files=20with=20dotn?= =?UTF-8?q?et-file=20sync=20=EF=BB=BF#=20xai-org/xai-proto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Support including tool output and inline citations (#18) https://github.com/xai-org/xai-proto/commit/230d001 --- .netconfig | 4 +- src/GrokClient/chat.proto | 86 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) diff --git a/.netconfig b/.netconfig index 0be7159..aa47874 100644 --- a/.netconfig +++ b/.netconfig @@ -127,8 +127,8 @@ weak [file "src/GrokClient/chat.proto"] url = https://github.com/xai-org/xai-proto/blob/main/proto/xai/api/v1/chat.proto - sha = ffa02e54327b9d5f89c9dc6f7872417f2bd6fd27 - etag = ba767d0fb8de524f521b567433d70128a0335449c499ea30f1e72d61581887a7 + sha = 230d00180161329075094e72593db408dd12f3bf + etag = 2b6a23b70c4df35423d139b9aa26f50d9ba8f7f334ffb9cb74dc28bdb5078dfe weak [file "src/GrokClient/deferred.proto"] url = https://github.com/xai-org/xai-proto/blob/main/proto/xai/api/v1/deferred.proto diff --git a/src/GrokClient/chat.proto b/src/GrokClient/chat.proto index bae38af..044d4d1 100644 --- a/src/GrokClient/chat.proto +++ b/src/GrokClient/chat.proto @@ -162,6 +162,9 @@ message GetCompletionsRequest { // With parallel tool calls, multiple tool calls can occur within a single turn, // so max_turns does not necessarily equal the total number of tool calls. optional int32 max_turns = 25; + + // Allow the users to control what optional fields to be returned in the response. + repeated IncludeOption include = 26; } message GetChatCompletionResponse { @@ -280,6 +283,9 @@ message CompletionMessage { // The encrypted content. string encrypted_content = 5; + + // The citations that the model used to answer the question. + repeated InlineCitation citations = 6; } // Holds the differences (deltas) that when concatenated make up the entire @@ -315,6 +321,57 @@ message Delta { // The encrypted content. string encrypted_content = 5; + + // The citations that the model used to answer the question. + repeated InlineCitation citations = 6; +} + +message InlineCitation { + // The globally unique id of the citation per response. + string id = 1; + + // The index where the inline citation should be inserted in the complete text response. + int32 start_index = 2; + + // The citation type. + oneof citation { + // The citation returned from the web search tool. + WebCitation web_citation = 3; + + // The citation returned from the X search tool. + XCitation x_citation = 4; + + // The citation returned from the collections search tool. + CollectionsCitation collections_citation = 5; + } +} + +message WebCitation { + // The url of the web page that the citation is from. + string url = 1; +} + +message XCitation { + // The url of the X post or profile that the citation is from. + // The url is always a x.com url. + string url = 1; +} + +message CollectionsCitation { + // The id of the file that the citation is from. + string file_id = 1; + + // The id of the chunk that the citation is from. + string chunk_id = 2; + + // The content of the chunk that the citation is from. + string chunk_content = 3; + + // The relevance score of the citation. + float score = 4; + + // The ids of the collections that the citation is from. + repeated string collection_ids = 5; } // Holding the log probabilities of the sampling. @@ -377,6 +434,32 @@ message FileContent { string file_id = 1; } +enum IncludeOption { + // Default value / invalid option. + INCLUDE_OPTION_INVALID = 0; + + // Include the encrypted output from the web search tool in the response. + INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT = 1; + + // Include the encrypted output from the X search tool in the response. + INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT = 2; + + // Include the plaintext output from the code execution tool in the response. + INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT = 3; + + // Include the plaintext output from the collections search tool in the response. + INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT = 4; + + // Include the plaintext output from the document search tool in the response. + INCLUDE_OPTION_DOCUMENT_SEARCH_CALL_OUTPUT = 5; + + // Include the plaintext output from the MCP tool in the response. + INCLUDE_OPTION_MCP_CALL_OUTPUT = 6; + + // Include the inline citations in the final response. + INCLUDE_OPTION_INLINE_CITATIONS = 7; +} + // A message in a conversation. This message is part of the model input. Each // message originates from a "role", which indicates the entity type who sent // the message. Messages can contain multiple content elements such as text and @@ -879,6 +962,9 @@ message RequestSettings { // Whether to use encrypted thinking for thinking trace rehydration. bool use_encrypted_content = 13; + + // Allow the users to control what optional fields to be returned in the response. + repeated IncludeOption include = 14; } // Request to retrieve a stored completion response.