From 93e392a5b09cd7f570f7cf5cb668407835937e1c Mon Sep 17 00:00:00 2001 From: Mark Yang Date: Tue, 20 Jan 2026 18:04:11 -0800 Subject: [PATCH] Add `developer` role - Add `developer` role in proto - Add `developer` util function - Add unit test for `developer` util function --- src/xai_sdk/chat.py | 12 +++++++++++ src/xai_sdk/proto/v5/chat_pb2.py | 34 +++++++++++++++---------------- src/xai_sdk/proto/v5/chat_pb2.pyi | 2 ++ src/xai_sdk/proto/v6/chat_pb2.py | 34 +++++++++++++++---------------- src/xai_sdk/proto/v6/chat_pb2.pyi | 2 ++ tests/chat_test.py | 18 +++++++++++++++- 6 files changed, 67 insertions(+), 35 deletions(-) diff --git a/src/xai_sdk/chat.py b/src/xai_sdk/chat.py index 7fe6dde..9bafef9 100644 --- a/src/xai_sdk/chat.py +++ b/src/xai_sdk/chat.py @@ -477,6 +477,9 @@ def _get_span_prompt_attributes(self) -> dict[str, Any]: elif message.role == chat_pb2.MessageRole.ROLE_SYSTEM: prompt_attributes[f"gen_ai.prompt.{index}.role"] = "system" prompt_attributes[f"gen_ai.prompt.{index}.content"] = "".join([c.text for c in message.content]) + elif message.role == chat_pb2.MessageRole.ROLE_DEVELOPER: + prompt_attributes[f"gen_ai.prompt.{index}.role"] = "developer" + prompt_attributes[f"gen_ai.prompt.{index}.content"] = "".join([c.text for c in message.content]) elif message.role == chat_pb2.MessageRole.ROLE_TOOL: prompt_attributes[f"gen_ai.prompt.{index}.role"] = "tool" prompt_attributes[f"gen_ai.prompt.{index}.content"] = "".join([c.text for c in message.content]) @@ -589,6 +592,15 @@ def system(*args: Content) -> chat_pb2.Message: return chat_pb2.Message(role=chat_pb2.MessageRole.ROLE_SYSTEM, content=[_process_content(c) for c in args]) +def developer(*args: Content) -> chat_pb2.Message: + """Creates a new message of role "developer". + + Note: This role is only supported by model versions higher than `grok-4.1`/`grok-4-1` (not included). Using the + `developer` role in `grok-4.1` or below will be converted to `system` message by the backend. + """ + return chat_pb2.Message(role=chat_pb2.MessageRole.ROLE_DEVELOPER, content=[_process_content(c) for c in args]) + + def tool_result(result: str, tool_call_id: Optional[str] = None) -> chat_pb2.Message: """Creates a new message of role "tool". diff --git a/src/xai_sdk/proto/v5/chat_pb2.py b/src/xai_sdk/proto/v5/chat_pb2.py index 5a7f738..bda290c 100644 --- a/src/xai_sdk/proto/v5/chat_pb2.py +++ b/src/xai_sdk/proto/v5/chat_pb2.py @@ -30,7 +30,7 @@ from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xai/api/v1/chat.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19xai/api/v1/deferred.proto\x1a\x1axai/api/v1/documents.proto\x1a\x16xai/api/v1/image.proto\x1a\x17xai/api/v1/sample.proto\x1a\x16xai/api/v1/usage.proto\"\xed\t\n\x15GetCompletionsRequest\x12,\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.MessageR\x08messages\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x12\n\x04user\x18\x10 \x01(\tR\x04user\x12\x11\n\x01n\x18\x08 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\"\n\nmax_tokens\x18\x07 \x01(\x05H\x01R\tmaxTokens\x88\x01\x01\x12\x17\n\x04seed\x18\x0b \x01(\x05H\x02R\x04seed\x88\x01\x01\x12\x12\n\x04stop\x18\x0c \x03(\tR\x04stop\x12%\n\x0btemperature\x18\x0e \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12\x18\n\x05top_p\x18\x0f \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x1a\n\x08logprobs\x18\x05 \x01(\x08R\x08logprobs\x12&\n\x0ctop_logprobs\x18\x06 \x01(\x05H\x05R\x0btopLogprobs\x88\x01\x01\x12#\n\x05tools\x18\x11 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x34\n\x0btool_choice\x18\x12 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12@\n\x0fresponse_format\x18\n \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x30\n\x11\x66requency_penalty\x18\x03 \x01(\x02H\x06R\x10\x66requencyPenalty\x88\x01\x01\x12.\n\x10presence_penalty\x18\t \x01(\x02H\x07R\x0fpresencePenalty\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x13 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x08R\x0freasoningEffort\x88\x01\x01\x12K\n\x11search_parameters\x18\x14 \x01(\x0b\x32\x19.xai_api.SearchParametersH\tR\x10searchParameters\x88\x01\x01\x12\x33\n\x13parallel_tool_calls\x18\x15 \x01(\x08H\nR\x11parallelToolCalls\x88\x01\x01\x12\x35\n\x14previous_response_id\x18\x16 \x01(\tH\x0bR\x12previousResponseId\x88\x01\x01\x12%\n\x0estore_messages\x18\x17 \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\x18 \x01(\x08R\x13useEncryptedContent\x12 \n\tmax_turns\x18\x19 \x01(\x05H\x0cR\x08maxTurns\x88\x01\x01\x12\x30\n\x07include\x18\x1a \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\x04\n\x02_nB\r\n\x0b_max_tokensB\x07\n\x05_seedB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x0f\n\r_top_logprobsB\x14\n\x12_frequency_penaltyB\x13\n\x11_presence_penaltyB\x13\n\x11_reasoning_effortB\x14\n\x12_search_parametersB\x16\n\x14_parallel_tool_callsB\x17\n\x15_previous_response_idB\x0c\n\n_max_turnsJ\x04\x08\x04\x10\x05\"\x96\x03\n\x19GetChatCompletionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x33\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutputR\x07outputs\x12\x34\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x06 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x07 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\n \x03(\tR\tcitations\x12\x34\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettingsR\x08settings\x12\x37\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xe2\x02\n\x16GetChatCompletionChunk\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x38\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunkR\x07outputs\x12\x34\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x05 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\x07 \x03(\tR\tcitations\x12\x37\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xa2\x01\n\x1dGetDeferredCompletionResponse\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x43\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\"\xc9\x01\n\x10\x43ompletionOutput\x12:\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x02 \x01(\x05R\x05index\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessageR\x07message\x12-\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\"\x9a\x02\n\x11\x43ompletionMessage\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xbe\x01\n\x15\x43ompletionOutputChunk\x12$\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.DeltaR\x05\x64\x65lta\x12-\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\x12:\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x04 \x01(\x05R\x05index\"\x8e\x02\n\x05\x44\x65lta\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xad\x02\n\x0eInlineCitation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bstart_index\x18\x02 \x01(\x05R\nstartIndex\x12\x1b\n\tend_index\x18\x06 \x01(\x05R\x08\x65ndIndex\x12\x39\n\x0cweb_citation\x18\x03 \x01(\x0b\x32\x14.xai_api.WebCitationH\x00R\x0bwebCitation\x12\x33\n\nx_citation\x18\x04 \x01(\x0b\x32\x12.xai_api.XCitationH\x00R\txCitation\x12Q\n\x14\x63ollections_citation\x18\x05 \x01(\x0b\x32\x1c.xai_api.CollectionsCitationH\x00R\x13\x63ollectionsCitationB\n\n\x08\x63itation\"\x1f\n\x0bWebCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\x1d\n\tXCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xab\x01\n\x13\x43ollectionsCitation\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x19\n\x08\x63hunk_id\x18\x02 \x01(\tR\x07\x63hunkId\x12#\n\rchunk_content\x18\x03 \x01(\tR\x0c\x63hunkContent\x12\x14\n\x05score\x18\x04 \x01(\x02R\x05score\x12%\n\x0e\x63ollection_ids\x18\x05 \x03(\tR\rcollectionIds\"6\n\x08LogProbs\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProbR\x07\x63ontent\"\x87\x01\n\x07LogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\x12\x36\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProbR\x0btopLogprobs\"R\n\nTopLogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\"\x8f\x01\n\x07\x43ontent\x12\x14\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x12\x37\n\timage_url\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentH\x00R\x08imageUrl\x12*\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x14.xai_api.FileContentH\x00R\x04\x66ileB\t\n\x07\x63ontent\"&\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\"\xd2\x02\n\x07Message\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.ContentR\x07\x63ontent\x12\x30\n\x11reasoning_content\x18\x05 \x01(\tH\x00R\x10reasoningContent\x88\x01\x01\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12\x30\n\ntool_calls\x18\x04 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x06 \x01(\tR\x10\x65ncryptedContent\x12%\n\x0ctool_call_id\x18\x07 \x01(\tH\x01R\ntoolCallId\x88\x01\x01\x42\x14\n\x12_reasoning_contentB\x0f\n\r_tool_call_id\"k\n\nToolChoice\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x11.xai_api.ToolModeH\x00R\x04mode\x12%\n\rfunction_name\x18\x02 \x01(\tH\x00R\x0c\x66unctionNameB\r\n\x0btool_choice\"\x9d\x03\n\x04Tool\x12/\n\x08\x66unction\x18\x01 \x01(\x0b\x32\x11.xai_api.FunctionH\x00R\x08\x66unction\x12\x33\n\nweb_search\x18\x03 \x01(\x0b\x32\x12.xai_api.WebSearchH\x00R\twebSearch\x12-\n\x08x_search\x18\x04 \x01(\x0b\x32\x10.xai_api.XSearchH\x00R\x07xSearch\x12?\n\x0e\x63ode_execution\x18\x05 \x01(\x0b\x32\x16.xai_api.CodeExecutionH\x00R\rcodeExecution\x12K\n\x12\x63ollections_search\x18\x06 \x01(\x0b\x32\x1a.xai_api.CollectionsSearchH\x00R\x11\x63ollectionsSearch\x12 \n\x03mcp\x18\x07 \x01(\x0b\x32\x0c.xai_api.MCPH\x00R\x03mcp\x12H\n\x11\x61ttachment_search\x18\x08 \x01(\x0b\x32\x19.xai_api.AttachmentSearchH\x00R\x10\x61ttachmentSearchB\x06\n\x04tool\"\xe7\x02\n\x03MCP\x12!\n\x0cserver_label\x18\x01 \x01(\tR\x0bserverLabel\x12-\n\x12server_description\x18\x02 \x01(\tR\x11serverDescription\x12\x1d\n\nserver_url\x18\x03 \x01(\tR\tserverUrl\x12,\n\x12\x61llowed_tool_names\x18\x04 \x03(\tR\x10\x61llowedToolNames\x12)\n\rauthorization\x18\x05 \x01(\tH\x00R\rauthorization\x88\x01\x01\x12\x43\n\rextra_headers\x18\x06 \x03(\x0b\x32\x1e.xai_api.MCP.ExtraHeadersEntryR\x0c\x65xtraHeaders\x1a?\n\x11\x45xtraHeadersEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x10\n\x0e_authorization\"\x9d\x02\n\tWebSearch\x12)\n\x10\x65xcluded_domains\x18\x01 \x03(\tR\x0f\x65xcludedDomains\x12\'\n\x0f\x61llowed_domains\x18\x02 \x03(\tR\x0e\x61llowedDomains\x12\x41\n\x1a\x65nable_image_understanding\x18\x03 \x01(\x08H\x00R\x18\x65nableImageUnderstanding\x88\x01\x01\x12H\n\ruser_location\x18\x04 \x01(\x0b\x32\x1e.xai_api.WebSearchUserLocationH\x01R\x0cuserLocation\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_location\"\xba\x01\n\x15WebSearchUserLocation\x12\x1d\n\x07\x63ountry\x18\x01 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x17\n\x04\x63ity\x18\x02 \x01(\tH\x01R\x04\x63ity\x88\x01\x01\x12\x1b\n\x06region\x18\x03 \x01(\tH\x02R\x06region\x88\x01\x01\x12\x1f\n\x08timezone\x18\x04 \x01(\tH\x03R\x08timezone\x88\x01\x01\x42\n\n\x08_countryB\x07\n\x05_cityB\t\n\x07_regionB\x0b\n\t_timezone\"\xb9\x03\n\x07XSearch\x12<\n\tfrom_date\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x08\x66romDate\x88\x01\x01\x12\x38\n\x07to_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x06toDate\x88\x01\x01\x12*\n\x11\x61llowed_x_handles\x18\x03 \x03(\tR\x0f\x61llowedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x04 \x03(\tR\x10\x65xcludedXHandles\x12\x41\n\x1a\x65nable_image_understanding\x18\x05 \x01(\x08H\x02R\x18\x65nableImageUnderstanding\x88\x01\x01\x12\x41\n\x1a\x65nable_video_understanding\x18\x06 \x01(\x08H\x03R\x18\x65nableVideoUnderstanding\x88\x01\x01\x42\x0c\n\n_from_dateB\n\n\x08_to_dateB\x1d\n\x1b_enable_image_understandingB\x1d\n\x1b_enable_video_understanding\"\x0f\n\rCodeExecution\"\x89\x03\n\x11\x43ollectionsSearch\x12%\n\x0e\x63ollection_ids\x18\x01 \x03(\tR\rcollectionIds\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12\'\n\x0cinstructions\x18\x03 \x01(\tH\x02R\x0cinstructions\x88\x01\x01\x12\x45\n\x10hybrid_retrieval\x18\x04 \x01(\x0b\x32\x18.xai_api.HybridRetrievalH\x00R\x0fhybridRetrieval\x12K\n\x12semantic_retrieval\x18\x05 \x01(\x0b\x32\x1a.xai_api.SemanticRetrievalH\x00R\x11semanticRetrieval\x12H\n\x11keyword_retrieval\x18\x06 \x01(\x0b\x32\x19.xai_api.KeywordRetrievalH\x00R\x10keywordRetrievalB\x10\n\x0eretrieval_modeB\x08\n\x06_limitB\x0f\n\r_instructions\"7\n\x10\x41ttachmentSearch\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x00R\x05limit\x88\x01\x01\x42\x08\n\x06_limit\"x\n\x08\x46unction\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\x16\n\x06strict\x18\x03 \x01(\x08R\x06strict\x12\x1e\n\nparameters\x18\x04 \x01(\tR\nparameters\"\xef\x01\n\x08ToolCall\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12)\n\x04type\x18\x02 \x01(\x0e\x32\x15.xai_api.ToolCallTypeR\x04type\x12/\n\x06status\x18\x03 \x01(\x0e\x32\x17.xai_api.ToolCallStatusR\x06status\x12(\n\rerror_message\x18\x04 \x01(\tH\x01R\x0c\x65rrorMessage\x88\x01\x01\x12\x33\n\x08\x66unction\x18\n \x01(\x0b\x32\x15.xai_api.FunctionCallH\x00R\x08\x66unctionB\x06\n\x04toolB\x10\n\x0e_error_message\"@\n\x0c\x46unctionCall\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n\targuments\x18\x02 \x01(\tR\targuments\"n\n\x0eResponseFormat\x12\x34\n\x0b\x66ormat_type\x18\x01 \x01(\x0e\x32\x13.xai_api.FormatTypeR\nformatType\x12\x1b\n\x06schema\x18\x02 \x01(\tH\x00R\x06schema\x88\x01\x01\x42\t\n\x07_schema\"\xc9\x02\n\x10SearchParameters\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x13.xai_api.SearchModeR\x04mode\x12)\n\x07sources\x18\t \x03(\x0b\x32\x0f.xai_api.SourceR\x07sources\x12\x37\n\tfrom_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08\x66romDate\x12\x33\n\x07to_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x06toDate\x12)\n\x10return_citations\x18\x07 \x01(\x08R\x0freturnCitations\x12\x31\n\x12max_search_results\x18\x08 \x01(\x05H\x00R\x10maxSearchResults\x88\x01\x01\x42\x15\n\x13_max_search_results\"\xaf\x01\n\x06Source\x12&\n\x03web\x18\x01 \x01(\x0b\x32\x12.xai_api.WebSourceH\x00R\x03web\x12)\n\x04news\x18\x02 \x01(\x0b\x32\x13.xai_api.NewsSourceH\x00R\x04news\x12 \n\x01x\x18\x03 \x01(\x0b\x32\x10.xai_api.XSourceH\x00R\x01x\x12&\n\x03rss\x18\x04 \x01(\x0b\x32\x12.xai_api.RssSourceH\x00R\x03rssB\x08\n\x06source\"\xaf\x01\n\tWebSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12)\n\x10\x61llowed_websites\x18\x05 \x03(\tR\x0f\x61llowedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\x85\x01\n\nNewsSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\xf9\x01\n\x07XSource\x12,\n\x12included_x_handles\x18\x07 \x03(\tR\x10includedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x08 \x03(\tR\x10\x65xcludedXHandles\x12\x33\n\x13post_favorite_count\x18\t \x01(\x05H\x00R\x11postFavoriteCount\x88\x01\x01\x12+\n\x0fpost_view_count\x18\n \x01(\x05H\x01R\rpostViewCount\x88\x01\x01\x42\x16\n\x14_post_favorite_countB\x12\n\x10_post_view_countJ\x04\x08\x06\x10\x07\"!\n\tRssSource\x12\x14\n\x05links\x18\x01 \x03(\tR\x05links\"\x9f\x06\n\x0fRequestSettings\x12\"\n\nmax_tokens\x18\x01 \x01(\x05H\x00R\tmaxTokens\x88\x01\x01\x12.\n\x13parallel_tool_calls\x18\x02 \x01(\x08R\x11parallelToolCalls\x12\x35\n\x14previous_response_id\x18\x03 \x01(\tH\x01R\x12previousResponseId\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x04 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x02R\x0freasoningEffort\x88\x01\x01\x12%\n\x0btemperature\x18\x05 \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12@\n\x0fresponse_format\x18\x06 \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x34\n\x0btool_choice\x18\x07 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12#\n\x05tools\x18\x08 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x18\n\x05top_p\x18\t \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x12\n\x04user\x18\n \x01(\tR\x04user\x12K\n\x11search_parameters\x18\x0b \x01(\x0b\x32\x19.xai_api.SearchParametersH\x05R\x10searchParameters\x88\x01\x01\x12%\n\x0estore_messages\x18\x0c \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\r \x01(\x08R\x13useEncryptedContent\x12\x30\n\x07include\x18\x0e \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\r\n\x0b_max_tokensB\x17\n\x15_previous_response_idB\x13\n\x11_reasoning_effortB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x14\n\x12_search_parameters\"=\n\x1aGetStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"@\n\x1d\x44\x65leteStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"A\n\x1e\x44\x65leteStoredCompletionResponse\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"\xba\x03\n\x0b\x44\x65\x62ugOutput\x12\x1a\n\x08\x61ttempts\x18\x01 \x01(\x05R\x08\x61ttempts\x12\x18\n\x07request\x18\x02 \x01(\tR\x07request\x12\x16\n\x06prompt\x18\x03 \x01(\tR\x06prompt\x12%\n\x0e\x65ngine_request\x18\t \x01(\tR\rengineRequest\x12\x1c\n\tresponses\x18\x04 \x03(\tR\tresponses\x12\x16\n\x06\x63hunks\x18\x0c \x03(\tR\x06\x63hunks\x12(\n\x10\x63\x61\x63he_read_count\x18\x05 \x01(\rR\x0e\x63\x61\x63heReadCount\x12\x33\n\x16\x63\x61\x63he_read_input_bytes\x18\x06 \x01(\x04R\x13\x63\x61\x63heReadInputBytes\x12*\n\x11\x63\x61\x63he_write_count\x18\x07 \x01(\rR\x0f\x63\x61\x63heWriteCount\x12\x35\n\x17\x63\x61\x63he_write_input_bytes\x18\x08 \x01(\x04R\x14\x63\x61\x63heWriteInputBytes\x12\x1d\n\nlb_address\x18\n \x01(\tR\tlbAddress\x12\x1f\n\x0bsampler_tag\x18\x0b \x01(\tR\nsamplerTag*\x82\x03\n\rIncludeOption\x12\x1a\n\x16INCLUDE_OPTION_INVALID\x10\x00\x12)\n%INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT\x10\x01\x12\'\n#INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT\x10\x02\x12-\n)INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT\x10\x03\x12\x31\n-INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT\x10\x04\x12\x30\n,INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT\x10\x05\x12\"\n\x1eINCLUDE_OPTION_MCP_CALL_OUTPUT\x10\x06\x12#\n\x1fINCLUDE_OPTION_INLINE_CITATIONS\x10\x07\x12$\n INCLUDE_OPTION_VERBOSE_STREAMING\x10\x08*y\n\x0bMessageRole\x12\x10\n\x0cINVALID_ROLE\x10\x00\x12\r\n\tROLE_USER\x10\x01\x12\x12\n\x0eROLE_ASSISTANT\x10\x02\x12\x0f\n\x0bROLE_SYSTEM\x10\x03\x12\x15\n\rROLE_FUNCTION\x10\x04\x1a\x02\x08\x01\x12\r\n\tROLE_TOOL\x10\x05*Y\n\x0fReasoningEffort\x12\x12\n\x0eINVALID_EFFORT\x10\x00\x12\x0e\n\nEFFORT_LOW\x10\x01\x12\x11\n\rEFFORT_MEDIUM\x10\x02\x12\x0f\n\x0b\x45\x46\x46ORT_HIGH\x10\x03*a\n\x08ToolMode\x12\x15\n\x11TOOL_MODE_INVALID\x10\x00\x12\x12\n\x0eTOOL_MODE_AUTO\x10\x01\x12\x12\n\x0eTOOL_MODE_NONE\x10\x02\x12\x16\n\x12TOOL_MODE_REQUIRED\x10\x03*u\n\nFormatType\x12\x17\n\x13\x46ORMAT_TYPE_INVALID\x10\x00\x12\x14\n\x10\x46ORMAT_TYPE_TEXT\x10\x01\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_OBJECT\x10\x02\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_SCHEMA\x10\x03*\xb1\x02\n\x0cToolCallType\x12\x1a\n\x16TOOL_CALL_TYPE_INVALID\x10\x00\x12#\n\x1fTOOL_CALL_TYPE_CLIENT_SIDE_TOOL\x10\x01\x12\"\n\x1eTOOL_CALL_TYPE_WEB_SEARCH_TOOL\x10\x02\x12 \n\x1cTOOL_CALL_TYPE_X_SEARCH_TOOL\x10\x03\x12&\n\"TOOL_CALL_TYPE_CODE_EXECUTION_TOOL\x10\x04\x12*\n&TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL\x10\x05\x12\x1b\n\x17TOOL_CALL_TYPE_MCP_TOOL\x10\x06\x12)\n%TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL\x10\x07*\x90\x01\n\x0eToolCallStatus\x12 \n\x1cTOOL_CALL_STATUS_IN_PROGRESS\x10\x00\x12\x1e\n\x1aTOOL_CALL_STATUS_COMPLETED\x10\x01\x12\x1f\n\x1bTOOL_CALL_STATUS_INCOMPLETE\x10\x02\x12\x1b\n\x17TOOL_CALL_STATUS_FAILED\x10\x03*d\n\nSearchMode\x12\x17\n\x13INVALID_SEARCH_MODE\x10\x00\x12\x13\n\x0fOFF_SEARCH_MODE\x10\x01\x12\x12\n\x0eON_SEARCH_MODE\x10\x02\x12\x14\n\x10\x41UTO_SEARCH_MODE\x10\x03\x32\xc4\x04\n\x04\x43hat\x12U\n\rGetCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12Y\n\x12GetCompletionChunk\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1f.xai_api.GetChatCompletionChunk\"\x00\x30\x01\x12[\n\x17StartDeferredCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12^\n\x15GetDeferredCompletion\x12\x1b.xai_api.GetDeferredRequest\x1a&.xai_api.GetDeferredCompletionResponse\"\x00\x12`\n\x13GetStoredCompletion\x12#.xai_api.GetStoredCompletionRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12k\n\x16\x44\x65leteStoredCompletion\x12&.xai_api.DeleteStoredCompletionRequest\x1a\'.xai_api.DeleteStoredCompletionResponse\"\x00\x42P\n\x0b\x63om.xai_apiB\tChatProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xai/api/v1/chat.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19xai/api/v1/deferred.proto\x1a\x1axai/api/v1/documents.proto\x1a\x16xai/api/v1/image.proto\x1a\x17xai/api/v1/sample.proto\x1a\x16xai/api/v1/usage.proto\"\xed\t\n\x15GetCompletionsRequest\x12,\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.MessageR\x08messages\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x12\n\x04user\x18\x10 \x01(\tR\x04user\x12\x11\n\x01n\x18\x08 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\"\n\nmax_tokens\x18\x07 \x01(\x05H\x01R\tmaxTokens\x88\x01\x01\x12\x17\n\x04seed\x18\x0b \x01(\x05H\x02R\x04seed\x88\x01\x01\x12\x12\n\x04stop\x18\x0c \x03(\tR\x04stop\x12%\n\x0btemperature\x18\x0e \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12\x18\n\x05top_p\x18\x0f \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x1a\n\x08logprobs\x18\x05 \x01(\x08R\x08logprobs\x12&\n\x0ctop_logprobs\x18\x06 \x01(\x05H\x05R\x0btopLogprobs\x88\x01\x01\x12#\n\x05tools\x18\x11 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x34\n\x0btool_choice\x18\x12 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12@\n\x0fresponse_format\x18\n \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x30\n\x11\x66requency_penalty\x18\x03 \x01(\x02H\x06R\x10\x66requencyPenalty\x88\x01\x01\x12.\n\x10presence_penalty\x18\t \x01(\x02H\x07R\x0fpresencePenalty\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x13 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x08R\x0freasoningEffort\x88\x01\x01\x12K\n\x11search_parameters\x18\x14 \x01(\x0b\x32\x19.xai_api.SearchParametersH\tR\x10searchParameters\x88\x01\x01\x12\x33\n\x13parallel_tool_calls\x18\x15 \x01(\x08H\nR\x11parallelToolCalls\x88\x01\x01\x12\x35\n\x14previous_response_id\x18\x16 \x01(\tH\x0bR\x12previousResponseId\x88\x01\x01\x12%\n\x0estore_messages\x18\x17 \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\x18 \x01(\x08R\x13useEncryptedContent\x12 \n\tmax_turns\x18\x19 \x01(\x05H\x0cR\x08maxTurns\x88\x01\x01\x12\x30\n\x07include\x18\x1a \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\x04\n\x02_nB\r\n\x0b_max_tokensB\x07\n\x05_seedB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x0f\n\r_top_logprobsB\x14\n\x12_frequency_penaltyB\x13\n\x11_presence_penaltyB\x13\n\x11_reasoning_effortB\x14\n\x12_search_parametersB\x16\n\x14_parallel_tool_callsB\x17\n\x15_previous_response_idB\x0c\n\n_max_turnsJ\x04\x08\x04\x10\x05\"\x96\x03\n\x19GetChatCompletionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x33\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutputR\x07outputs\x12\x34\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x06 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x07 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\n \x03(\tR\tcitations\x12\x34\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettingsR\x08settings\x12\x37\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xe2\x02\n\x16GetChatCompletionChunk\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x38\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunkR\x07outputs\x12\x34\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x05 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\x07 \x03(\tR\tcitations\x12\x37\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xa2\x01\n\x1dGetDeferredCompletionResponse\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x43\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\"\xc9\x01\n\x10\x43ompletionOutput\x12:\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x02 \x01(\x05R\x05index\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessageR\x07message\x12-\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\"\x9a\x02\n\x11\x43ompletionMessage\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xbe\x01\n\x15\x43ompletionOutputChunk\x12$\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.DeltaR\x05\x64\x65lta\x12-\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\x12:\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x04 \x01(\x05R\x05index\"\x8e\x02\n\x05\x44\x65lta\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xad\x02\n\x0eInlineCitation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bstart_index\x18\x02 \x01(\x05R\nstartIndex\x12\x1b\n\tend_index\x18\x06 \x01(\x05R\x08\x65ndIndex\x12\x39\n\x0cweb_citation\x18\x03 \x01(\x0b\x32\x14.xai_api.WebCitationH\x00R\x0bwebCitation\x12\x33\n\nx_citation\x18\x04 \x01(\x0b\x32\x12.xai_api.XCitationH\x00R\txCitation\x12Q\n\x14\x63ollections_citation\x18\x05 \x01(\x0b\x32\x1c.xai_api.CollectionsCitationH\x00R\x13\x63ollectionsCitationB\n\n\x08\x63itation\"\x1f\n\x0bWebCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\x1d\n\tXCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xab\x01\n\x13\x43ollectionsCitation\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x19\n\x08\x63hunk_id\x18\x02 \x01(\tR\x07\x63hunkId\x12#\n\rchunk_content\x18\x03 \x01(\tR\x0c\x63hunkContent\x12\x14\n\x05score\x18\x04 \x01(\x02R\x05score\x12%\n\x0e\x63ollection_ids\x18\x05 \x03(\tR\rcollectionIds\"6\n\x08LogProbs\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProbR\x07\x63ontent\"\x87\x01\n\x07LogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\x12\x36\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProbR\x0btopLogprobs\"R\n\nTopLogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\"\x8f\x01\n\x07\x43ontent\x12\x14\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x12\x37\n\timage_url\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentH\x00R\x08imageUrl\x12*\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x14.xai_api.FileContentH\x00R\x04\x66ileB\t\n\x07\x63ontent\"&\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\"\xd2\x02\n\x07Message\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.ContentR\x07\x63ontent\x12\x30\n\x11reasoning_content\x18\x05 \x01(\tH\x00R\x10reasoningContent\x88\x01\x01\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12\x30\n\ntool_calls\x18\x04 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x06 \x01(\tR\x10\x65ncryptedContent\x12%\n\x0ctool_call_id\x18\x07 \x01(\tH\x01R\ntoolCallId\x88\x01\x01\x42\x14\n\x12_reasoning_contentB\x0f\n\r_tool_call_id\"k\n\nToolChoice\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x11.xai_api.ToolModeH\x00R\x04mode\x12%\n\rfunction_name\x18\x02 \x01(\tH\x00R\x0c\x66unctionNameB\r\n\x0btool_choice\"\x9d\x03\n\x04Tool\x12/\n\x08\x66unction\x18\x01 \x01(\x0b\x32\x11.xai_api.FunctionH\x00R\x08\x66unction\x12\x33\n\nweb_search\x18\x03 \x01(\x0b\x32\x12.xai_api.WebSearchH\x00R\twebSearch\x12-\n\x08x_search\x18\x04 \x01(\x0b\x32\x10.xai_api.XSearchH\x00R\x07xSearch\x12?\n\x0e\x63ode_execution\x18\x05 \x01(\x0b\x32\x16.xai_api.CodeExecutionH\x00R\rcodeExecution\x12K\n\x12\x63ollections_search\x18\x06 \x01(\x0b\x32\x1a.xai_api.CollectionsSearchH\x00R\x11\x63ollectionsSearch\x12 \n\x03mcp\x18\x07 \x01(\x0b\x32\x0c.xai_api.MCPH\x00R\x03mcp\x12H\n\x11\x61ttachment_search\x18\x08 \x01(\x0b\x32\x19.xai_api.AttachmentSearchH\x00R\x10\x61ttachmentSearchB\x06\n\x04tool\"\xe7\x02\n\x03MCP\x12!\n\x0cserver_label\x18\x01 \x01(\tR\x0bserverLabel\x12-\n\x12server_description\x18\x02 \x01(\tR\x11serverDescription\x12\x1d\n\nserver_url\x18\x03 \x01(\tR\tserverUrl\x12,\n\x12\x61llowed_tool_names\x18\x04 \x03(\tR\x10\x61llowedToolNames\x12)\n\rauthorization\x18\x05 \x01(\tH\x00R\rauthorization\x88\x01\x01\x12\x43\n\rextra_headers\x18\x06 \x03(\x0b\x32\x1e.xai_api.MCP.ExtraHeadersEntryR\x0c\x65xtraHeaders\x1a?\n\x11\x45xtraHeadersEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x10\n\x0e_authorization\"\x9d\x02\n\tWebSearch\x12)\n\x10\x65xcluded_domains\x18\x01 \x03(\tR\x0f\x65xcludedDomains\x12\'\n\x0f\x61llowed_domains\x18\x02 \x03(\tR\x0e\x61llowedDomains\x12\x41\n\x1a\x65nable_image_understanding\x18\x03 \x01(\x08H\x00R\x18\x65nableImageUnderstanding\x88\x01\x01\x12H\n\ruser_location\x18\x04 \x01(\x0b\x32\x1e.xai_api.WebSearchUserLocationH\x01R\x0cuserLocation\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_location\"\xba\x01\n\x15WebSearchUserLocation\x12\x1d\n\x07\x63ountry\x18\x01 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x17\n\x04\x63ity\x18\x02 \x01(\tH\x01R\x04\x63ity\x88\x01\x01\x12\x1b\n\x06region\x18\x03 \x01(\tH\x02R\x06region\x88\x01\x01\x12\x1f\n\x08timezone\x18\x04 \x01(\tH\x03R\x08timezone\x88\x01\x01\x42\n\n\x08_countryB\x07\n\x05_cityB\t\n\x07_regionB\x0b\n\t_timezone\"\xb9\x03\n\x07XSearch\x12<\n\tfrom_date\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x08\x66romDate\x88\x01\x01\x12\x38\n\x07to_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x06toDate\x88\x01\x01\x12*\n\x11\x61llowed_x_handles\x18\x03 \x03(\tR\x0f\x61llowedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x04 \x03(\tR\x10\x65xcludedXHandles\x12\x41\n\x1a\x65nable_image_understanding\x18\x05 \x01(\x08H\x02R\x18\x65nableImageUnderstanding\x88\x01\x01\x12\x41\n\x1a\x65nable_video_understanding\x18\x06 \x01(\x08H\x03R\x18\x65nableVideoUnderstanding\x88\x01\x01\x42\x0c\n\n_from_dateB\n\n\x08_to_dateB\x1d\n\x1b_enable_image_understandingB\x1d\n\x1b_enable_video_understanding\"\x0f\n\rCodeExecution\"\x89\x03\n\x11\x43ollectionsSearch\x12%\n\x0e\x63ollection_ids\x18\x01 \x03(\tR\rcollectionIds\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12\'\n\x0cinstructions\x18\x03 \x01(\tH\x02R\x0cinstructions\x88\x01\x01\x12\x45\n\x10hybrid_retrieval\x18\x04 \x01(\x0b\x32\x18.xai_api.HybridRetrievalH\x00R\x0fhybridRetrieval\x12K\n\x12semantic_retrieval\x18\x05 \x01(\x0b\x32\x1a.xai_api.SemanticRetrievalH\x00R\x11semanticRetrieval\x12H\n\x11keyword_retrieval\x18\x06 \x01(\x0b\x32\x19.xai_api.KeywordRetrievalH\x00R\x10keywordRetrievalB\x10\n\x0eretrieval_modeB\x08\n\x06_limitB\x0f\n\r_instructions\"7\n\x10\x41ttachmentSearch\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x00R\x05limit\x88\x01\x01\x42\x08\n\x06_limit\"x\n\x08\x46unction\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\x16\n\x06strict\x18\x03 \x01(\x08R\x06strict\x12\x1e\n\nparameters\x18\x04 \x01(\tR\nparameters\"\xef\x01\n\x08ToolCall\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12)\n\x04type\x18\x02 \x01(\x0e\x32\x15.xai_api.ToolCallTypeR\x04type\x12/\n\x06status\x18\x03 \x01(\x0e\x32\x17.xai_api.ToolCallStatusR\x06status\x12(\n\rerror_message\x18\x04 \x01(\tH\x01R\x0c\x65rrorMessage\x88\x01\x01\x12\x33\n\x08\x66unction\x18\n \x01(\x0b\x32\x15.xai_api.FunctionCallH\x00R\x08\x66unctionB\x06\n\x04toolB\x10\n\x0e_error_message\"@\n\x0c\x46unctionCall\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n\targuments\x18\x02 \x01(\tR\targuments\"n\n\x0eResponseFormat\x12\x34\n\x0b\x66ormat_type\x18\x01 \x01(\x0e\x32\x13.xai_api.FormatTypeR\nformatType\x12\x1b\n\x06schema\x18\x02 \x01(\tH\x00R\x06schema\x88\x01\x01\x42\t\n\x07_schema\"\xc9\x02\n\x10SearchParameters\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x13.xai_api.SearchModeR\x04mode\x12)\n\x07sources\x18\t \x03(\x0b\x32\x0f.xai_api.SourceR\x07sources\x12\x37\n\tfrom_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08\x66romDate\x12\x33\n\x07to_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x06toDate\x12)\n\x10return_citations\x18\x07 \x01(\x08R\x0freturnCitations\x12\x31\n\x12max_search_results\x18\x08 \x01(\x05H\x00R\x10maxSearchResults\x88\x01\x01\x42\x15\n\x13_max_search_results\"\xaf\x01\n\x06Source\x12&\n\x03web\x18\x01 \x01(\x0b\x32\x12.xai_api.WebSourceH\x00R\x03web\x12)\n\x04news\x18\x02 \x01(\x0b\x32\x13.xai_api.NewsSourceH\x00R\x04news\x12 \n\x01x\x18\x03 \x01(\x0b\x32\x10.xai_api.XSourceH\x00R\x01x\x12&\n\x03rss\x18\x04 \x01(\x0b\x32\x12.xai_api.RssSourceH\x00R\x03rssB\x08\n\x06source\"\xaf\x01\n\tWebSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12)\n\x10\x61llowed_websites\x18\x05 \x03(\tR\x0f\x61llowedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\x85\x01\n\nNewsSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\xf9\x01\n\x07XSource\x12,\n\x12included_x_handles\x18\x07 \x03(\tR\x10includedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x08 \x03(\tR\x10\x65xcludedXHandles\x12\x33\n\x13post_favorite_count\x18\t \x01(\x05H\x00R\x11postFavoriteCount\x88\x01\x01\x12+\n\x0fpost_view_count\x18\n \x01(\x05H\x01R\rpostViewCount\x88\x01\x01\x42\x16\n\x14_post_favorite_countB\x12\n\x10_post_view_countJ\x04\x08\x06\x10\x07\"!\n\tRssSource\x12\x14\n\x05links\x18\x01 \x03(\tR\x05links\"\x9f\x06\n\x0fRequestSettings\x12\"\n\nmax_tokens\x18\x01 \x01(\x05H\x00R\tmaxTokens\x88\x01\x01\x12.\n\x13parallel_tool_calls\x18\x02 \x01(\x08R\x11parallelToolCalls\x12\x35\n\x14previous_response_id\x18\x03 \x01(\tH\x01R\x12previousResponseId\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x04 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x02R\x0freasoningEffort\x88\x01\x01\x12%\n\x0btemperature\x18\x05 \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12@\n\x0fresponse_format\x18\x06 \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x34\n\x0btool_choice\x18\x07 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12#\n\x05tools\x18\x08 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x18\n\x05top_p\x18\t \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x12\n\x04user\x18\n \x01(\tR\x04user\x12K\n\x11search_parameters\x18\x0b \x01(\x0b\x32\x19.xai_api.SearchParametersH\x05R\x10searchParameters\x88\x01\x01\x12%\n\x0estore_messages\x18\x0c \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\r \x01(\x08R\x13useEncryptedContent\x12\x30\n\x07include\x18\x0e \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\r\n\x0b_max_tokensB\x17\n\x15_previous_response_idB\x13\n\x11_reasoning_effortB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x14\n\x12_search_parameters\"=\n\x1aGetStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"@\n\x1d\x44\x65leteStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"A\n\x1e\x44\x65leteStoredCompletionResponse\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"\xba\x03\n\x0b\x44\x65\x62ugOutput\x12\x1a\n\x08\x61ttempts\x18\x01 \x01(\x05R\x08\x61ttempts\x12\x18\n\x07request\x18\x02 \x01(\tR\x07request\x12\x16\n\x06prompt\x18\x03 \x01(\tR\x06prompt\x12%\n\x0e\x65ngine_request\x18\t \x01(\tR\rengineRequest\x12\x1c\n\tresponses\x18\x04 \x03(\tR\tresponses\x12\x16\n\x06\x63hunks\x18\x0c \x03(\tR\x06\x63hunks\x12(\n\x10\x63\x61\x63he_read_count\x18\x05 \x01(\rR\x0e\x63\x61\x63heReadCount\x12\x33\n\x16\x63\x61\x63he_read_input_bytes\x18\x06 \x01(\x04R\x13\x63\x61\x63heReadInputBytes\x12*\n\x11\x63\x61\x63he_write_count\x18\x07 \x01(\rR\x0f\x63\x61\x63heWriteCount\x12\x35\n\x17\x63\x61\x63he_write_input_bytes\x18\x08 \x01(\x04R\x14\x63\x61\x63heWriteInputBytes\x12\x1d\n\nlb_address\x18\n \x01(\tR\tlbAddress\x12\x1f\n\x0bsampler_tag\x18\x0b \x01(\tR\nsamplerTag*\x82\x03\n\rIncludeOption\x12\x1a\n\x16INCLUDE_OPTION_INVALID\x10\x00\x12)\n%INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT\x10\x01\x12\'\n#INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT\x10\x02\x12-\n)INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT\x10\x03\x12\x31\n-INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT\x10\x04\x12\x30\n,INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT\x10\x05\x12\"\n\x1eINCLUDE_OPTION_MCP_CALL_OUTPUT\x10\x06\x12#\n\x1fINCLUDE_OPTION_INLINE_CITATIONS\x10\x07\x12$\n INCLUDE_OPTION_VERBOSE_STREAMING\x10\x08*\x8d\x01\n\x0bMessageRole\x12\x10\n\x0cINVALID_ROLE\x10\x00\x12\r\n\tROLE_USER\x10\x01\x12\x12\n\x0eROLE_ASSISTANT\x10\x02\x12\x0f\n\x0bROLE_SYSTEM\x10\x03\x12\x15\n\rROLE_FUNCTION\x10\x04\x1a\x02\x08\x01\x12\r\n\tROLE_TOOL\x10\x05\x12\x12\n\x0eROLE_DEVELOPER\x10\x06*Y\n\x0fReasoningEffort\x12\x12\n\x0eINVALID_EFFORT\x10\x00\x12\x0e\n\nEFFORT_LOW\x10\x01\x12\x11\n\rEFFORT_MEDIUM\x10\x02\x12\x0f\n\x0b\x45\x46\x46ORT_HIGH\x10\x03*a\n\x08ToolMode\x12\x15\n\x11TOOL_MODE_INVALID\x10\x00\x12\x12\n\x0eTOOL_MODE_AUTO\x10\x01\x12\x12\n\x0eTOOL_MODE_NONE\x10\x02\x12\x16\n\x12TOOL_MODE_REQUIRED\x10\x03*u\n\nFormatType\x12\x17\n\x13\x46ORMAT_TYPE_INVALID\x10\x00\x12\x14\n\x10\x46ORMAT_TYPE_TEXT\x10\x01\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_OBJECT\x10\x02\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_SCHEMA\x10\x03*\xb1\x02\n\x0cToolCallType\x12\x1a\n\x16TOOL_CALL_TYPE_INVALID\x10\x00\x12#\n\x1fTOOL_CALL_TYPE_CLIENT_SIDE_TOOL\x10\x01\x12\"\n\x1eTOOL_CALL_TYPE_WEB_SEARCH_TOOL\x10\x02\x12 \n\x1cTOOL_CALL_TYPE_X_SEARCH_TOOL\x10\x03\x12&\n\"TOOL_CALL_TYPE_CODE_EXECUTION_TOOL\x10\x04\x12*\n&TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL\x10\x05\x12\x1b\n\x17TOOL_CALL_TYPE_MCP_TOOL\x10\x06\x12)\n%TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL\x10\x07*\x90\x01\n\x0eToolCallStatus\x12 \n\x1cTOOL_CALL_STATUS_IN_PROGRESS\x10\x00\x12\x1e\n\x1aTOOL_CALL_STATUS_COMPLETED\x10\x01\x12\x1f\n\x1bTOOL_CALL_STATUS_INCOMPLETE\x10\x02\x12\x1b\n\x17TOOL_CALL_STATUS_FAILED\x10\x03*d\n\nSearchMode\x12\x17\n\x13INVALID_SEARCH_MODE\x10\x00\x12\x13\n\x0fOFF_SEARCH_MODE\x10\x01\x12\x12\n\x0eON_SEARCH_MODE\x10\x02\x12\x14\n\x10\x41UTO_SEARCH_MODE\x10\x03\x32\xc4\x04\n\x04\x43hat\x12U\n\rGetCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12Y\n\x12GetCompletionChunk\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1f.xai_api.GetChatCompletionChunk\"\x00\x30\x01\x12[\n\x17StartDeferredCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12^\n\x15GetDeferredCompletion\x12\x1b.xai_api.GetDeferredRequest\x1a&.xai_api.GetDeferredCompletionResponse\"\x00\x12`\n\x13GetStoredCompletion\x12#.xai_api.GetStoredCompletionRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12k\n\x16\x44\x65leteStoredCompletion\x12&.xai_api.DeleteStoredCompletionRequest\x1a\'.xai_api.DeleteStoredCompletionResponse\"\x00\x42P\n\x0b\x63om.xai_apiB\tChatProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -44,20 +44,20 @@ _globals['_MCP_EXTRAHEADERSENTRY']._serialized_options = b'8\001' _globals['_INCLUDEOPTION']._serialized_start=10067 _globals['_INCLUDEOPTION']._serialized_end=10453 - _globals['_MESSAGEROLE']._serialized_start=10455 - _globals['_MESSAGEROLE']._serialized_end=10576 - _globals['_REASONINGEFFORT']._serialized_start=10578 - _globals['_REASONINGEFFORT']._serialized_end=10667 - _globals['_TOOLMODE']._serialized_start=10669 - _globals['_TOOLMODE']._serialized_end=10766 - _globals['_FORMATTYPE']._serialized_start=10768 - _globals['_FORMATTYPE']._serialized_end=10885 - _globals['_TOOLCALLTYPE']._serialized_start=10888 - _globals['_TOOLCALLTYPE']._serialized_end=11193 - _globals['_TOOLCALLSTATUS']._serialized_start=11196 - _globals['_TOOLCALLSTATUS']._serialized_end=11340 - _globals['_SEARCHMODE']._serialized_start=11342 - _globals['_SEARCHMODE']._serialized_end=11442 + _globals['_MESSAGEROLE']._serialized_start=10456 + _globals['_MESSAGEROLE']._serialized_end=10597 + _globals['_REASONINGEFFORT']._serialized_start=10599 + _globals['_REASONINGEFFORT']._serialized_end=10688 + _globals['_TOOLMODE']._serialized_start=10690 + _globals['_TOOLMODE']._serialized_end=10787 + _globals['_FORMATTYPE']._serialized_start=10789 + _globals['_FORMATTYPE']._serialized_end=10906 + _globals['_TOOLCALLTYPE']._serialized_start=10909 + _globals['_TOOLCALLTYPE']._serialized_end=11214 + _globals['_TOOLCALLSTATUS']._serialized_start=11217 + _globals['_TOOLCALLSTATUS']._serialized_end=11361 + _globals['_SEARCHMODE']._serialized_start=11363 + _globals['_SEARCHMODE']._serialized_end=11463 _globals['_GETCOMPLETIONSREQUEST']._serialized_start=196 _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1457 _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1460 @@ -144,6 +144,6 @@ _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=9619 _globals['_DEBUGOUTPUT']._serialized_start=9622 _globals['_DEBUGOUTPUT']._serialized_end=10064 - _globals['_CHAT']._serialized_start=11445 - _globals['_CHAT']._serialized_end=12025 + _globals['_CHAT']._serialized_start=11466 + _globals['_CHAT']._serialized_end=12046 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v5/chat_pb2.pyi b/src/xai_sdk/proto/v5/chat_pb2.pyi index 92808c0..45e432a 100644 --- a/src/xai_sdk/proto/v5/chat_pb2.pyi +++ b/src/xai_sdk/proto/v5/chat_pb2.pyi @@ -32,6 +32,7 @@ class MessageRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): ROLE_SYSTEM: _ClassVar[MessageRole] ROLE_FUNCTION: _ClassVar[MessageRole] ROLE_TOOL: _ClassVar[MessageRole] + ROLE_DEVELOPER: _ClassVar[MessageRole] class ReasoningEffort(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -93,6 +94,7 @@ ROLE_ASSISTANT: MessageRole ROLE_SYSTEM: MessageRole ROLE_FUNCTION: MessageRole ROLE_TOOL: MessageRole +ROLE_DEVELOPER: MessageRole INVALID_EFFORT: ReasoningEffort EFFORT_LOW: ReasoningEffort EFFORT_MEDIUM: ReasoningEffort diff --git a/src/xai_sdk/proto/v6/chat_pb2.py b/src/xai_sdk/proto/v6/chat_pb2.py index c540058..4319c88 100644 --- a/src/xai_sdk/proto/v6/chat_pb2.py +++ b/src/xai_sdk/proto/v6/chat_pb2.py @@ -30,7 +30,7 @@ from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xai/api/v1/chat.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19xai/api/v1/deferred.proto\x1a\x1axai/api/v1/documents.proto\x1a\x16xai/api/v1/image.proto\x1a\x17xai/api/v1/sample.proto\x1a\x16xai/api/v1/usage.proto\"\xed\t\n\x15GetCompletionsRequest\x12,\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.MessageR\x08messages\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x12\n\x04user\x18\x10 \x01(\tR\x04user\x12\x11\n\x01n\x18\x08 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\"\n\nmax_tokens\x18\x07 \x01(\x05H\x01R\tmaxTokens\x88\x01\x01\x12\x17\n\x04seed\x18\x0b \x01(\x05H\x02R\x04seed\x88\x01\x01\x12\x12\n\x04stop\x18\x0c \x03(\tR\x04stop\x12%\n\x0btemperature\x18\x0e \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12\x18\n\x05top_p\x18\x0f \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x1a\n\x08logprobs\x18\x05 \x01(\x08R\x08logprobs\x12&\n\x0ctop_logprobs\x18\x06 \x01(\x05H\x05R\x0btopLogprobs\x88\x01\x01\x12#\n\x05tools\x18\x11 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x34\n\x0btool_choice\x18\x12 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12@\n\x0fresponse_format\x18\n \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x30\n\x11\x66requency_penalty\x18\x03 \x01(\x02H\x06R\x10\x66requencyPenalty\x88\x01\x01\x12.\n\x10presence_penalty\x18\t \x01(\x02H\x07R\x0fpresencePenalty\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x13 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x08R\x0freasoningEffort\x88\x01\x01\x12K\n\x11search_parameters\x18\x14 \x01(\x0b\x32\x19.xai_api.SearchParametersH\tR\x10searchParameters\x88\x01\x01\x12\x33\n\x13parallel_tool_calls\x18\x15 \x01(\x08H\nR\x11parallelToolCalls\x88\x01\x01\x12\x35\n\x14previous_response_id\x18\x16 \x01(\tH\x0bR\x12previousResponseId\x88\x01\x01\x12%\n\x0estore_messages\x18\x17 \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\x18 \x01(\x08R\x13useEncryptedContent\x12 \n\tmax_turns\x18\x19 \x01(\x05H\x0cR\x08maxTurns\x88\x01\x01\x12\x30\n\x07include\x18\x1a \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\x04\n\x02_nB\r\n\x0b_max_tokensB\x07\n\x05_seedB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x0f\n\r_top_logprobsB\x14\n\x12_frequency_penaltyB\x13\n\x11_presence_penaltyB\x13\n\x11_reasoning_effortB\x14\n\x12_search_parametersB\x16\n\x14_parallel_tool_callsB\x17\n\x15_previous_response_idB\x0c\n\n_max_turnsJ\x04\x08\x04\x10\x05\"\x96\x03\n\x19GetChatCompletionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x33\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutputR\x07outputs\x12\x34\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x06 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x07 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\n \x03(\tR\tcitations\x12\x34\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettingsR\x08settings\x12\x37\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xe2\x02\n\x16GetChatCompletionChunk\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x38\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunkR\x07outputs\x12\x34\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x05 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\x07 \x03(\tR\tcitations\x12\x37\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xa2\x01\n\x1dGetDeferredCompletionResponse\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x43\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\"\xc9\x01\n\x10\x43ompletionOutput\x12:\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x02 \x01(\x05R\x05index\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessageR\x07message\x12-\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\"\x9a\x02\n\x11\x43ompletionMessage\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xbe\x01\n\x15\x43ompletionOutputChunk\x12$\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.DeltaR\x05\x64\x65lta\x12-\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\x12:\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x04 \x01(\x05R\x05index\"\x8e\x02\n\x05\x44\x65lta\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xad\x02\n\x0eInlineCitation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bstart_index\x18\x02 \x01(\x05R\nstartIndex\x12\x1b\n\tend_index\x18\x06 \x01(\x05R\x08\x65ndIndex\x12\x39\n\x0cweb_citation\x18\x03 \x01(\x0b\x32\x14.xai_api.WebCitationH\x00R\x0bwebCitation\x12\x33\n\nx_citation\x18\x04 \x01(\x0b\x32\x12.xai_api.XCitationH\x00R\txCitation\x12Q\n\x14\x63ollections_citation\x18\x05 \x01(\x0b\x32\x1c.xai_api.CollectionsCitationH\x00R\x13\x63ollectionsCitationB\n\n\x08\x63itation\"\x1f\n\x0bWebCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\x1d\n\tXCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xab\x01\n\x13\x43ollectionsCitation\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x19\n\x08\x63hunk_id\x18\x02 \x01(\tR\x07\x63hunkId\x12#\n\rchunk_content\x18\x03 \x01(\tR\x0c\x63hunkContent\x12\x14\n\x05score\x18\x04 \x01(\x02R\x05score\x12%\n\x0e\x63ollection_ids\x18\x05 \x03(\tR\rcollectionIds\"6\n\x08LogProbs\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProbR\x07\x63ontent\"\x87\x01\n\x07LogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\x12\x36\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProbR\x0btopLogprobs\"R\n\nTopLogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\"\x8f\x01\n\x07\x43ontent\x12\x14\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x12\x37\n\timage_url\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentH\x00R\x08imageUrl\x12*\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x14.xai_api.FileContentH\x00R\x04\x66ileB\t\n\x07\x63ontent\"&\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\"\xd2\x02\n\x07Message\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.ContentR\x07\x63ontent\x12\x30\n\x11reasoning_content\x18\x05 \x01(\tH\x00R\x10reasoningContent\x88\x01\x01\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12\x30\n\ntool_calls\x18\x04 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x06 \x01(\tR\x10\x65ncryptedContent\x12%\n\x0ctool_call_id\x18\x07 \x01(\tH\x01R\ntoolCallId\x88\x01\x01\x42\x14\n\x12_reasoning_contentB\x0f\n\r_tool_call_id\"k\n\nToolChoice\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x11.xai_api.ToolModeH\x00R\x04mode\x12%\n\rfunction_name\x18\x02 \x01(\tH\x00R\x0c\x66unctionNameB\r\n\x0btool_choice\"\x9d\x03\n\x04Tool\x12/\n\x08\x66unction\x18\x01 \x01(\x0b\x32\x11.xai_api.FunctionH\x00R\x08\x66unction\x12\x33\n\nweb_search\x18\x03 \x01(\x0b\x32\x12.xai_api.WebSearchH\x00R\twebSearch\x12-\n\x08x_search\x18\x04 \x01(\x0b\x32\x10.xai_api.XSearchH\x00R\x07xSearch\x12?\n\x0e\x63ode_execution\x18\x05 \x01(\x0b\x32\x16.xai_api.CodeExecutionH\x00R\rcodeExecution\x12K\n\x12\x63ollections_search\x18\x06 \x01(\x0b\x32\x1a.xai_api.CollectionsSearchH\x00R\x11\x63ollectionsSearch\x12 \n\x03mcp\x18\x07 \x01(\x0b\x32\x0c.xai_api.MCPH\x00R\x03mcp\x12H\n\x11\x61ttachment_search\x18\x08 \x01(\x0b\x32\x19.xai_api.AttachmentSearchH\x00R\x10\x61ttachmentSearchB\x06\n\x04tool\"\xe7\x02\n\x03MCP\x12!\n\x0cserver_label\x18\x01 \x01(\tR\x0bserverLabel\x12-\n\x12server_description\x18\x02 \x01(\tR\x11serverDescription\x12\x1d\n\nserver_url\x18\x03 \x01(\tR\tserverUrl\x12,\n\x12\x61llowed_tool_names\x18\x04 \x03(\tR\x10\x61llowedToolNames\x12)\n\rauthorization\x18\x05 \x01(\tH\x00R\rauthorization\x88\x01\x01\x12\x43\n\rextra_headers\x18\x06 \x03(\x0b\x32\x1e.xai_api.MCP.ExtraHeadersEntryR\x0c\x65xtraHeaders\x1a?\n\x11\x45xtraHeadersEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x10\n\x0e_authorization\"\x9d\x02\n\tWebSearch\x12)\n\x10\x65xcluded_domains\x18\x01 \x03(\tR\x0f\x65xcludedDomains\x12\'\n\x0f\x61llowed_domains\x18\x02 \x03(\tR\x0e\x61llowedDomains\x12\x41\n\x1a\x65nable_image_understanding\x18\x03 \x01(\x08H\x00R\x18\x65nableImageUnderstanding\x88\x01\x01\x12H\n\ruser_location\x18\x04 \x01(\x0b\x32\x1e.xai_api.WebSearchUserLocationH\x01R\x0cuserLocation\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_location\"\xba\x01\n\x15WebSearchUserLocation\x12\x1d\n\x07\x63ountry\x18\x01 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x17\n\x04\x63ity\x18\x02 \x01(\tH\x01R\x04\x63ity\x88\x01\x01\x12\x1b\n\x06region\x18\x03 \x01(\tH\x02R\x06region\x88\x01\x01\x12\x1f\n\x08timezone\x18\x04 \x01(\tH\x03R\x08timezone\x88\x01\x01\x42\n\n\x08_countryB\x07\n\x05_cityB\t\n\x07_regionB\x0b\n\t_timezone\"\xb9\x03\n\x07XSearch\x12<\n\tfrom_date\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x08\x66romDate\x88\x01\x01\x12\x38\n\x07to_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x06toDate\x88\x01\x01\x12*\n\x11\x61llowed_x_handles\x18\x03 \x03(\tR\x0f\x61llowedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x04 \x03(\tR\x10\x65xcludedXHandles\x12\x41\n\x1a\x65nable_image_understanding\x18\x05 \x01(\x08H\x02R\x18\x65nableImageUnderstanding\x88\x01\x01\x12\x41\n\x1a\x65nable_video_understanding\x18\x06 \x01(\x08H\x03R\x18\x65nableVideoUnderstanding\x88\x01\x01\x42\x0c\n\n_from_dateB\n\n\x08_to_dateB\x1d\n\x1b_enable_image_understandingB\x1d\n\x1b_enable_video_understanding\"\x0f\n\rCodeExecution\"\x89\x03\n\x11\x43ollectionsSearch\x12%\n\x0e\x63ollection_ids\x18\x01 \x03(\tR\rcollectionIds\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12\'\n\x0cinstructions\x18\x03 \x01(\tH\x02R\x0cinstructions\x88\x01\x01\x12\x45\n\x10hybrid_retrieval\x18\x04 \x01(\x0b\x32\x18.xai_api.HybridRetrievalH\x00R\x0fhybridRetrieval\x12K\n\x12semantic_retrieval\x18\x05 \x01(\x0b\x32\x1a.xai_api.SemanticRetrievalH\x00R\x11semanticRetrieval\x12H\n\x11keyword_retrieval\x18\x06 \x01(\x0b\x32\x19.xai_api.KeywordRetrievalH\x00R\x10keywordRetrievalB\x10\n\x0eretrieval_modeB\x08\n\x06_limitB\x0f\n\r_instructions\"7\n\x10\x41ttachmentSearch\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x00R\x05limit\x88\x01\x01\x42\x08\n\x06_limit\"x\n\x08\x46unction\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\x16\n\x06strict\x18\x03 \x01(\x08R\x06strict\x12\x1e\n\nparameters\x18\x04 \x01(\tR\nparameters\"\xef\x01\n\x08ToolCall\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12)\n\x04type\x18\x02 \x01(\x0e\x32\x15.xai_api.ToolCallTypeR\x04type\x12/\n\x06status\x18\x03 \x01(\x0e\x32\x17.xai_api.ToolCallStatusR\x06status\x12(\n\rerror_message\x18\x04 \x01(\tH\x01R\x0c\x65rrorMessage\x88\x01\x01\x12\x33\n\x08\x66unction\x18\n \x01(\x0b\x32\x15.xai_api.FunctionCallH\x00R\x08\x66unctionB\x06\n\x04toolB\x10\n\x0e_error_message\"@\n\x0c\x46unctionCall\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n\targuments\x18\x02 \x01(\tR\targuments\"n\n\x0eResponseFormat\x12\x34\n\x0b\x66ormat_type\x18\x01 \x01(\x0e\x32\x13.xai_api.FormatTypeR\nformatType\x12\x1b\n\x06schema\x18\x02 \x01(\tH\x00R\x06schema\x88\x01\x01\x42\t\n\x07_schema\"\xc9\x02\n\x10SearchParameters\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x13.xai_api.SearchModeR\x04mode\x12)\n\x07sources\x18\t \x03(\x0b\x32\x0f.xai_api.SourceR\x07sources\x12\x37\n\tfrom_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08\x66romDate\x12\x33\n\x07to_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x06toDate\x12)\n\x10return_citations\x18\x07 \x01(\x08R\x0freturnCitations\x12\x31\n\x12max_search_results\x18\x08 \x01(\x05H\x00R\x10maxSearchResults\x88\x01\x01\x42\x15\n\x13_max_search_results\"\xaf\x01\n\x06Source\x12&\n\x03web\x18\x01 \x01(\x0b\x32\x12.xai_api.WebSourceH\x00R\x03web\x12)\n\x04news\x18\x02 \x01(\x0b\x32\x13.xai_api.NewsSourceH\x00R\x04news\x12 \n\x01x\x18\x03 \x01(\x0b\x32\x10.xai_api.XSourceH\x00R\x01x\x12&\n\x03rss\x18\x04 \x01(\x0b\x32\x12.xai_api.RssSourceH\x00R\x03rssB\x08\n\x06source\"\xaf\x01\n\tWebSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12)\n\x10\x61llowed_websites\x18\x05 \x03(\tR\x0f\x61llowedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\x85\x01\n\nNewsSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\xf9\x01\n\x07XSource\x12,\n\x12included_x_handles\x18\x07 \x03(\tR\x10includedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x08 \x03(\tR\x10\x65xcludedXHandles\x12\x33\n\x13post_favorite_count\x18\t \x01(\x05H\x00R\x11postFavoriteCount\x88\x01\x01\x12+\n\x0fpost_view_count\x18\n \x01(\x05H\x01R\rpostViewCount\x88\x01\x01\x42\x16\n\x14_post_favorite_countB\x12\n\x10_post_view_countJ\x04\x08\x06\x10\x07\"!\n\tRssSource\x12\x14\n\x05links\x18\x01 \x03(\tR\x05links\"\x9f\x06\n\x0fRequestSettings\x12\"\n\nmax_tokens\x18\x01 \x01(\x05H\x00R\tmaxTokens\x88\x01\x01\x12.\n\x13parallel_tool_calls\x18\x02 \x01(\x08R\x11parallelToolCalls\x12\x35\n\x14previous_response_id\x18\x03 \x01(\tH\x01R\x12previousResponseId\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x04 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x02R\x0freasoningEffort\x88\x01\x01\x12%\n\x0btemperature\x18\x05 \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12@\n\x0fresponse_format\x18\x06 \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x34\n\x0btool_choice\x18\x07 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12#\n\x05tools\x18\x08 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x18\n\x05top_p\x18\t \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x12\n\x04user\x18\n \x01(\tR\x04user\x12K\n\x11search_parameters\x18\x0b \x01(\x0b\x32\x19.xai_api.SearchParametersH\x05R\x10searchParameters\x88\x01\x01\x12%\n\x0estore_messages\x18\x0c \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\r \x01(\x08R\x13useEncryptedContent\x12\x30\n\x07include\x18\x0e \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\r\n\x0b_max_tokensB\x17\n\x15_previous_response_idB\x13\n\x11_reasoning_effortB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x14\n\x12_search_parameters\"=\n\x1aGetStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"@\n\x1d\x44\x65leteStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"A\n\x1e\x44\x65leteStoredCompletionResponse\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"\xba\x03\n\x0b\x44\x65\x62ugOutput\x12\x1a\n\x08\x61ttempts\x18\x01 \x01(\x05R\x08\x61ttempts\x12\x18\n\x07request\x18\x02 \x01(\tR\x07request\x12\x16\n\x06prompt\x18\x03 \x01(\tR\x06prompt\x12%\n\x0e\x65ngine_request\x18\t \x01(\tR\rengineRequest\x12\x1c\n\tresponses\x18\x04 \x03(\tR\tresponses\x12\x16\n\x06\x63hunks\x18\x0c \x03(\tR\x06\x63hunks\x12(\n\x10\x63\x61\x63he_read_count\x18\x05 \x01(\rR\x0e\x63\x61\x63heReadCount\x12\x33\n\x16\x63\x61\x63he_read_input_bytes\x18\x06 \x01(\x04R\x13\x63\x61\x63heReadInputBytes\x12*\n\x11\x63\x61\x63he_write_count\x18\x07 \x01(\rR\x0f\x63\x61\x63heWriteCount\x12\x35\n\x17\x63\x61\x63he_write_input_bytes\x18\x08 \x01(\x04R\x14\x63\x61\x63heWriteInputBytes\x12\x1d\n\nlb_address\x18\n \x01(\tR\tlbAddress\x12\x1f\n\x0bsampler_tag\x18\x0b \x01(\tR\nsamplerTag*\x82\x03\n\rIncludeOption\x12\x1a\n\x16INCLUDE_OPTION_INVALID\x10\x00\x12)\n%INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT\x10\x01\x12\'\n#INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT\x10\x02\x12-\n)INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT\x10\x03\x12\x31\n-INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT\x10\x04\x12\x30\n,INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT\x10\x05\x12\"\n\x1eINCLUDE_OPTION_MCP_CALL_OUTPUT\x10\x06\x12#\n\x1fINCLUDE_OPTION_INLINE_CITATIONS\x10\x07\x12$\n INCLUDE_OPTION_VERBOSE_STREAMING\x10\x08*y\n\x0bMessageRole\x12\x10\n\x0cINVALID_ROLE\x10\x00\x12\r\n\tROLE_USER\x10\x01\x12\x12\n\x0eROLE_ASSISTANT\x10\x02\x12\x0f\n\x0bROLE_SYSTEM\x10\x03\x12\x15\n\rROLE_FUNCTION\x10\x04\x1a\x02\x08\x01\x12\r\n\tROLE_TOOL\x10\x05*Y\n\x0fReasoningEffort\x12\x12\n\x0eINVALID_EFFORT\x10\x00\x12\x0e\n\nEFFORT_LOW\x10\x01\x12\x11\n\rEFFORT_MEDIUM\x10\x02\x12\x0f\n\x0b\x45\x46\x46ORT_HIGH\x10\x03*a\n\x08ToolMode\x12\x15\n\x11TOOL_MODE_INVALID\x10\x00\x12\x12\n\x0eTOOL_MODE_AUTO\x10\x01\x12\x12\n\x0eTOOL_MODE_NONE\x10\x02\x12\x16\n\x12TOOL_MODE_REQUIRED\x10\x03*u\n\nFormatType\x12\x17\n\x13\x46ORMAT_TYPE_INVALID\x10\x00\x12\x14\n\x10\x46ORMAT_TYPE_TEXT\x10\x01\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_OBJECT\x10\x02\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_SCHEMA\x10\x03*\xb1\x02\n\x0cToolCallType\x12\x1a\n\x16TOOL_CALL_TYPE_INVALID\x10\x00\x12#\n\x1fTOOL_CALL_TYPE_CLIENT_SIDE_TOOL\x10\x01\x12\"\n\x1eTOOL_CALL_TYPE_WEB_SEARCH_TOOL\x10\x02\x12 \n\x1cTOOL_CALL_TYPE_X_SEARCH_TOOL\x10\x03\x12&\n\"TOOL_CALL_TYPE_CODE_EXECUTION_TOOL\x10\x04\x12*\n&TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL\x10\x05\x12\x1b\n\x17TOOL_CALL_TYPE_MCP_TOOL\x10\x06\x12)\n%TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL\x10\x07*\x90\x01\n\x0eToolCallStatus\x12 \n\x1cTOOL_CALL_STATUS_IN_PROGRESS\x10\x00\x12\x1e\n\x1aTOOL_CALL_STATUS_COMPLETED\x10\x01\x12\x1f\n\x1bTOOL_CALL_STATUS_INCOMPLETE\x10\x02\x12\x1b\n\x17TOOL_CALL_STATUS_FAILED\x10\x03*d\n\nSearchMode\x12\x17\n\x13INVALID_SEARCH_MODE\x10\x00\x12\x13\n\x0fOFF_SEARCH_MODE\x10\x01\x12\x12\n\x0eON_SEARCH_MODE\x10\x02\x12\x14\n\x10\x41UTO_SEARCH_MODE\x10\x03\x32\xc4\x04\n\x04\x43hat\x12U\n\rGetCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12Y\n\x12GetCompletionChunk\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1f.xai_api.GetChatCompletionChunk\"\x00\x30\x01\x12[\n\x17StartDeferredCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12^\n\x15GetDeferredCompletion\x12\x1b.xai_api.GetDeferredRequest\x1a&.xai_api.GetDeferredCompletionResponse\"\x00\x12`\n\x13GetStoredCompletion\x12#.xai_api.GetStoredCompletionRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12k\n\x16\x44\x65leteStoredCompletion\x12&.xai_api.DeleteStoredCompletionRequest\x1a\'.xai_api.DeleteStoredCompletionResponse\"\x00\x42P\n\x0b\x63om.xai_apiB\tChatProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15xai/api/v1/chat.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x19xai/api/v1/deferred.proto\x1a\x1axai/api/v1/documents.proto\x1a\x16xai/api/v1/image.proto\x1a\x17xai/api/v1/sample.proto\x1a\x16xai/api/v1/usage.proto\"\xed\t\n\x15GetCompletionsRequest\x12,\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.MessageR\x08messages\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x12\n\x04user\x18\x10 \x01(\tR\x04user\x12\x11\n\x01n\x18\x08 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\"\n\nmax_tokens\x18\x07 \x01(\x05H\x01R\tmaxTokens\x88\x01\x01\x12\x17\n\x04seed\x18\x0b \x01(\x05H\x02R\x04seed\x88\x01\x01\x12\x12\n\x04stop\x18\x0c \x03(\tR\x04stop\x12%\n\x0btemperature\x18\x0e \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12\x18\n\x05top_p\x18\x0f \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x1a\n\x08logprobs\x18\x05 \x01(\x08R\x08logprobs\x12&\n\x0ctop_logprobs\x18\x06 \x01(\x05H\x05R\x0btopLogprobs\x88\x01\x01\x12#\n\x05tools\x18\x11 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x34\n\x0btool_choice\x18\x12 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12@\n\x0fresponse_format\x18\n \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x30\n\x11\x66requency_penalty\x18\x03 \x01(\x02H\x06R\x10\x66requencyPenalty\x88\x01\x01\x12.\n\x10presence_penalty\x18\t \x01(\x02H\x07R\x0fpresencePenalty\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x13 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x08R\x0freasoningEffort\x88\x01\x01\x12K\n\x11search_parameters\x18\x14 \x01(\x0b\x32\x19.xai_api.SearchParametersH\tR\x10searchParameters\x88\x01\x01\x12\x33\n\x13parallel_tool_calls\x18\x15 \x01(\x08H\nR\x11parallelToolCalls\x88\x01\x01\x12\x35\n\x14previous_response_id\x18\x16 \x01(\tH\x0bR\x12previousResponseId\x88\x01\x01\x12%\n\x0estore_messages\x18\x17 \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\x18 \x01(\x08R\x13useEncryptedContent\x12 \n\tmax_turns\x18\x19 \x01(\x05H\x0cR\x08maxTurns\x88\x01\x01\x12\x30\n\x07include\x18\x1a \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\x04\n\x02_nB\r\n\x0b_max_tokensB\x07\n\x05_seedB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x0f\n\r_top_logprobsB\x14\n\x12_frequency_penaltyB\x13\n\x11_presence_penaltyB\x13\n\x11_reasoning_effortB\x14\n\x12_search_parametersB\x16\n\x14_parallel_tool_callsB\x17\n\x15_previous_response_idB\x0c\n\n_max_turnsJ\x04\x08\x04\x10\x05\"\x96\x03\n\x19GetChatCompletionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x33\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutputR\x07outputs\x12\x34\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x06 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x07 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\n \x03(\tR\tcitations\x12\x34\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettingsR\x08settings\x12\x37\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xe2\x02\n\x16GetChatCompletionChunk\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x38\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunkR\x07outputs\x12\x34\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x05 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\x07 \x03(\tR\tcitations\x12\x37\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xa2\x01\n\x1dGetDeferredCompletionResponse\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x43\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\"\xc9\x01\n\x10\x43ompletionOutput\x12:\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x02 \x01(\x05R\x05index\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessageR\x07message\x12-\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\"\x9a\x02\n\x11\x43ompletionMessage\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xbe\x01\n\x15\x43ompletionOutputChunk\x12$\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.DeltaR\x05\x64\x65lta\x12-\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\x12:\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x04 \x01(\x05R\x05index\"\x8e\x02\n\x05\x44\x65lta\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xad\x02\n\x0eInlineCitation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bstart_index\x18\x02 \x01(\x05R\nstartIndex\x12\x1b\n\tend_index\x18\x06 \x01(\x05R\x08\x65ndIndex\x12\x39\n\x0cweb_citation\x18\x03 \x01(\x0b\x32\x14.xai_api.WebCitationH\x00R\x0bwebCitation\x12\x33\n\nx_citation\x18\x04 \x01(\x0b\x32\x12.xai_api.XCitationH\x00R\txCitation\x12Q\n\x14\x63ollections_citation\x18\x05 \x01(\x0b\x32\x1c.xai_api.CollectionsCitationH\x00R\x13\x63ollectionsCitationB\n\n\x08\x63itation\"\x1f\n\x0bWebCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\x1d\n\tXCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xab\x01\n\x13\x43ollectionsCitation\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x19\n\x08\x63hunk_id\x18\x02 \x01(\tR\x07\x63hunkId\x12#\n\rchunk_content\x18\x03 \x01(\tR\x0c\x63hunkContent\x12\x14\n\x05score\x18\x04 \x01(\x02R\x05score\x12%\n\x0e\x63ollection_ids\x18\x05 \x03(\tR\rcollectionIds\"6\n\x08LogProbs\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProbR\x07\x63ontent\"\x87\x01\n\x07LogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\x12\x36\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProbR\x0btopLogprobs\"R\n\nTopLogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\"\x8f\x01\n\x07\x43ontent\x12\x14\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x12\x37\n\timage_url\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentH\x00R\x08imageUrl\x12*\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x14.xai_api.FileContentH\x00R\x04\x66ileB\t\n\x07\x63ontent\"&\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\"\xd2\x02\n\x07Message\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.ContentR\x07\x63ontent\x12\x30\n\x11reasoning_content\x18\x05 \x01(\tH\x00R\x10reasoningContent\x88\x01\x01\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x12\n\x04name\x18\x03 \x01(\tR\x04name\x12\x30\n\ntool_calls\x18\x04 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x06 \x01(\tR\x10\x65ncryptedContent\x12%\n\x0ctool_call_id\x18\x07 \x01(\tH\x01R\ntoolCallId\x88\x01\x01\x42\x14\n\x12_reasoning_contentB\x0f\n\r_tool_call_id\"k\n\nToolChoice\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x11.xai_api.ToolModeH\x00R\x04mode\x12%\n\rfunction_name\x18\x02 \x01(\tH\x00R\x0c\x66unctionNameB\r\n\x0btool_choice\"\x9d\x03\n\x04Tool\x12/\n\x08\x66unction\x18\x01 \x01(\x0b\x32\x11.xai_api.FunctionH\x00R\x08\x66unction\x12\x33\n\nweb_search\x18\x03 \x01(\x0b\x32\x12.xai_api.WebSearchH\x00R\twebSearch\x12-\n\x08x_search\x18\x04 \x01(\x0b\x32\x10.xai_api.XSearchH\x00R\x07xSearch\x12?\n\x0e\x63ode_execution\x18\x05 \x01(\x0b\x32\x16.xai_api.CodeExecutionH\x00R\rcodeExecution\x12K\n\x12\x63ollections_search\x18\x06 \x01(\x0b\x32\x1a.xai_api.CollectionsSearchH\x00R\x11\x63ollectionsSearch\x12 \n\x03mcp\x18\x07 \x01(\x0b\x32\x0c.xai_api.MCPH\x00R\x03mcp\x12H\n\x11\x61ttachment_search\x18\x08 \x01(\x0b\x32\x19.xai_api.AttachmentSearchH\x00R\x10\x61ttachmentSearchB\x06\n\x04tool\"\xe7\x02\n\x03MCP\x12!\n\x0cserver_label\x18\x01 \x01(\tR\x0bserverLabel\x12-\n\x12server_description\x18\x02 \x01(\tR\x11serverDescription\x12\x1d\n\nserver_url\x18\x03 \x01(\tR\tserverUrl\x12,\n\x12\x61llowed_tool_names\x18\x04 \x03(\tR\x10\x61llowedToolNames\x12)\n\rauthorization\x18\x05 \x01(\tH\x00R\rauthorization\x88\x01\x01\x12\x43\n\rextra_headers\x18\x06 \x03(\x0b\x32\x1e.xai_api.MCP.ExtraHeadersEntryR\x0c\x65xtraHeaders\x1a?\n\x11\x45xtraHeadersEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value:\x02\x38\x01\x42\x10\n\x0e_authorization\"\x9d\x02\n\tWebSearch\x12)\n\x10\x65xcluded_domains\x18\x01 \x03(\tR\x0f\x65xcludedDomains\x12\'\n\x0f\x61llowed_domains\x18\x02 \x03(\tR\x0e\x61llowedDomains\x12\x41\n\x1a\x65nable_image_understanding\x18\x03 \x01(\x08H\x00R\x18\x65nableImageUnderstanding\x88\x01\x01\x12H\n\ruser_location\x18\x04 \x01(\x0b\x32\x1e.xai_api.WebSearchUserLocationH\x01R\x0cuserLocation\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_location\"\xba\x01\n\x15WebSearchUserLocation\x12\x1d\n\x07\x63ountry\x18\x01 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x17\n\x04\x63ity\x18\x02 \x01(\tH\x01R\x04\x63ity\x88\x01\x01\x12\x1b\n\x06region\x18\x03 \x01(\tH\x02R\x06region\x88\x01\x01\x12\x1f\n\x08timezone\x18\x04 \x01(\tH\x03R\x08timezone\x88\x01\x01\x42\n\n\x08_countryB\x07\n\x05_cityB\t\n\x07_regionB\x0b\n\t_timezone\"\xb9\x03\n\x07XSearch\x12<\n\tfrom_date\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00R\x08\x66romDate\x88\x01\x01\x12\x38\n\x07to_date\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x06toDate\x88\x01\x01\x12*\n\x11\x61llowed_x_handles\x18\x03 \x03(\tR\x0f\x61llowedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x04 \x03(\tR\x10\x65xcludedXHandles\x12\x41\n\x1a\x65nable_image_understanding\x18\x05 \x01(\x08H\x02R\x18\x65nableImageUnderstanding\x88\x01\x01\x12\x41\n\x1a\x65nable_video_understanding\x18\x06 \x01(\x08H\x03R\x18\x65nableVideoUnderstanding\x88\x01\x01\x42\x0c\n\n_from_dateB\n\n\x08_to_dateB\x1d\n\x1b_enable_image_understandingB\x1d\n\x1b_enable_video_understanding\"\x0f\n\rCodeExecution\"\x89\x03\n\x11\x43ollectionsSearch\x12%\n\x0e\x63ollection_ids\x18\x01 \x03(\tR\rcollectionIds\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x01R\x05limit\x88\x01\x01\x12\'\n\x0cinstructions\x18\x03 \x01(\tH\x02R\x0cinstructions\x88\x01\x01\x12\x45\n\x10hybrid_retrieval\x18\x04 \x01(\x0b\x32\x18.xai_api.HybridRetrievalH\x00R\x0fhybridRetrieval\x12K\n\x12semantic_retrieval\x18\x05 \x01(\x0b\x32\x1a.xai_api.SemanticRetrievalH\x00R\x11semanticRetrieval\x12H\n\x11keyword_retrieval\x18\x06 \x01(\x0b\x32\x19.xai_api.KeywordRetrievalH\x00R\x10keywordRetrievalB\x10\n\x0eretrieval_modeB\x08\n\x06_limitB\x0f\n\r_instructions\"7\n\x10\x41ttachmentSearch\x12\x19\n\x05limit\x18\x02 \x01(\x05H\x00R\x05limit\x88\x01\x01\x42\x08\n\x06_limit\"x\n\x08\x46unction\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12 \n\x0b\x64\x65scription\x18\x02 \x01(\tR\x0b\x64\x65scription\x12\x16\n\x06strict\x18\x03 \x01(\x08R\x06strict\x12\x1e\n\nparameters\x18\x04 \x01(\tR\nparameters\"\xef\x01\n\x08ToolCall\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12)\n\x04type\x18\x02 \x01(\x0e\x32\x15.xai_api.ToolCallTypeR\x04type\x12/\n\x06status\x18\x03 \x01(\x0e\x32\x17.xai_api.ToolCallStatusR\x06status\x12(\n\rerror_message\x18\x04 \x01(\tH\x01R\x0c\x65rrorMessage\x88\x01\x01\x12\x33\n\x08\x66unction\x18\n \x01(\x0b\x32\x15.xai_api.FunctionCallH\x00R\x08\x66unctionB\x06\n\x04toolB\x10\n\x0e_error_message\"@\n\x0c\x46unctionCall\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x1c\n\targuments\x18\x02 \x01(\tR\targuments\"n\n\x0eResponseFormat\x12\x34\n\x0b\x66ormat_type\x18\x01 \x01(\x0e\x32\x13.xai_api.FormatTypeR\nformatType\x12\x1b\n\x06schema\x18\x02 \x01(\tH\x00R\x06schema\x88\x01\x01\x42\t\n\x07_schema\"\xc9\x02\n\x10SearchParameters\x12\'\n\x04mode\x18\x01 \x01(\x0e\x32\x13.xai_api.SearchModeR\x04mode\x12)\n\x07sources\x18\t \x03(\x0b\x32\x0f.xai_api.SourceR\x07sources\x12\x37\n\tfrom_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x08\x66romDate\x12\x33\n\x07to_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x06toDate\x12)\n\x10return_citations\x18\x07 \x01(\x08R\x0freturnCitations\x12\x31\n\x12max_search_results\x18\x08 \x01(\x05H\x00R\x10maxSearchResults\x88\x01\x01\x42\x15\n\x13_max_search_results\"\xaf\x01\n\x06Source\x12&\n\x03web\x18\x01 \x01(\x0b\x32\x12.xai_api.WebSourceH\x00R\x03web\x12)\n\x04news\x18\x02 \x01(\x0b\x32\x13.xai_api.NewsSourceH\x00R\x04news\x12 \n\x01x\x18\x03 \x01(\x0b\x32\x10.xai_api.XSourceH\x00R\x01x\x12&\n\x03rss\x18\x04 \x01(\x0b\x32\x12.xai_api.RssSourceH\x00R\x03rssB\x08\n\x06source\"\xaf\x01\n\tWebSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12)\n\x10\x61llowed_websites\x18\x05 \x03(\tR\x0f\x61llowedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\x85\x01\n\nNewsSource\x12+\n\x11\x65xcluded_websites\x18\x02 \x03(\tR\x10\x65xcludedWebsites\x12\x1d\n\x07\x63ountry\x18\x03 \x01(\tH\x00R\x07\x63ountry\x88\x01\x01\x12\x1f\n\x0bsafe_search\x18\x04 \x01(\x08R\nsafeSearchB\n\n\x08_country\"\xf9\x01\n\x07XSource\x12,\n\x12included_x_handles\x18\x07 \x03(\tR\x10includedXHandles\x12,\n\x12\x65xcluded_x_handles\x18\x08 \x03(\tR\x10\x65xcludedXHandles\x12\x33\n\x13post_favorite_count\x18\t \x01(\x05H\x00R\x11postFavoriteCount\x88\x01\x01\x12+\n\x0fpost_view_count\x18\n \x01(\x05H\x01R\rpostViewCount\x88\x01\x01\x42\x16\n\x14_post_favorite_countB\x12\n\x10_post_view_countJ\x04\x08\x06\x10\x07\"!\n\tRssSource\x12\x14\n\x05links\x18\x01 \x03(\tR\x05links\"\x9f\x06\n\x0fRequestSettings\x12\"\n\nmax_tokens\x18\x01 \x01(\x05H\x00R\tmaxTokens\x88\x01\x01\x12.\n\x13parallel_tool_calls\x18\x02 \x01(\x08R\x11parallelToolCalls\x12\x35\n\x14previous_response_id\x18\x03 \x01(\tH\x01R\x12previousResponseId\x88\x01\x01\x12H\n\x10reasoning_effort\x18\x04 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x02R\x0freasoningEffort\x88\x01\x01\x12%\n\x0btemperature\x18\x05 \x01(\x02H\x03R\x0btemperature\x88\x01\x01\x12@\n\x0fresponse_format\x18\x06 \x01(\x0b\x32\x17.xai_api.ResponseFormatR\x0eresponseFormat\x12\x34\n\x0btool_choice\x18\x07 \x01(\x0b\x32\x13.xai_api.ToolChoiceR\ntoolChoice\x12#\n\x05tools\x18\x08 \x03(\x0b\x32\r.xai_api.ToolR\x05tools\x12\x18\n\x05top_p\x18\t \x01(\x02H\x04R\x04topP\x88\x01\x01\x12\x12\n\x04user\x18\n \x01(\tR\x04user\x12K\n\x11search_parameters\x18\x0b \x01(\x0b\x32\x19.xai_api.SearchParametersH\x05R\x10searchParameters\x88\x01\x01\x12%\n\x0estore_messages\x18\x0c \x01(\x08R\rstoreMessages\x12\x32\n\x15use_encrypted_content\x18\r \x01(\x08R\x13useEncryptedContent\x12\x30\n\x07include\x18\x0e \x03(\x0e\x32\x16.xai_api.IncludeOptionR\x07includeB\r\n\x0b_max_tokensB\x17\n\x15_previous_response_idB\x13\n\x11_reasoning_effortB\x0e\n\x0c_temperatureB\x08\n\x06_top_pB\x14\n\x12_search_parameters\"=\n\x1aGetStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"@\n\x1d\x44\x65leteStoredCompletionRequest\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"A\n\x1e\x44\x65leteStoredCompletionResponse\x12\x1f\n\x0bresponse_id\x18\x01 \x01(\tR\nresponseId\"\xba\x03\n\x0b\x44\x65\x62ugOutput\x12\x1a\n\x08\x61ttempts\x18\x01 \x01(\x05R\x08\x61ttempts\x12\x18\n\x07request\x18\x02 \x01(\tR\x07request\x12\x16\n\x06prompt\x18\x03 \x01(\tR\x06prompt\x12%\n\x0e\x65ngine_request\x18\t \x01(\tR\rengineRequest\x12\x1c\n\tresponses\x18\x04 \x03(\tR\tresponses\x12\x16\n\x06\x63hunks\x18\x0c \x03(\tR\x06\x63hunks\x12(\n\x10\x63\x61\x63he_read_count\x18\x05 \x01(\rR\x0e\x63\x61\x63heReadCount\x12\x33\n\x16\x63\x61\x63he_read_input_bytes\x18\x06 \x01(\x04R\x13\x63\x61\x63heReadInputBytes\x12*\n\x11\x63\x61\x63he_write_count\x18\x07 \x01(\rR\x0f\x63\x61\x63heWriteCount\x12\x35\n\x17\x63\x61\x63he_write_input_bytes\x18\x08 \x01(\x04R\x14\x63\x61\x63heWriteInputBytes\x12\x1d\n\nlb_address\x18\n \x01(\tR\tlbAddress\x12\x1f\n\x0bsampler_tag\x18\x0b \x01(\tR\nsamplerTag*\x82\x03\n\rIncludeOption\x12\x1a\n\x16INCLUDE_OPTION_INVALID\x10\x00\x12)\n%INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT\x10\x01\x12\'\n#INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT\x10\x02\x12-\n)INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT\x10\x03\x12\x31\n-INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT\x10\x04\x12\x30\n,INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT\x10\x05\x12\"\n\x1eINCLUDE_OPTION_MCP_CALL_OUTPUT\x10\x06\x12#\n\x1fINCLUDE_OPTION_INLINE_CITATIONS\x10\x07\x12$\n INCLUDE_OPTION_VERBOSE_STREAMING\x10\x08*\x8d\x01\n\x0bMessageRole\x12\x10\n\x0cINVALID_ROLE\x10\x00\x12\r\n\tROLE_USER\x10\x01\x12\x12\n\x0eROLE_ASSISTANT\x10\x02\x12\x0f\n\x0bROLE_SYSTEM\x10\x03\x12\x15\n\rROLE_FUNCTION\x10\x04\x1a\x02\x08\x01\x12\r\n\tROLE_TOOL\x10\x05\x12\x12\n\x0eROLE_DEVELOPER\x10\x06*Y\n\x0fReasoningEffort\x12\x12\n\x0eINVALID_EFFORT\x10\x00\x12\x0e\n\nEFFORT_LOW\x10\x01\x12\x11\n\rEFFORT_MEDIUM\x10\x02\x12\x0f\n\x0b\x45\x46\x46ORT_HIGH\x10\x03*a\n\x08ToolMode\x12\x15\n\x11TOOL_MODE_INVALID\x10\x00\x12\x12\n\x0eTOOL_MODE_AUTO\x10\x01\x12\x12\n\x0eTOOL_MODE_NONE\x10\x02\x12\x16\n\x12TOOL_MODE_REQUIRED\x10\x03*u\n\nFormatType\x12\x17\n\x13\x46ORMAT_TYPE_INVALID\x10\x00\x12\x14\n\x10\x46ORMAT_TYPE_TEXT\x10\x01\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_OBJECT\x10\x02\x12\x1b\n\x17\x46ORMAT_TYPE_JSON_SCHEMA\x10\x03*\xb1\x02\n\x0cToolCallType\x12\x1a\n\x16TOOL_CALL_TYPE_INVALID\x10\x00\x12#\n\x1fTOOL_CALL_TYPE_CLIENT_SIDE_TOOL\x10\x01\x12\"\n\x1eTOOL_CALL_TYPE_WEB_SEARCH_TOOL\x10\x02\x12 \n\x1cTOOL_CALL_TYPE_X_SEARCH_TOOL\x10\x03\x12&\n\"TOOL_CALL_TYPE_CODE_EXECUTION_TOOL\x10\x04\x12*\n&TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL\x10\x05\x12\x1b\n\x17TOOL_CALL_TYPE_MCP_TOOL\x10\x06\x12)\n%TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL\x10\x07*\x90\x01\n\x0eToolCallStatus\x12 \n\x1cTOOL_CALL_STATUS_IN_PROGRESS\x10\x00\x12\x1e\n\x1aTOOL_CALL_STATUS_COMPLETED\x10\x01\x12\x1f\n\x1bTOOL_CALL_STATUS_INCOMPLETE\x10\x02\x12\x1b\n\x17TOOL_CALL_STATUS_FAILED\x10\x03*d\n\nSearchMode\x12\x17\n\x13INVALID_SEARCH_MODE\x10\x00\x12\x13\n\x0fOFF_SEARCH_MODE\x10\x01\x12\x12\n\x0eON_SEARCH_MODE\x10\x02\x12\x14\n\x10\x41UTO_SEARCH_MODE\x10\x03\x32\xc4\x04\n\x04\x43hat\x12U\n\rGetCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12Y\n\x12GetCompletionChunk\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1f.xai_api.GetChatCompletionChunk\"\x00\x30\x01\x12[\n\x17StartDeferredCompletion\x12\x1e.xai_api.GetCompletionsRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12^\n\x15GetDeferredCompletion\x12\x1b.xai_api.GetDeferredRequest\x1a&.xai_api.GetDeferredCompletionResponse\"\x00\x12`\n\x13GetStoredCompletion\x12#.xai_api.GetStoredCompletionRequest\x1a\".xai_api.GetChatCompletionResponse\"\x00\x12k\n\x16\x44\x65leteStoredCompletion\x12&.xai_api.DeleteStoredCompletionRequest\x1a\'.xai_api.DeleteStoredCompletionResponse\"\x00\x42P\n\x0b\x63om.xai_apiB\tChatProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -44,20 +44,20 @@ _globals['_MCP_EXTRAHEADERSENTRY']._serialized_options = b'8\001' _globals['_INCLUDEOPTION']._serialized_start=10067 _globals['_INCLUDEOPTION']._serialized_end=10453 - _globals['_MESSAGEROLE']._serialized_start=10455 - _globals['_MESSAGEROLE']._serialized_end=10576 - _globals['_REASONINGEFFORT']._serialized_start=10578 - _globals['_REASONINGEFFORT']._serialized_end=10667 - _globals['_TOOLMODE']._serialized_start=10669 - _globals['_TOOLMODE']._serialized_end=10766 - _globals['_FORMATTYPE']._serialized_start=10768 - _globals['_FORMATTYPE']._serialized_end=10885 - _globals['_TOOLCALLTYPE']._serialized_start=10888 - _globals['_TOOLCALLTYPE']._serialized_end=11193 - _globals['_TOOLCALLSTATUS']._serialized_start=11196 - _globals['_TOOLCALLSTATUS']._serialized_end=11340 - _globals['_SEARCHMODE']._serialized_start=11342 - _globals['_SEARCHMODE']._serialized_end=11442 + _globals['_MESSAGEROLE']._serialized_start=10456 + _globals['_MESSAGEROLE']._serialized_end=10597 + _globals['_REASONINGEFFORT']._serialized_start=10599 + _globals['_REASONINGEFFORT']._serialized_end=10688 + _globals['_TOOLMODE']._serialized_start=10690 + _globals['_TOOLMODE']._serialized_end=10787 + _globals['_FORMATTYPE']._serialized_start=10789 + _globals['_FORMATTYPE']._serialized_end=10906 + _globals['_TOOLCALLTYPE']._serialized_start=10909 + _globals['_TOOLCALLTYPE']._serialized_end=11214 + _globals['_TOOLCALLSTATUS']._serialized_start=11217 + _globals['_TOOLCALLSTATUS']._serialized_end=11361 + _globals['_SEARCHMODE']._serialized_start=11363 + _globals['_SEARCHMODE']._serialized_end=11463 _globals['_GETCOMPLETIONSREQUEST']._serialized_start=196 _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1457 _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1460 @@ -144,6 +144,6 @@ _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=9619 _globals['_DEBUGOUTPUT']._serialized_start=9622 _globals['_DEBUGOUTPUT']._serialized_end=10064 - _globals['_CHAT']._serialized_start=11445 - _globals['_CHAT']._serialized_end=12025 + _globals['_CHAT']._serialized_start=11466 + _globals['_CHAT']._serialized_end=12046 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v6/chat_pb2.pyi b/src/xai_sdk/proto/v6/chat_pb2.pyi index 7045667..b99863e 100644 --- a/src/xai_sdk/proto/v6/chat_pb2.pyi +++ b/src/xai_sdk/proto/v6/chat_pb2.pyi @@ -33,6 +33,7 @@ class MessageRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): ROLE_SYSTEM: _ClassVar[MessageRole] ROLE_FUNCTION: _ClassVar[MessageRole] ROLE_TOOL: _ClassVar[MessageRole] + ROLE_DEVELOPER: _ClassVar[MessageRole] class ReasoningEffort(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -94,6 +95,7 @@ ROLE_ASSISTANT: MessageRole ROLE_SYSTEM: MessageRole ROLE_FUNCTION: MessageRole ROLE_TOOL: MessageRole +ROLE_DEVELOPER: MessageRole INVALID_EFFORT: ReasoningEffort EFFORT_LOW: ReasoningEffort EFFORT_MEDIUM: ReasoningEffort diff --git a/tests/chat_test.py b/tests/chat_test.py index b7da997..9270802 100644 --- a/tests/chat_test.py +++ b/tests/chat_test.py @@ -1,4 +1,4 @@ -from xai_sdk.chat import Response +from xai_sdk.chat import Response, developer from xai_sdk.proto import chat_pb2, sample_pb2 from xai_sdk.tools import get_tool_call_type @@ -641,3 +641,19 @@ def test_web_search_user_location(): # Verify user_location fields are set correctly assert tool.web_search.user_location.city == "San Francisco" assert tool.web_search.user_location.timezone == "America/Los_Angeles" + + +def test_developer_message(): + """Test that developer() creates a message with ROLE_DEVELOPER role.""" + # Simple string content + msg = developer("Test developer message") + assert msg.role == chat_pb2.MessageRole.ROLE_DEVELOPER + assert len(msg.content) == 1 + assert msg.content[0].text == "Test developer message" + + # Multiple content args (str and text object) + msg2 = developer("Part 1", "Part 2") + assert msg2.role == chat_pb2.MessageRole.ROLE_DEVELOPER + assert len(msg2.content) == 2 + assert msg2.content[0].text == "Part 1" + assert msg2.content[1].text == "Part 2"