Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
86 changes: 86 additions & 0 deletions src/GrokClient/chat.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down