diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a73a9d..4874e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## [Unreleased] ### Added +- Added a `quality` parameter (`"low"`, `"medium"`) to image generation (`client.image.sample`, `sample_batch`, and batch `prepare`), mapping to the `GenerateImageRequest.quality` field. When omitted, the default is `"medium"`. Only supported for `grok-imagine-image-2.0`. +- Added `grok-imagine-image-2.0` to the `ImageGenerationModel` known-model type literal - **`xhigh` Reasoning Effort**: Added `"xhigh"` as an accepted `reasoning_effort` value (maps to `EFFORT_XHIGH`; supported by models such as `grok-4.6`) - Added `grok-4.6` to the `ChatModel` known-model type literal - **Imagine File Storage**: Image and video generation (sync and async) now accept a `storage_options` parameter to persist generated assets to the Files API. It takes a dict with a required `filename` and optional `expires_after` (an `int` in seconds or a `datetime.timedelta`) and `public_url` (`True` to create a public URL with default expiry, or `{"expires_after": }` for an independent URL expiry). Image and video responses expose new `file_output`, `storage_error`, `public_url`, and `public_url_error` properties. diff --git a/src/xai_sdk/aio/image.py b/src/xai_sdk/aio/image.py index 6beb03a..b5dd4ed 100644 --- a/src/xai_sdk/aio/image.py +++ b/src/xai_sdk/aio/image.py @@ -10,6 +10,7 @@ BaseImageResponse, ImageAspectRatio, ImageFormat, + ImageQuality, ImageResolution, _make_generate_request, _make_span_request_attributes, @@ -39,6 +40,7 @@ def prepare( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + quality: Optional[ImageQuality] = None, storage_options: Optional[Union[StorageOptions, image_pb2.StorageOptions]] = None, ) -> batch_pb2.BatchRequest: """Prepares an image generation request for batch processing. @@ -73,6 +75,10 @@ def prepare( image_format: The format of the image to return ("url" or "base64"). Defaults to "url". aspect_ratio: The aspect ratio of the image to generate. resolution: The image resolution to generate ("1k" or "2k"). + quality: Control generation quality with the optional quality + parameter. Allowed values are ``"low"`` and ``"medium"``. When + omitted, the default is ``"medium"``. The parameter is only + supported for ``grok-imagine-image-2.0``. storage_options: Persist the result to the Files API. Accepts a dict with a required ``filename`` and optional ``expires_after`` and ``public_url`` keys. Set ``public_url`` to also create a publicly shareable URL. @@ -124,6 +130,7 @@ def prepare( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + quality=quality, storage_options=storage_options, ) return batch_pb2.BatchRequest( @@ -144,6 +151,7 @@ async def sample( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + quality: Optional[ImageQuality] = None, storage_options: Optional[Union[StorageOptions, image_pb2.StorageOptions]] = None, ) -> "ImageResponse": """Samples a single image asynchronously based on the provided prompt. @@ -193,6 +201,10 @@ async def sample( - `"1k"`: ~1 megapixel total. Dimensions vary by aspect ratio. - `"2k"`: ~4 megapixels total. Dimensions vary by aspect ratio. Only supported for grok-imagine models. + quality: Control generation quality with the optional quality + parameter. Allowed values are ``"low"`` and ``"medium"``. When + omitted, the default is ``"medium"``. The parameter is only + supported for ``grok-imagine-image-2.0``. storage_options: Persist the result to the Files API. Accepts a dict with a required ``filename`` and optional ``expires_after`` and ``public_url`` keys. Set ``public_url`` to also create a publicly shareable URL. @@ -217,6 +229,7 @@ async def sample( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + quality=quality, storage_options=storage_options, ) with tracer.start_as_current_span( @@ -243,6 +256,7 @@ async def sample_batch( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + quality: Optional[ImageQuality] = None, storage_options: Optional[Union[StorageOptions, image_pb2.StorageOptions]] = None, ) -> Sequence["ImageResponse"]: """Samples a batch of images asynchronously based on the provided prompt. @@ -293,6 +307,10 @@ async def sample_batch( - `"1k"`: ~1 megapixel total. Dimensions vary by aspect ratio. - `"2k"`: ~4 megapixels total. Dimensions vary by aspect ratio. Only supported for grok-imagine models. + quality: Control generation quality with the optional quality + parameter. Allowed values are ``"low"`` and ``"medium"``. When + omitted, the default is ``"medium"``. The parameter is only + supported for ``grok-imagine-image-2.0``. storage_options: Persist the results to the Files API. Accepts a dict with a required ``filename`` and optional ``expires_after`` and ``public_url`` keys. Set ``public_url`` to also create a publicly shareable URL. @@ -318,6 +336,7 @@ async def sample_batch( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + quality=quality, storage_options=storage_options, ) with tracer.start_as_current_span( diff --git a/src/xai_sdk/image.py b/src/xai_sdk/image.py index 54ab127..62464eb 100644 --- a/src/xai_sdk/image.py +++ b/src/xai_sdk/image.py @@ -9,7 +9,7 @@ from .meta import ProtoDecorator from .proto import image_pb2, image_pb2_grpc, usage_pb2 from .telemetry import should_disable_sensitive_attributes -from .types import ImageAspectRatio, ImageFormat, ImageGenerationModel, ImageResolution +from .types import ImageAspectRatio, ImageFormat, ImageGenerationModel, ImageQuality, ImageResolution _IMAGE_ASPECT_RATIO_MAP: dict[ImageAspectRatio, image_pb2.ImageAspectRatio] = { "1:1": image_pb2.ImageAspectRatio.IMG_ASPECT_RATIO_1_1, @@ -183,6 +183,7 @@ def _make_generate_request( image_format: ImageFormat | None = None, aspect_ratio: ImageAspectRatio | None = None, resolution: ImageResolution | None = None, + quality: ImageQuality | None = None, storage_options: Union[StorageOptions, image_pb2.StorageOptions, None] = None, ) -> image_pb2.GenerateImageRequest: _validate_image_inputs(image_url, image_file_id, image_urls, image_file_ids) @@ -237,11 +238,24 @@ def _make_generate_request( request.aspect_ratio = convert_image_aspect_ratio_to_pb(aspect_ratio) if resolution is not None: request.resolution = convert_image_resolution_to_pb(resolution) + if quality is not None: + request.quality = convert_image_quality_to_pb(quality) if storage_options is not None: request.storage_options.CopyFrom(_resolve_storage_options_pb(storage_options)) return request +def _add_storage_span_attributes(attributes: dict[str, str | int], storage_options: image_pb2.StorageOptions) -> None: + """Adds storage-related span attributes for a request that persists its output.""" + attributes["gen_ai.request.storage"] = True + if storage_options.filename: + attributes["gen_ai.request.storage.filename"] = storage_options.filename + if storage_options.expires_after: + attributes["gen_ai.request.storage.expires_after"] = storage_options.expires_after + if storage_options.HasField("public_url"): + attributes["gen_ai.request.storage.public_url"] = True + + def _make_span_request_attributes(request: image_pb2.GenerateImageRequest) -> dict[str, str | int]: """Creates the image sampling span request attributes.""" attributes: dict[str, str | int] = { @@ -260,13 +274,7 @@ def _make_span_request_attributes(request: image_pb2.GenerateImageRequest) -> di attributes["gen_ai.prompt"] = request.prompt if request.HasField("storage_options"): - attributes["gen_ai.request.storage"] = True - if request.storage_options.filename: - attributes["gen_ai.request.storage.filename"] = request.storage_options.filename - if request.storage_options.expires_after: - attributes["gen_ai.request.storage.expires_after"] = request.storage_options.expires_after - if request.storage_options.HasField("public_url"): - attributes["gen_ai.request.storage.public_url"] = True + _add_storage_span_attributes(attributes, request.storage_options) if request.HasField("n"): attributes["gen_ai.request.image.count"] = request.n @@ -276,6 +284,10 @@ def _make_span_request_attributes(request: image_pb2.GenerateImageRequest) -> di attributes["gen_ai.request.image.resolution"] = ( image_pb2.ImageResolution.Name(request.resolution).removeprefix("IMG_RESOLUTION_").lower() ) + if request.HasField("quality"): + attributes["gen_ai.request.image.quality"] = ( + image_pb2.ImageQuality.Name(request.quality).removeprefix("IMG_QUALITY_").lower() + ) if request.user: attributes["user_id"] = request.user @@ -375,3 +387,14 @@ def convert_image_resolution_to_pb(resolution: ImageResolution) -> image_pb2.Ima return image_pb2.ImageResolution.IMG_RESOLUTION_2K case _: raise ValueError(f"Invalid image resolution {resolution}.") + + +def convert_image_quality_to_pb(quality: ImageQuality) -> image_pb2.ImageQuality: + """Converts a string literal representation of an image quality to its protobuf enum variant.""" + match quality: + case "low": + return image_pb2.ImageQuality.IMG_QUALITY_LOW + case "medium": + return image_pb2.ImageQuality.IMG_QUALITY_MEDIUM + case _: + raise ValueError(f"Invalid image quality {quality}.") diff --git a/src/xai_sdk/proto/v5/chat_pb2.py b/src/xai_sdk/proto/v5/chat_pb2.py index 395ab6c..17c0192 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\"\xf1\n\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\x07include\x12\x39\n\x0b\x61gent_count\x18\x1d \x01(\x0e\x32\x13.xai_api.AgentCountH\rR\nagentCount\x88\x01\x01\x12\x37\n\x0cservice_tier\x18\x1f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTierB\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_turnsB\x0e\n\x0c_agent_countJ\x04\x08\x04\x10\x05\"\x87\x04\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\x12\x36\n\x0coutput_files\x18\r \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"\xd3\x03\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\x12\x36\n\x0coutput_files\x18\x0b \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0c \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"9\n\nOutputFile\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\"\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\"\x85\x01\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x1a\n\x08\x66ilename\x18\x03 \x01(\tR\x08\x66ilename\x12\x1b\n\tmime_type\x18\x04 \x01(\tR\x08mimeType\x12\x10\n\x03url\x18\x05 \x01(\tR\x03url\"\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\"\xea\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\x12\x33\n\x13\x65nable_image_search\x18\x05 \x01(\x08H\x02R\x11\x65nableImageSearch\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_locationB\x16\n\x14_enable_image_search\"\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\"U\n\x15\x43ompactContextRequest\x12\x14\n\x05model\x18\x01 \x01(\tR\x05model\x12&\n\x05input\x18\x02 \x03(\x0b\x32\x10.xai_api.MessageR\x05input\"\xb7\x01\n\x16\x43ompactContextResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12+\n\x11\x65ncrypted_content\x18\x02 \x01(\tR\x10\x65ncryptedContent\x12\x32\n\x15\x64ropped_message_count\x18\x03 \x01(\rR\x13\x64roppedMessageCount\x12,\n\x05usage\x18\x04 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage*\xb2\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\x12.\n*INCLUDE_OPTION_CODE_EXECUTION_FILES_OUTPUT\x10\t*\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*|\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\x12\x0f\n\x0b\x45\x46\x46ORT_NONE\x10\x04\x12\x10\n\x0c\x45\x46\x46ORT_XHIGH\x10\x05*P\n\nAgentCount\x12\x1b\n\x17\x41GENT_COUNT_UNSPECIFIED\x10\x00\x12\x11\n\rAGENT_COUNT_4\x10\x01\x12\x12\n\x0e\x41GENT_COUNT_16\x10\x02*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\x99\x05\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\x12S\n\x0e\x43ompactContext\x12\x1e.xai_api.CompactContextRequest\x1a\x1f.xai_api.CompactContextResponse\"\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\"\xf1\n\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\x07include\x12\x39\n\x0b\x61gent_count\x18\x1d \x01(\x0e\x32\x13.xai_api.AgentCountH\rR\nagentCount\x88\x01\x01\x12\x37\n\x0cservice_tier\x18\x1f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTierB\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_turnsB\x0e\n\x0c_agent_countJ\x04\x08\x04\x10\x05\"\x87\x04\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\x12\x36\n\x0coutput_files\x18\r \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"\xd3\x03\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\x12\x36\n\x0coutput_files\x18\x0b \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0c \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"9\n\nOutputFile\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\"\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\"\x85\x01\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x1a\n\x08\x66ilename\x18\x03 \x01(\tR\x08\x66ilename\x12\x1b\n\tmime_type\x18\x04 \x01(\tR\x08mimeType\x12\x10\n\x03url\x18\x05 \x01(\tR\x03url\"\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\"\xe4\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\x61ttachmentSearch\x12\x45\n\x10image_generation\x18\n \x01(\x0b\x32\x18.xai_api.ImageGenerationH\x00R\x0fimageGenerationB\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\"\xea\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\x12\x33\n\x13\x65nable_image_search\x18\x05 \x01(\x08H\x02R\x11\x65nableImageSearch\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_locationB\x16\n\x14_enable_image_search\"\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\"9\n\x0fImageGeneration\x12\x1b\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00R\x06\x61\x63tion\x88\x01\x01\x42\t\n\x07_action\"\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\"U\n\x15\x43ompactContextRequest\x12\x14\n\x05model\x18\x01 \x01(\tR\x05model\x12&\n\x05input\x18\x02 \x03(\x0b\x32\x10.xai_api.MessageR\x05input\"\xb7\x01\n\x16\x43ompactContextResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12+\n\x11\x65ncrypted_content\x18\x02 \x01(\tR\x10\x65ncryptedContent\x12\x32\n\x15\x64ropped_message_count\x18\x03 \x01(\rR\x13\x64roppedMessageCount\x12,\n\x05usage\x18\x04 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage*\xb2\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\x12.\n*INCLUDE_OPTION_CODE_EXECUTION_FILES_OUTPUT\x10\t*\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*|\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\x12\x0f\n\x0b\x45\x46\x46ORT_NONE\x10\x04\x12\x10\n\x0c\x45\x46\x46ORT_XHIGH\x10\x05*P\n\nAgentCount\x12\x1b\n\x17\x41GENT_COUNT_UNSPECIFIED\x10\x00\x12\x11\n\rAGENT_COUNT_4\x10\x01\x12\x12\n\x0e\x41GENT_COUNT_16\x10\x02*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*\xdb\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\x12(\n$TOOL_CALL_TYPE_IMAGE_GENERATION_TOOL\x10\n*\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\x99\x05\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\x12S\n\x0e\x43ompactContext\x12\x1e.xai_api.CompactContextRequest\x1a\x1f.xai_api.CompactContextResponse\"\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) @@ -42,24 +42,24 @@ _globals['_MESSAGEROLE'].values_by_name["ROLE_FUNCTION"]._serialized_options = b'\010\001' _globals['_MCP_EXTRAHEADERSENTRY']._loaded_options = None _globals['_MCP_EXTRAHEADERSENTRY']._serialized_options = b'8\001' - _globals['_INCLUDEOPTION']._serialized_start=10930 - _globals['_INCLUDEOPTION']._serialized_end=11364 - _globals['_MESSAGEROLE']._serialized_start=11367 - _globals['_MESSAGEROLE']._serialized_end=11508 - _globals['_REASONINGEFFORT']._serialized_start=11510 - _globals['_REASONINGEFFORT']._serialized_end=11634 - _globals['_AGENTCOUNT']._serialized_start=11636 - _globals['_AGENTCOUNT']._serialized_end=11716 - _globals['_TOOLMODE']._serialized_start=11718 - _globals['_TOOLMODE']._serialized_end=11815 - _globals['_FORMATTYPE']._serialized_start=11817 - _globals['_FORMATTYPE']._serialized_end=11934 - _globals['_TOOLCALLTYPE']._serialized_start=11937 - _globals['_TOOLCALLTYPE']._serialized_end=12242 - _globals['_TOOLCALLSTATUS']._serialized_start=12245 - _globals['_TOOLCALLSTATUS']._serialized_end=12389 - _globals['_SEARCHMODE']._serialized_start=12391 - _globals['_SEARCHMODE']._serialized_end=12491 + _globals['_INCLUDEOPTION']._serialized_start=11060 + _globals['_INCLUDEOPTION']._serialized_end=11494 + _globals['_MESSAGEROLE']._serialized_start=11497 + _globals['_MESSAGEROLE']._serialized_end=11638 + _globals['_REASONINGEFFORT']._serialized_start=11640 + _globals['_REASONINGEFFORT']._serialized_end=11764 + _globals['_AGENTCOUNT']._serialized_start=11766 + _globals['_AGENTCOUNT']._serialized_end=11846 + _globals['_TOOLMODE']._serialized_start=11848 + _globals['_TOOLMODE']._serialized_end=11945 + _globals['_FORMATTYPE']._serialized_start=11947 + _globals['_FORMATTYPE']._serialized_end=12064 + _globals['_TOOLCALLTYPE']._serialized_start=12067 + _globals['_TOOLCALLTYPE']._serialized_end=12414 + _globals['_TOOLCALLSTATUS']._serialized_start=12417 + _globals['_TOOLCALLSTATUS']._serialized_end=12561 + _globals['_SEARCHMODE']._serialized_start=12563 + _globals['_SEARCHMODE']._serialized_end=12663 _globals['_GETCOMPLETIONSREQUEST']._serialized_start=196 _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1589 _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1592 @@ -101,57 +101,59 @@ _globals['_TOOLCHOICE']._serialized_start=5205 _globals['_TOOLCHOICE']._serialized_end=5312 _globals['_TOOL']._serialized_start=5315 - _globals['_TOOL']._serialized_end=5728 - _globals['_MCP']._serialized_start=5731 - _globals['_MCP']._serialized_end=6090 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_start=6009 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_end=6072 - _globals['_WEBSEARCH']._serialized_start=6093 - _globals['_WEBSEARCH']._serialized_end=6455 - _globals['_WEBSEARCHUSERLOCATION']._serialized_start=6458 - _globals['_WEBSEARCHUSERLOCATION']._serialized_end=6644 - _globals['_XSEARCH']._serialized_start=6647 - _globals['_XSEARCH']._serialized_end=7088 - _globals['_CODEEXECUTION']._serialized_start=7090 - _globals['_CODEEXECUTION']._serialized_end=7105 - _globals['_COLLECTIONSSEARCH']._serialized_start=7108 - _globals['_COLLECTIONSSEARCH']._serialized_end=7501 - _globals['_ATTACHMENTSEARCH']._serialized_start=7503 - _globals['_ATTACHMENTSEARCH']._serialized_end=7558 - _globals['_FUNCTION']._serialized_start=7560 - _globals['_FUNCTION']._serialized_end=7680 - _globals['_TOOLCALL']._serialized_start=7683 - _globals['_TOOLCALL']._serialized_end=7922 - _globals['_FUNCTIONCALL']._serialized_start=7924 - _globals['_FUNCTIONCALL']._serialized_end=7988 - _globals['_RESPONSEFORMAT']._serialized_start=7990 - _globals['_RESPONSEFORMAT']._serialized_end=8100 - _globals['_SEARCHPARAMETERS']._serialized_start=8103 - _globals['_SEARCHPARAMETERS']._serialized_end=8432 - _globals['_SOURCE']._serialized_start=8435 - _globals['_SOURCE']._serialized_end=8610 - _globals['_WEBSOURCE']._serialized_start=8613 - _globals['_WEBSOURCE']._serialized_end=8788 - _globals['_NEWSSOURCE']._serialized_start=8791 - _globals['_NEWSSOURCE']._serialized_end=8924 - _globals['_XSOURCE']._serialized_start=8927 - _globals['_XSOURCE']._serialized_end=9176 - _globals['_RSSSOURCE']._serialized_start=9178 - _globals['_RSSSOURCE']._serialized_end=9211 - _globals['_REQUESTSETTINGS']._serialized_start=9214 - _globals['_REQUESTSETTINGS']._serialized_end=10013 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=10015 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=10076 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=10078 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=10142 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=10144 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=10209 - _globals['_DEBUGOUTPUT']._serialized_start=10212 - _globals['_DEBUGOUTPUT']._serialized_end=10654 - _globals['_COMPACTCONTEXTREQUEST']._serialized_start=10656 - _globals['_COMPACTCONTEXTREQUEST']._serialized_end=10741 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=10744 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=10927 - _globals['_CHAT']._serialized_start=12494 - _globals['_CHAT']._serialized_end=13159 + _globals['_TOOL']._serialized_end=5799 + _globals['_MCP']._serialized_start=5802 + _globals['_MCP']._serialized_end=6161 + _globals['_MCP_EXTRAHEADERSENTRY']._serialized_start=6080 + _globals['_MCP_EXTRAHEADERSENTRY']._serialized_end=6143 + _globals['_WEBSEARCH']._serialized_start=6164 + _globals['_WEBSEARCH']._serialized_end=6526 + _globals['_WEBSEARCHUSERLOCATION']._serialized_start=6529 + _globals['_WEBSEARCHUSERLOCATION']._serialized_end=6715 + _globals['_XSEARCH']._serialized_start=6718 + _globals['_XSEARCH']._serialized_end=7159 + _globals['_CODEEXECUTION']._serialized_start=7161 + _globals['_CODEEXECUTION']._serialized_end=7176 + _globals['_IMAGEGENERATION']._serialized_start=7178 + _globals['_IMAGEGENERATION']._serialized_end=7235 + _globals['_COLLECTIONSSEARCH']._serialized_start=7238 + _globals['_COLLECTIONSSEARCH']._serialized_end=7631 + _globals['_ATTACHMENTSEARCH']._serialized_start=7633 + _globals['_ATTACHMENTSEARCH']._serialized_end=7688 + _globals['_FUNCTION']._serialized_start=7690 + _globals['_FUNCTION']._serialized_end=7810 + _globals['_TOOLCALL']._serialized_start=7813 + _globals['_TOOLCALL']._serialized_end=8052 + _globals['_FUNCTIONCALL']._serialized_start=8054 + _globals['_FUNCTIONCALL']._serialized_end=8118 + _globals['_RESPONSEFORMAT']._serialized_start=8120 + _globals['_RESPONSEFORMAT']._serialized_end=8230 + _globals['_SEARCHPARAMETERS']._serialized_start=8233 + _globals['_SEARCHPARAMETERS']._serialized_end=8562 + _globals['_SOURCE']._serialized_start=8565 + _globals['_SOURCE']._serialized_end=8740 + _globals['_WEBSOURCE']._serialized_start=8743 + _globals['_WEBSOURCE']._serialized_end=8918 + _globals['_NEWSSOURCE']._serialized_start=8921 + _globals['_NEWSSOURCE']._serialized_end=9054 + _globals['_XSOURCE']._serialized_start=9057 + _globals['_XSOURCE']._serialized_end=9306 + _globals['_RSSSOURCE']._serialized_start=9308 + _globals['_RSSSOURCE']._serialized_end=9341 + _globals['_REQUESTSETTINGS']._serialized_start=9344 + _globals['_REQUESTSETTINGS']._serialized_end=10143 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=10145 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=10206 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=10208 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=10272 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=10274 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=10339 + _globals['_DEBUGOUTPUT']._serialized_start=10342 + _globals['_DEBUGOUTPUT']._serialized_end=10784 + _globals['_COMPACTCONTEXTREQUEST']._serialized_start=10786 + _globals['_COMPACTCONTEXTREQUEST']._serialized_end=10871 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=10874 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=11057 + _globals['_CHAT']._serialized_start=12666 + _globals['_CHAT']._serialized_end=13331 # @@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 a627b16..0688111 100644 --- a/src/xai_sdk/proto/v5/chat_pb2.pyi +++ b/src/xai_sdk/proto/v5/chat_pb2.pyi @@ -74,6 +74,7 @@ class ToolCallType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: _ClassVar[ToolCallType] TOOL_CALL_TYPE_MCP_TOOL: _ClassVar[ToolCallType] TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: _ClassVar[ToolCallType] + TOOL_CALL_TYPE_IMAGE_GENERATION_TOOL: _ClassVar[ToolCallType] class ToolCallStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -130,6 +131,7 @@ TOOL_CALL_TYPE_CODE_EXECUTION_TOOL: ToolCallType TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: ToolCallType TOOL_CALL_TYPE_MCP_TOOL: ToolCallType TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: ToolCallType +TOOL_CALL_TYPE_IMAGE_GENERATION_TOOL: ToolCallType TOOL_CALL_STATUS_IN_PROGRESS: ToolCallStatus TOOL_CALL_STATUS_COMPLETED: ToolCallStatus TOOL_CALL_STATUS_INCOMPLETE: ToolCallStatus @@ -438,7 +440,7 @@ class ToolChoice(_message.Message): def __init__(self, mode: _Optional[_Union[ToolMode, str]] = ..., function_name: _Optional[str] = ...) -> None: ... class Tool(_message.Message): - __slots__ = ("function", "web_search", "x_search", "code_execution", "collections_search", "mcp", "attachment_search") + __slots__ = ("function", "web_search", "x_search", "code_execution", "collections_search", "mcp", "attachment_search", "image_generation") FUNCTION_FIELD_NUMBER: _ClassVar[int] WEB_SEARCH_FIELD_NUMBER: _ClassVar[int] X_SEARCH_FIELD_NUMBER: _ClassVar[int] @@ -446,6 +448,7 @@ class Tool(_message.Message): COLLECTIONS_SEARCH_FIELD_NUMBER: _ClassVar[int] MCP_FIELD_NUMBER: _ClassVar[int] ATTACHMENT_SEARCH_FIELD_NUMBER: _ClassVar[int] + IMAGE_GENERATION_FIELD_NUMBER: _ClassVar[int] function: Function web_search: WebSearch x_search: XSearch @@ -453,7 +456,8 @@ class Tool(_message.Message): collections_search: CollectionsSearch mcp: MCP attachment_search: AttachmentSearch - def __init__(self, function: _Optional[_Union[Function, _Mapping]] = ..., web_search: _Optional[_Union[WebSearch, _Mapping]] = ..., x_search: _Optional[_Union[XSearch, _Mapping]] = ..., code_execution: _Optional[_Union[CodeExecution, _Mapping]] = ..., collections_search: _Optional[_Union[CollectionsSearch, _Mapping]] = ..., mcp: _Optional[_Union[MCP, _Mapping]] = ..., attachment_search: _Optional[_Union[AttachmentSearch, _Mapping]] = ...) -> None: ... + image_generation: ImageGeneration + def __init__(self, function: _Optional[_Union[Function, _Mapping]] = ..., web_search: _Optional[_Union[WebSearch, _Mapping]] = ..., x_search: _Optional[_Union[XSearch, _Mapping]] = ..., code_execution: _Optional[_Union[CodeExecution, _Mapping]] = ..., collections_search: _Optional[_Union[CollectionsSearch, _Mapping]] = ..., mcp: _Optional[_Union[MCP, _Mapping]] = ..., attachment_search: _Optional[_Union[AttachmentSearch, _Mapping]] = ..., image_generation: _Optional[_Union[ImageGeneration, _Mapping]] = ...) -> None: ... class MCP(_message.Message): __slots__ = ("server_label", "server_description", "server_url", "allowed_tool_names", "authorization", "extra_headers") @@ -524,6 +528,12 @@ class CodeExecution(_message.Message): __slots__ = () def __init__(self) -> None: ... +class ImageGeneration(_message.Message): + __slots__ = ("action",) + ACTION_FIELD_NUMBER: _ClassVar[int] + action: str + def __init__(self, action: _Optional[str] = ...) -> None: ... + class CollectionsSearch(_message.Message): __slots__ = ("collection_ids", "limit", "instructions", "hybrid_retrieval", "semantic_retrieval", "keyword_retrieval") COLLECTION_IDS_FIELD_NUMBER: _ClassVar[int] diff --git a/src/xai_sdk/proto/v5/chat_pb2_grpc.py b/src/xai_sdk/proto/v5/chat_pb2_grpc.py index 2aa8e2d..c43beaf 100644 --- a/src/xai_sdk/proto/v5/chat_pb2_grpc.py +++ b/src/xai_sdk/proto/v5/chat_pb2_grpc.py @@ -104,10 +104,10 @@ def DeleteStoredCompletion(self, request, context): raise NotImplementedError('Method not implemented!') def CompactContext(self, request, context): - """Compacts a full responses input context and returns a compacted context. + """Compacts a full input context and returns a compacted context. The client sends the current input items and receives back a compacted - set of items (with an opaque compaction summary) suitable for use as - the input to the next /v1/responses call. + set of items (with an opaque compaction blob) suitable for use as + the input to the next request. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') diff --git a/src/xai_sdk/proto/v5/image_pb2.py b/src/xai_sdk/proto/v5/image_pb2.py index 1a7c646..f1495de 100644 --- a/src/xai_sdk/proto/v5/image_pb2.py +++ b/src/xai_sdk/proto/v5/image_pb2.py @@ -26,7 +26,7 @@ from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/image.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16xai/api/v1/usage.proto\"\x84\x04\n\x14GenerateImageRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x05 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x11\n\x01n\x18\x03 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\x12\n\x04user\x18\x04 \x01(\tR\x04user\x12,\n\x06\x66ormat\x18\x0b \x01(\x0e\x32\x14.xai_api.ImageFormatR\x06\x66ormat\x12\x41\n\x0c\x61spect_ratio\x18\x0e \x01(\x0e\x32\x19.xai_api.ImageAspectRatioH\x01R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x0f \x01(\x0e\x32\x18.xai_api.ImageResolutionH\x02R\nresolution\x88\x01\x01\x12\x30\n\x06images\x18\x11 \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x06images\x12\x45\n\x0fstorage_options\x18\x13 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x03R\x0estorageOptions\x88\x01\x01\x42\x04\n\x02_nB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_optionsJ\x04\x08\r\x10\x0e\"\xb6\x01\n\x0eStorageOptions\x12\x1a\n\x08\x66ilename\x18\x01 \x01(\tR\x08\x66ilename\x12(\n\rexpires_after\x18\x02 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x12=\n\npublic_url\x18\x03 \x01(\x0b\x32\x19.xai_api.PublicUrlOptionsH\x01R\tpublicUrl\x88\x01\x01\x42\x10\n\x0e_expires_afterB\r\n\x0b_public_url\"N\n\x10PublicUrlOptions\x12(\n\rexpires_after\x18\x01 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x42\x10\n\x0e_expires_after\"\xfb\x02\n\nFileOutput\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x1a\n\x08\x66ilename\x18\x02 \x01(\tR\x08\x66ilename\x12\"\n\npublic_url\x18\x04 \x01(\tH\x00R\tpublicUrl\x88\x01\x01\x12R\n\x15public_url_expires_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x12publicUrlExpiresAt\x88\x01\x01\x12>\n\nexpires_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\texpiresAt\x88\x01\x01\x12-\n\x10public_url_error\x18\x07 \x01(\tH\x03R\x0epublicUrlError\x88\x01\x01\x42\r\n\x0b_public_urlB\x18\n\x16_public_url_expires_atB\r\n\x0b_expires_atB\x13\n\x11_public_url_errorJ\x04\x08\x03\x10\x04\"\x84\x01\n\rImageResponse\x12/\n\x06images\x18\x01 \x03(\x0b\x32\x17.xai_api.GeneratedImageR\x06images\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\"\x83\x02\n\x0eGeneratedImage\x12\x18\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00R\x06\x62\x61se64\x12\x12\n\x03url\x18\x03 \x01(\tH\x00R\x03url\x12-\n\x12respect_moderation\x18\x04 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x08 \x01(\x0b\x32\x13.xai_api.FileOutputH\x01R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\t \x01(\tH\x02R\x0cstorageError\x88\x01\x01\x42\x07\n\x05imageB\x0e\n\x0c_file_outputB\x10\n\x0e_storage_errorJ\x04\x08\x02\x10\x03\"\x83\x01\n\x0fImageUrlContent\x12\x1d\n\timage_url\x18\x01 \x01(\tH\x00R\x08imageUrl\x12\x19\n\x07\x66ile_id\x18\x03 \x01(\tH\x00R\x06\x66ileId\x12,\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailR\x06\x64\x65tailB\x08\n\x06source*S\n\x0bImageDetail\x12\x12\n\x0e\x44\x45TAIL_INVALID\x10\x00\x12\x0f\n\x0b\x44\x45TAIL_AUTO\x10\x01\x12\x0e\n\nDETAIL_LOW\x10\x02\x12\x0f\n\x0b\x44\x45TAIL_HIGH\x10\x03*P\n\x0bImageFormat\x12\x16\n\x12IMG_FORMAT_INVALID\x10\x00\x12\x15\n\x11IMG_FORMAT_BASE64\x10\x01\x12\x12\n\x0eIMG_FORMAT_URL\x10\x02*j\n\x0cImageQuality\x12\x17\n\x13IMG_QUALITY_INVALID\x10\x00\x12\x13\n\x0fIMG_QUALITY_LOW\x10\x01\x12\x16\n\x12IMG_QUALITY_MEDIUM\x10\x02\x12\x14\n\x10IMG_QUALITY_HIGH\x10\x03*\xa7\x03\n\x10ImageAspectRatio\x12\x1c\n\x18IMG_ASPECT_RATIO_INVALID\x10\x00\x12\x18\n\x14IMG_ASPECT_RATIO_1_1\x10\x01\x12\x18\n\x14IMG_ASPECT_RATIO_3_4\x10\x02\x12\x18\n\x14IMG_ASPECT_RATIO_4_3\x10\x03\x12\x19\n\x15IMG_ASPECT_RATIO_9_16\x10\x04\x12\x19\n\x15IMG_ASPECT_RATIO_16_9\x10\x05\x12\x18\n\x14IMG_ASPECT_RATIO_2_3\x10\x06\x12\x18\n\x14IMG_ASPECT_RATIO_3_2\x10\x07\x12\x19\n\x15IMG_ASPECT_RATIO_AUTO\x10\x08\x12\x1b\n\x17IMG_ASPECT_RATIO_9_19_5\x10\t\x12\x1b\n\x17IMG_ASPECT_RATIO_19_5_9\x10\n\x12\x19\n\x15IMG_ASPECT_RATIO_9_20\x10\x0b\x12\x19\n\x15IMG_ASPECT_RATIO_20_9\x10\x0c\x12\x18\n\x14IMG_ASPECT_RATIO_1_2\x10\r\x12\x18\n\x14IMG_ASPECT_RATIO_2_1\x10\x0e*[\n\x0fImageResolution\x12\x1a\n\x16IMG_RESOLUTION_INVALID\x10\x00\x12\x15\n\x11IMG_RESOLUTION_1K\x10\x01\x12\x15\n\x11IMG_RESOLUTION_2K\x10\x02\x32Q\n\x05Image\x12H\n\rGenerateImage\x12\x1d.xai_api.GenerateImageRequest\x1a\x16.xai_api.ImageResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nImageProtoP\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\x16xai/api/v1/image.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16xai/api/v1/usage.proto\"\xc6\x04\n\x14GenerateImageRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x05 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x11\n\x01n\x18\x03 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\x12\n\x04user\x18\x04 \x01(\tR\x04user\x12,\n\x06\x66ormat\x18\x0b \x01(\x0e\x32\x14.xai_api.ImageFormatR\x06\x66ormat\x12\x34\n\x07quality\x18\x0c \x01(\x0e\x32\x15.xai_api.ImageQualityH\x01R\x07quality\x88\x01\x01\x12\x41\n\x0c\x61spect_ratio\x18\x0e \x01(\x0e\x32\x19.xai_api.ImageAspectRatioH\x02R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x0f \x01(\x0e\x32\x18.xai_api.ImageResolutionH\x03R\nresolution\x88\x01\x01\x12\x30\n\x06images\x18\x11 \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x06images\x12\x45\n\x0fstorage_options\x18\x13 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x04R\x0estorageOptions\x88\x01\x01\x42\x04\n\x02_nB\n\n\x08_qualityB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_optionsJ\x04\x08\r\x10\x0e\"\xb6\x01\n\x0eStorageOptions\x12\x1a\n\x08\x66ilename\x18\x01 \x01(\tR\x08\x66ilename\x12(\n\rexpires_after\x18\x02 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x12=\n\npublic_url\x18\x03 \x01(\x0b\x32\x19.xai_api.PublicUrlOptionsH\x01R\tpublicUrl\x88\x01\x01\x42\x10\n\x0e_expires_afterB\r\n\x0b_public_url\"N\n\x10PublicUrlOptions\x12(\n\rexpires_after\x18\x01 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x42\x10\n\x0e_expires_after\"\xfb\x02\n\nFileOutput\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x1a\n\x08\x66ilename\x18\x02 \x01(\tR\x08\x66ilename\x12\"\n\npublic_url\x18\x04 \x01(\tH\x00R\tpublicUrl\x88\x01\x01\x12R\n\x15public_url_expires_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x12publicUrlExpiresAt\x88\x01\x01\x12>\n\nexpires_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\texpiresAt\x88\x01\x01\x12-\n\x10public_url_error\x18\x07 \x01(\tH\x03R\x0epublicUrlError\x88\x01\x01\x42\r\n\x0b_public_urlB\x18\n\x16_public_url_expires_atB\r\n\x0b_expires_atB\x13\n\x11_public_url_errorJ\x04\x08\x03\x10\x04\"\x84\x01\n\rImageResponse\x12/\n\x06images\x18\x01 \x03(\x0b\x32\x17.xai_api.GeneratedImageR\x06images\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\"\x83\x02\n\x0eGeneratedImage\x12\x18\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00R\x06\x62\x61se64\x12\x12\n\x03url\x18\x03 \x01(\tH\x00R\x03url\x12-\n\x12respect_moderation\x18\x04 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x08 \x01(\x0b\x32\x13.xai_api.FileOutputH\x01R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\t \x01(\tH\x02R\x0cstorageError\x88\x01\x01\x42\x07\n\x05imageB\x0e\n\x0c_file_outputB\x10\n\x0e_storage_errorJ\x04\x08\x02\x10\x03\"\x83\x01\n\x0fImageUrlContent\x12\x1d\n\timage_url\x18\x01 \x01(\tH\x00R\x08imageUrl\x12\x19\n\x07\x66ile_id\x18\x03 \x01(\tH\x00R\x06\x66ileId\x12,\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailR\x06\x64\x65tailB\x08\n\x06source*S\n\x0bImageDetail\x12\x12\n\x0e\x44\x45TAIL_INVALID\x10\x00\x12\x0f\n\x0b\x44\x45TAIL_AUTO\x10\x01\x12\x0e\n\nDETAIL_LOW\x10\x02\x12\x0f\n\x0b\x44\x45TAIL_HIGH\x10\x03*P\n\x0bImageFormat\x12\x16\n\x12IMG_FORMAT_INVALID\x10\x00\x12\x15\n\x11IMG_FORMAT_BASE64\x10\x01\x12\x12\n\x0eIMG_FORMAT_URL\x10\x02*j\n\x0cImageQuality\x12\x17\n\x13IMG_QUALITY_INVALID\x10\x00\x12\x13\n\x0fIMG_QUALITY_LOW\x10\x01\x12\x16\n\x12IMG_QUALITY_MEDIUM\x10\x02\x12\x14\n\x10IMG_QUALITY_HIGH\x10\x03*\xa7\x03\n\x10ImageAspectRatio\x12\x1c\n\x18IMG_ASPECT_RATIO_INVALID\x10\x00\x12\x18\n\x14IMG_ASPECT_RATIO_1_1\x10\x01\x12\x18\n\x14IMG_ASPECT_RATIO_3_4\x10\x02\x12\x18\n\x14IMG_ASPECT_RATIO_4_3\x10\x03\x12\x19\n\x15IMG_ASPECT_RATIO_9_16\x10\x04\x12\x19\n\x15IMG_ASPECT_RATIO_16_9\x10\x05\x12\x18\n\x14IMG_ASPECT_RATIO_2_3\x10\x06\x12\x18\n\x14IMG_ASPECT_RATIO_3_2\x10\x07\x12\x19\n\x15IMG_ASPECT_RATIO_AUTO\x10\x08\x12\x1b\n\x17IMG_ASPECT_RATIO_9_19_5\x10\t\x12\x1b\n\x17IMG_ASPECT_RATIO_19_5_9\x10\n\x12\x19\n\x15IMG_ASPECT_RATIO_9_20\x10\x0b\x12\x19\n\x15IMG_ASPECT_RATIO_20_9\x10\x0c\x12\x18\n\x14IMG_ASPECT_RATIO_1_2\x10\r\x12\x18\n\x14IMG_ASPECT_RATIO_2_1\x10\x0e*[\n\x0fImageResolution\x12\x1a\n\x16IMG_RESOLUTION_INVALID\x10\x00\x12\x15\n\x11IMG_RESOLUTION_1K\x10\x01\x12\x15\n\x11IMG_RESOLUTION_2K\x10\x02\x32Q\n\x05Image\x12H\n\rGenerateImage\x12\x1d.xai_api.GenerateImageRequest\x1a\x16.xai_api.ImageResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nImageProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -34,30 +34,30 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\nImageProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_IMAGEDETAIL']._serialized_start=1789 - _globals['_IMAGEDETAIL']._serialized_end=1872 - _globals['_IMAGEFORMAT']._serialized_start=1874 - _globals['_IMAGEFORMAT']._serialized_end=1954 - _globals['_IMAGEQUALITY']._serialized_start=1956 - _globals['_IMAGEQUALITY']._serialized_end=2062 - _globals['_IMAGEASPECTRATIO']._serialized_start=2065 - _globals['_IMAGEASPECTRATIO']._serialized_end=2488 - _globals['_IMAGERESOLUTION']._serialized_start=2490 - _globals['_IMAGERESOLUTION']._serialized_end=2581 + _globals['_IMAGEDETAIL']._serialized_start=1855 + _globals['_IMAGEDETAIL']._serialized_end=1938 + _globals['_IMAGEFORMAT']._serialized_start=1940 + _globals['_IMAGEFORMAT']._serialized_end=2020 + _globals['_IMAGEQUALITY']._serialized_start=2022 + _globals['_IMAGEQUALITY']._serialized_end=2128 + _globals['_IMAGEASPECTRATIO']._serialized_start=2131 + _globals['_IMAGEASPECTRATIO']._serialized_end=2554 + _globals['_IMAGERESOLUTION']._serialized_start=2556 + _globals['_IMAGERESOLUTION']._serialized_end=2647 _globals['_GENERATEIMAGEREQUEST']._serialized_start=93 - _globals['_GENERATEIMAGEREQUEST']._serialized_end=609 - _globals['_STORAGEOPTIONS']._serialized_start=612 - _globals['_STORAGEOPTIONS']._serialized_end=794 - _globals['_PUBLICURLOPTIONS']._serialized_start=796 - _globals['_PUBLICURLOPTIONS']._serialized_end=874 - _globals['_FILEOUTPUT']._serialized_start=877 - _globals['_FILEOUTPUT']._serialized_end=1256 - _globals['_IMAGERESPONSE']._serialized_start=1259 - _globals['_IMAGERESPONSE']._serialized_end=1391 - _globals['_GENERATEDIMAGE']._serialized_start=1394 - _globals['_GENERATEDIMAGE']._serialized_end=1653 - _globals['_IMAGEURLCONTENT']._serialized_start=1656 - _globals['_IMAGEURLCONTENT']._serialized_end=1787 - _globals['_IMAGE']._serialized_start=2583 - _globals['_IMAGE']._serialized_end=2664 + _globals['_GENERATEIMAGEREQUEST']._serialized_end=675 + _globals['_STORAGEOPTIONS']._serialized_start=678 + _globals['_STORAGEOPTIONS']._serialized_end=860 + _globals['_PUBLICURLOPTIONS']._serialized_start=862 + _globals['_PUBLICURLOPTIONS']._serialized_end=940 + _globals['_FILEOUTPUT']._serialized_start=943 + _globals['_FILEOUTPUT']._serialized_end=1322 + _globals['_IMAGERESPONSE']._serialized_start=1325 + _globals['_IMAGERESPONSE']._serialized_end=1457 + _globals['_GENERATEDIMAGE']._serialized_start=1460 + _globals['_GENERATEDIMAGE']._serialized_end=1719 + _globals['_IMAGEURLCONTENT']._serialized_start=1722 + _globals['_IMAGEURLCONTENT']._serialized_end=1853 + _globals['_IMAGE']._serialized_start=2649 + _globals['_IMAGE']._serialized_end=2730 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v5/image_pb2.pyi b/src/xai_sdk/proto/v5/image_pb2.pyi index 371dffa..891e539 100644 --- a/src/xai_sdk/proto/v5/image_pb2.pyi +++ b/src/xai_sdk/proto/v5/image_pb2.pyi @@ -82,13 +82,14 @@ IMG_RESOLUTION_1K: ImageResolution IMG_RESOLUTION_2K: ImageResolution class GenerateImageRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "n", "user", "format", "aspect_ratio", "resolution", "images", "storage_options") + __slots__ = ("prompt", "image", "model", "n", "user", "format", "quality", "aspect_ratio", "resolution", "images", "storage_options") PROMPT_FIELD_NUMBER: _ClassVar[int] IMAGE_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] N_FIELD_NUMBER: _ClassVar[int] USER_FIELD_NUMBER: _ClassVar[int] FORMAT_FIELD_NUMBER: _ClassVar[int] + QUALITY_FIELD_NUMBER: _ClassVar[int] ASPECT_RATIO_FIELD_NUMBER: _ClassVar[int] RESOLUTION_FIELD_NUMBER: _ClassVar[int] IMAGES_FIELD_NUMBER: _ClassVar[int] @@ -99,11 +100,12 @@ class GenerateImageRequest(_message.Message): n: int user: str format: ImageFormat + quality: ImageQuality aspect_ratio: ImageAspectRatio resolution: ImageResolution images: _containers.RepeatedCompositeFieldContainer[ImageUrlContent] storage_options: StorageOptions - def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., n: _Optional[int] = ..., user: _Optional[str] = ..., format: _Optional[_Union[ImageFormat, str]] = ..., aspect_ratio: _Optional[_Union[ImageAspectRatio, str]] = ..., resolution: _Optional[_Union[ImageResolution, str]] = ..., images: _Optional[_Iterable[_Union[ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[StorageOptions, _Mapping]] = ...) -> None: ... + def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., n: _Optional[int] = ..., user: _Optional[str] = ..., format: _Optional[_Union[ImageFormat, str]] = ..., quality: _Optional[_Union[ImageQuality, str]] = ..., aspect_ratio: _Optional[_Union[ImageAspectRatio, str]] = ..., resolution: _Optional[_Union[ImageResolution, str]] = ..., images: _Optional[_Iterable[_Union[ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[StorageOptions, _Mapping]] = ...) -> None: ... class StorageOptions(_message.Message): __slots__ = ("filename", "expires_after", "public_url") diff --git a/src/xai_sdk/proto/v5/usage_pb2.py b/src/xai_sdk/proto/v5/usage_pb2.py index 2582f87..8fa59ac 100644 --- a/src/xai_sdk/proto/v5/usage_pb2.py +++ b/src/xai_sdk/proto/v5/usage_pb2.py @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/usage.proto\x12\x07xai_api\"\x86\x04\n\rSamplingUsage\x12+\n\x11\x63ompletion_tokens\x18\x01 \x01(\x05R\x10\x63ompletionTokens\x12)\n\x10reasoning_tokens\x18\x06 \x01(\x05R\x0freasoningTokens\x12#\n\rprompt_tokens\x18\x02 \x01(\x05R\x0cpromptTokens\x12!\n\x0ctotal_tokens\x18\x03 \x01(\x05R\x0btotalTokens\x12,\n\x12prompt_text_tokens\x18\x04 \x01(\x05R\x10promptTextTokens\x12\x39\n\x19\x63\x61\x63hed_prompt_text_tokens\x18\x07 \x01(\x05R\x16\x63\x61\x63hedPromptTextTokens\x12.\n\x13prompt_image_tokens\x18\x05 \x01(\x05R\x11promptImageTokens\x12(\n\x10num_sources_used\x18\x08 \x01(\x05R\x0enumSourcesUsed\x12L\n\x16server_side_tools_used\x18\t \x03(\x0e\x32\x17.xai_api.ServerSideToolR\x13serverSideToolsUsed\x12.\n\x11\x63ost_in_usd_ticks\x18\x0b \x01(\x03H\x00R\x0e\x63ostInUsdTicks\x88\x01\x01\x42\x14\n\x12_cost_in_usd_ticks\"r\n\x0e\x45mbeddingUsage\x12.\n\x13num_text_embeddings\x18\x01 \x01(\x05R\x11numTextEmbeddings\x12\x30\n\x14num_image_embeddings\x18\x02 \x01(\x05R\x12numImageEmbeddings*`\n\x0bServiceTier\x12\x1c\n\x18SERVICE_TIER_UNSPECIFIED\x10\x00\x12\x18\n\x14SERVICE_TIER_DEFAULT\x10\x01\x12\x19\n\x15SERVICE_TIER_PRIORITY\x10\x02*\xe5\x02\n\x0eServerSideTool\x12\x1c\n\x18SERVER_SIDE_TOOL_INVALID\x10\x00\x12\x1f\n\x1bSERVER_SIDE_TOOL_WEB_SEARCH\x10\x01\x12\x1d\n\x19SERVER_SIDE_TOOL_X_SEARCH\x10\x02\x12#\n\x1fSERVER_SIDE_TOOL_CODE_EXECUTION\x10\x03\x12\x1f\n\x1bSERVER_SIDE_TOOL_VIEW_IMAGE\x10\x04\x12!\n\x1dSERVER_SIDE_TOOL_VIEW_X_VIDEO\x10\x05\x12\'\n#SERVER_SIDE_TOOL_COLLECTIONS_SEARCH\x10\x06\x12\x18\n\x14SERVER_SIDE_TOOL_MCP\x10\x07\x12&\n\"SERVER_SIDE_TOOL_ATTACHMENT_SEARCH\x10\x08\x12!\n\x1dSERVER_SIDE_TOOL_IMAGE_SEARCH\x10\nBQ\n\x0b\x63om.xai_apiB\nUsageProtoP\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\x16xai/api/v1/usage.proto\x12\x07xai_api\"\x86\x04\n\rSamplingUsage\x12+\n\x11\x63ompletion_tokens\x18\x01 \x01(\x05R\x10\x63ompletionTokens\x12)\n\x10reasoning_tokens\x18\x06 \x01(\x05R\x0freasoningTokens\x12#\n\rprompt_tokens\x18\x02 \x01(\x05R\x0cpromptTokens\x12!\n\x0ctotal_tokens\x18\x03 \x01(\x05R\x0btotalTokens\x12,\n\x12prompt_text_tokens\x18\x04 \x01(\x05R\x10promptTextTokens\x12\x39\n\x19\x63\x61\x63hed_prompt_text_tokens\x18\x07 \x01(\x05R\x16\x63\x61\x63hedPromptTextTokens\x12.\n\x13prompt_image_tokens\x18\x05 \x01(\x05R\x11promptImageTokens\x12(\n\x10num_sources_used\x18\x08 \x01(\x05R\x0enumSourcesUsed\x12L\n\x16server_side_tools_used\x18\t \x03(\x0e\x32\x17.xai_api.ServerSideToolR\x13serverSideToolsUsed\x12.\n\x11\x63ost_in_usd_ticks\x18\x0b \x01(\x03H\x00R\x0e\x63ostInUsdTicks\x88\x01\x01\x42\x14\n\x12_cost_in_usd_ticks\"r\n\x0e\x45mbeddingUsage\x12.\n\x13num_text_embeddings\x18\x01 \x01(\x05R\x11numTextEmbeddings\x12\x30\n\x14num_image_embeddings\x18\x02 \x01(\x05R\x12numImageEmbeddings*`\n\x0bServiceTier\x12\x1c\n\x18SERVICE_TIER_UNSPECIFIED\x10\x00\x12\x18\n\x14SERVICE_TIER_DEFAULT\x10\x01\x12\x19\n\x15SERVICE_TIER_PRIORITY\x10\x02*\x8c\x03\n\x0eServerSideTool\x12\x1c\n\x18SERVER_SIDE_TOOL_INVALID\x10\x00\x12\x1f\n\x1bSERVER_SIDE_TOOL_WEB_SEARCH\x10\x01\x12\x1d\n\x19SERVER_SIDE_TOOL_X_SEARCH\x10\x02\x12#\n\x1fSERVER_SIDE_TOOL_CODE_EXECUTION\x10\x03\x12\x1f\n\x1bSERVER_SIDE_TOOL_VIEW_IMAGE\x10\x04\x12!\n\x1dSERVER_SIDE_TOOL_VIEW_X_VIDEO\x10\x05\x12\'\n#SERVER_SIDE_TOOL_COLLECTIONS_SEARCH\x10\x06\x12\x18\n\x14SERVER_SIDE_TOOL_MCP\x10\x07\x12&\n\"SERVER_SIDE_TOOL_ATTACHMENT_SEARCH\x10\x08\x12!\n\x1dSERVER_SIDE_TOOL_IMAGE_SEARCH\x10\n\x12%\n!SERVER_SIDE_TOOL_IMAGE_GENERATION\x10\x0b\x42Q\n\x0b\x63om.xai_apiB\nUsageProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,7 +35,7 @@ _globals['_SERVICETIER']._serialized_start=672 _globals['_SERVICETIER']._serialized_end=768 _globals['_SERVERSIDETOOL']._serialized_start=771 - _globals['_SERVERSIDETOOL']._serialized_end=1128 + _globals['_SERVERSIDETOOL']._serialized_end=1167 _globals['_SAMPLINGUSAGE']._serialized_start=36 _globals['_SAMPLINGUSAGE']._serialized_end=554 _globals['_EMBEDDINGUSAGE']._serialized_start=556 diff --git a/src/xai_sdk/proto/v5/usage_pb2.pyi b/src/xai_sdk/proto/v5/usage_pb2.pyi index 015e7af..1a03129 100644 --- a/src/xai_sdk/proto/v5/usage_pb2.pyi +++ b/src/xai_sdk/proto/v5/usage_pb2.pyi @@ -24,6 +24,7 @@ class ServerSideTool(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): SERVER_SIDE_TOOL_MCP: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_IMAGE_SEARCH: _ClassVar[ServerSideTool] + SERVER_SIDE_TOOL_IMAGE_GENERATION: _ClassVar[ServerSideTool] SERVICE_TIER_UNSPECIFIED: ServiceTier SERVICE_TIER_DEFAULT: ServiceTier SERVICE_TIER_PRIORITY: ServiceTier @@ -37,6 +38,7 @@ SERVER_SIDE_TOOL_COLLECTIONS_SEARCH: ServerSideTool SERVER_SIDE_TOOL_MCP: ServerSideTool SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: ServerSideTool SERVER_SIDE_TOOL_IMAGE_SEARCH: ServerSideTool +SERVER_SIDE_TOOL_IMAGE_GENERATION: ServerSideTool class SamplingUsage(_message.Message): __slots__ = ("completion_tokens", "reasoning_tokens", "prompt_tokens", "total_tokens", "prompt_text_tokens", "cached_prompt_text_tokens", "prompt_image_tokens", "num_sources_used", "server_side_tools_used", "cost_in_usd_ticks") diff --git a/src/xai_sdk/proto/v5/video_pb2.py b/src/xai_sdk/proto/v5/video_pb2.py index 569b98e..de3fc74 100644 --- a/src/xai_sdk/proto/v5/video_pb2.py +++ b/src/xai_sdk/proto/v5/video_pb2.py @@ -27,7 +27,7 @@ from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/video.proto\x12\x07xai_api\x1a\x19xai/api/v1/deferred.proto\x1a\x16xai/api/v1/image.proto\x1a\x16xai/api/v1/usage.proto\"J\n\x0fVideoUrlContent\x12\x12\n\x03url\x18\x01 \x01(\tH\x00R\x03url\x12\x19\n\x07\x66ile_id\x18\x02 \x01(\tH\x00R\x06\x66ileIdB\x08\n\x06source\"\x94\x04\n\x14GenerateVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12.\n\x05video\x18\x06 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x41\n\x0c\x61spect_ratio\x18\x07 \x01(\x0e\x32\x19.xai_api.VideoAspectRatioH\x01R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x08 \x01(\x0e\x32\x18.xai_api.VideoResolutionH\x02R\nresolution\x88\x01\x01\x12\x43\n\x10reference_images\x18\r \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x0freferenceImages\x12\x45\n\x0fstorage_options\x18\x0e \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x03R\x0estorageOptions\x88\x01\x01\x42\x0b\n\t_durationB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_options\"8\n\x17GetDeferredVideoRequest\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\"\xd8\x01\n\rVideoResponse\x12-\n\x05video\x18\x01 \x01(\x0b\x32\x17.xai_api.GeneratedVideoR\x05video\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12.\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x13.xai_api.VideoErrorH\x00R\x05\x65rror\x88\x01\x01\x12\x1a\n\x08progress\x18\x07 \x01(\x05R\x08progressB\x08\n\x06_error\"\xf4\x01\n\x0eGeneratedVideo\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\x12\x1a\n\x08\x64uration\x18\x04 \x01(\x05R\x08\x64uration\x12-\n\x12respect_moderation\x18\x05 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x06 \x01(\x0b\x32\x13.xai_api.FileOutputH\x00R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\x07 \x01(\tH\x01R\x0cstorageError\x88\x01\x01\x42\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"\x91\x01\n\x18GetDeferredVideoResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x37\n\x08response\x18\x02 \x01(\x0b\x32\x16.xai_api.VideoResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\":\n\nVideoError\x12\x12\n\x04\x63ode\x18\x01 \x01(\tR\x04\x63ode\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\"\xfb\x01\n\x12\x45xtendVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05video\x18\x02 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12\x45\n\x0fstorage_options\x18\x06 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x01R\x0estorageOptions\x88\x01\x01\x42\x0b\n\t_durationB\x12\n\x10_storage_options*\xfc\x01\n\x10VideoAspectRatio\x12\"\n\x1eVIDEO_ASPECT_RATIO_UNSPECIFIED\x10\x00\x12\x1a\n\x16VIDEO_ASPECT_RATIO_1_1\x10\x01\x12\x1b\n\x17VIDEO_ASPECT_RATIO_16_9\x10\x02\x12\x1b\n\x17VIDEO_ASPECT_RATIO_9_16\x10\x03\x12\x1a\n\x16VIDEO_ASPECT_RATIO_4_3\x10\x04\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_4\x10\x05\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_2\x10\x06\x12\x1a\n\x16VIDEO_ASPECT_RATIO_2_3\x10\x07*i\n\x0fVideoResolution\x12 \n\x1cVIDEO_RESOLUTION_UNSPECIFIED\x10\x00\x12\x19\n\x15VIDEO_RESOLUTION_480P\x10\x01\x12\x19\n\x15VIDEO_RESOLUTION_720P\x10\x02\x32\x82\x02\n\x05Video\x12P\n\rGenerateVideo\x12\x1d.xai_api.GenerateVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12L\n\x0b\x45xtendVideo\x12\x1b.xai_api.ExtendVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12Y\n\x10GetDeferredVideo\x12 .xai_api.GetDeferredVideoRequest\x1a!.xai_api.GetDeferredVideoResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nVideoProtoP\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\x16xai/api/v1/video.proto\x12\x07xai_api\x1a\x19xai/api/v1/deferred.proto\x1a\x16xai/api/v1/image.proto\x1a\x16xai/api/v1/usage.proto\"J\n\x0fVideoUrlContent\x12\x12\n\x03url\x18\x01 \x01(\tH\x00R\x03url\x12\x19\n\x07\x66ile_id\x18\x02 \x01(\tH\x00R\x06\x66ileIdB\x08\n\x06source\">\n\x0f\x41udioUrlContent\x12\x1b\n\x08voice_id\x18\x02 \x01(\tH\x00R\x07voiceIdB\x08\n\x06sourceJ\x04\x08\x01\x10\x02\"\x9e\x05\n\x14GenerateVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12.\n\x05video\x18\x06 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x41\n\x0c\x61spect_ratio\x18\x07 \x01(\x0e\x32\x19.xai_api.VideoAspectRatioH\x01R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x08 \x01(\x0e\x32\x18.xai_api.VideoResolutionH\x02R\nresolution\x88\x01\x01\x12\x43\n\x10reference_images\x18\r \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x0freferenceImages\x12\x45\n\x0fstorage_options\x18\x0e \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x03R\x0estorageOptions\x88\x01\x01\x12\x43\n\x10reference_audios\x18\x10 \x03(\x0b\x32\x18.xai_api.AudioUrlContentR\x0freferenceAudios\x12*\n\x0egenerate_audio\x18\x11 \x01(\x08H\x04R\rgenerateAudio\x88\x01\x01\x42\x0b\n\t_durationB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_optionsB\x11\n\x0f_generate_audioJ\x04\x08\x0f\x10\x10\"8\n\x17GetDeferredVideoRequest\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\"\xd8\x01\n\rVideoResponse\x12-\n\x05video\x18\x01 \x01(\x0b\x32\x17.xai_api.GeneratedVideoR\x05video\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12.\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x13.xai_api.VideoErrorH\x00R\x05\x65rror\x88\x01\x01\x12\x1a\n\x08progress\x18\x07 \x01(\x05R\x08progressB\x08\n\x06_error\"\xf4\x01\n\x0eGeneratedVideo\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\x12\x1a\n\x08\x64uration\x18\x04 \x01(\x05R\x08\x64uration\x12-\n\x12respect_moderation\x18\x05 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x06 \x01(\x0b\x32\x13.xai_api.FileOutputH\x00R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\x07 \x01(\tH\x01R\x0cstorageError\x88\x01\x01\x42\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"\x91\x01\n\x18GetDeferredVideoResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x37\n\x08response\x18\x02 \x01(\x0b\x32\x16.xai_api.VideoResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\":\n\nVideoError\x12\x12\n\x04\x63ode\x18\x01 \x01(\tR\x04\x63ode\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\"\x81\x02\n\x12\x45xtendVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05video\x18\x02 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12\x45\n\x0fstorage_options\x18\x06 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x01R\x0estorageOptions\x88\x01\x01\x42\x0b\n\t_durationB\x12\n\x10_storage_optionsJ\x04\x08\x07\x10\x08*\xfc\x01\n\x10VideoAspectRatio\x12\"\n\x1eVIDEO_ASPECT_RATIO_UNSPECIFIED\x10\x00\x12\x1a\n\x16VIDEO_ASPECT_RATIO_1_1\x10\x01\x12\x1b\n\x17VIDEO_ASPECT_RATIO_16_9\x10\x02\x12\x1b\n\x17VIDEO_ASPECT_RATIO_9_16\x10\x03\x12\x1a\n\x16VIDEO_ASPECT_RATIO_4_3\x10\x04\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_4\x10\x05\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_2\x10\x06\x12\x1a\n\x16VIDEO_ASPECT_RATIO_2_3\x10\x07*i\n\x0fVideoResolution\x12 \n\x1cVIDEO_RESOLUTION_UNSPECIFIED\x10\x00\x12\x19\n\x15VIDEO_RESOLUTION_480P\x10\x01\x12\x19\n\x15VIDEO_RESOLUTION_720P\x10\x02\x32\x82\x02\n\x05Video\x12P\n\rGenerateVideo\x12\x1d.xai_api.GenerateVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12L\n\x0b\x45xtendVideo\x12\x1b.xai_api.ExtendVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12Y\n\x10GetDeferredVideo\x12 .xai_api.GetDeferredVideoRequest\x1a!.xai_api.GetDeferredVideoResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nVideoProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,26 +35,28 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\nVideoProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_VIDEOASPECTRATIO']._serialized_start=1708 - _globals['_VIDEOASPECTRATIO']._serialized_end=1960 - _globals['_VIDEORESOLUTION']._serialized_start=1962 - _globals['_VIDEORESOLUTION']._serialized_end=2067 + _globals['_VIDEOASPECTRATIO']._serialized_start=1916 + _globals['_VIDEOASPECTRATIO']._serialized_end=2168 + _globals['_VIDEORESOLUTION']._serialized_start=2170 + _globals['_VIDEORESOLUTION']._serialized_end=2275 _globals['_VIDEOURLCONTENT']._serialized_start=110 _globals['_VIDEOURLCONTENT']._serialized_end=184 - _globals['_GENERATEVIDEOREQUEST']._serialized_start=187 - _globals['_GENERATEVIDEOREQUEST']._serialized_end=719 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=721 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=777 - _globals['_VIDEORESPONSE']._serialized_start=780 - _globals['_VIDEORESPONSE']._serialized_end=996 - _globals['_GENERATEDVIDEO']._serialized_start=999 - _globals['_GENERATEDVIDEO']._serialized_end=1243 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=1246 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1391 - _globals['_VIDEOERROR']._serialized_start=1393 - _globals['_VIDEOERROR']._serialized_end=1451 - _globals['_EXTENDVIDEOREQUEST']._serialized_start=1454 - _globals['_EXTENDVIDEOREQUEST']._serialized_end=1705 - _globals['_VIDEO']._serialized_start=2070 - _globals['_VIDEO']._serialized_end=2328 + _globals['_AUDIOURLCONTENT']._serialized_start=186 + _globals['_AUDIOURLCONTENT']._serialized_end=248 + _globals['_GENERATEVIDEOREQUEST']._serialized_start=251 + _globals['_GENERATEVIDEOREQUEST']._serialized_end=921 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=923 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=979 + _globals['_VIDEORESPONSE']._serialized_start=982 + _globals['_VIDEORESPONSE']._serialized_end=1198 + _globals['_GENERATEDVIDEO']._serialized_start=1201 + _globals['_GENERATEDVIDEO']._serialized_end=1445 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=1448 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1593 + _globals['_VIDEOERROR']._serialized_start=1595 + _globals['_VIDEOERROR']._serialized_end=1653 + _globals['_EXTENDVIDEOREQUEST']._serialized_start=1656 + _globals['_EXTENDVIDEOREQUEST']._serialized_end=1913 + _globals['_VIDEO']._serialized_start=2278 + _globals['_VIDEO']._serialized_end=2536 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v5/video_pb2.pyi b/src/xai_sdk/proto/v5/video_pb2.pyi index 48ff438..853e81e 100644 --- a/src/xai_sdk/proto/v5/video_pb2.pyi +++ b/src/xai_sdk/proto/v5/video_pb2.pyi @@ -45,8 +45,14 @@ class VideoUrlContent(_message.Message): file_id: str def __init__(self, url: _Optional[str] = ..., file_id: _Optional[str] = ...) -> None: ... +class AudioUrlContent(_message.Message): + __slots__ = ("voice_id",) + VOICE_ID_FIELD_NUMBER: _ClassVar[int] + voice_id: str + def __init__(self, voice_id: _Optional[str] = ...) -> None: ... + class GenerateVideoRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "duration", "video", "aspect_ratio", "resolution", "reference_images", "storage_options") + __slots__ = ("prompt", "image", "model", "duration", "video", "aspect_ratio", "resolution", "reference_images", "storage_options", "reference_audios", "generate_audio") PROMPT_FIELD_NUMBER: _ClassVar[int] IMAGE_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] @@ -56,6 +62,8 @@ class GenerateVideoRequest(_message.Message): RESOLUTION_FIELD_NUMBER: _ClassVar[int] REFERENCE_IMAGES_FIELD_NUMBER: _ClassVar[int] STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + REFERENCE_AUDIOS_FIELD_NUMBER: _ClassVar[int] + GENERATE_AUDIO_FIELD_NUMBER: _ClassVar[int] prompt: str image: _image_pb2.ImageUrlContent model: str @@ -65,7 +73,9 @@ class GenerateVideoRequest(_message.Message): resolution: VideoResolution reference_images: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUrlContent] storage_options: _image_pb2.StorageOptions - def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., aspect_ratio: _Optional[_Union[VideoAspectRatio, str]] = ..., resolution: _Optional[_Union[VideoResolution, str]] = ..., reference_images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ...) -> None: ... + reference_audios: _containers.RepeatedCompositeFieldContainer[AudioUrlContent] + generate_audio: bool + def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., aspect_ratio: _Optional[_Union[VideoAspectRatio, str]] = ..., resolution: _Optional[_Union[VideoResolution, str]] = ..., reference_images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ..., reference_audios: _Optional[_Iterable[_Union[AudioUrlContent, _Mapping]]] = ..., generate_audio: bool = ...) -> None: ... class GetDeferredVideoRequest(_message.Message): __slots__ = ("request_id",) diff --git a/src/xai_sdk/proto/v6/chat_pb2.py b/src/xai_sdk/proto/v6/chat_pb2.py index 831d65b..451721e 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\"\xf1\n\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\x07include\x12\x39\n\x0b\x61gent_count\x18\x1d \x01(\x0e\x32\x13.xai_api.AgentCountH\rR\nagentCount\x88\x01\x01\x12\x37\n\x0cservice_tier\x18\x1f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTierB\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_turnsB\x0e\n\x0c_agent_countJ\x04\x08\x04\x10\x05\"\x87\x04\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\x12\x36\n\x0coutput_files\x18\r \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"\xd3\x03\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\x12\x36\n\x0coutput_files\x18\x0b \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0c \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"9\n\nOutputFile\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\"\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\"\x85\x01\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x1a\n\x08\x66ilename\x18\x03 \x01(\tR\x08\x66ilename\x12\x1b\n\tmime_type\x18\x04 \x01(\tR\x08mimeType\x12\x10\n\x03url\x18\x05 \x01(\tR\x03url\"\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\"\xea\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\x12\x33\n\x13\x65nable_image_search\x18\x05 \x01(\x08H\x02R\x11\x65nableImageSearch\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_locationB\x16\n\x14_enable_image_search\"\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\"U\n\x15\x43ompactContextRequest\x12\x14\n\x05model\x18\x01 \x01(\tR\x05model\x12&\n\x05input\x18\x02 \x03(\x0b\x32\x10.xai_api.MessageR\x05input\"\xb7\x01\n\x16\x43ompactContextResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12+\n\x11\x65ncrypted_content\x18\x02 \x01(\tR\x10\x65ncryptedContent\x12\x32\n\x15\x64ropped_message_count\x18\x03 \x01(\rR\x13\x64roppedMessageCount\x12,\n\x05usage\x18\x04 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage*\xb2\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\x12.\n*INCLUDE_OPTION_CODE_EXECUTION_FILES_OUTPUT\x10\t*\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*|\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\x12\x0f\n\x0b\x45\x46\x46ORT_NONE\x10\x04\x12\x10\n\x0c\x45\x46\x46ORT_XHIGH\x10\x05*P\n\nAgentCount\x12\x1b\n\x17\x41GENT_COUNT_UNSPECIFIED\x10\x00\x12\x11\n\rAGENT_COUNT_4\x10\x01\x12\x12\n\x0e\x41GENT_COUNT_16\x10\x02*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\x99\x05\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\x12S\n\x0e\x43ompactContext\x12\x1e.xai_api.CompactContextRequest\x1a\x1f.xai_api.CompactContextResponse\"\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\"\xf1\n\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\x07include\x12\x39\n\x0b\x61gent_count\x18\x1d \x01(\x0e\x32\x13.xai_api.AgentCountH\rR\nagentCount\x88\x01\x01\x12\x37\n\x0cservice_tier\x18\x1f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTierB\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_turnsB\x0e\n\x0c_agent_countJ\x04\x08\x04\x10\x05\"\x87\x04\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\x12\x36\n\x0coutput_files\x18\r \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"\xd3\x03\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\x12\x36\n\x0coutput_files\x18\x0b \x03(\x0b\x32\x13.xai_api.OutputFileR\x0boutputFiles\x12\x37\n\x0cservice_tier\x18\x0c \x01(\x0e\x32\x14.xai_api.ServiceTierR\x0bserviceTier\"9\n\nOutputFile\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\"\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\"\x85\x01\n\x0b\x46ileContent\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x12\n\x04\x64\x61ta\x18\x02 \x01(\x0cR\x04\x64\x61ta\x12\x1a\n\x08\x66ilename\x18\x03 \x01(\tR\x08\x66ilename\x12\x1b\n\tmime_type\x18\x04 \x01(\tR\x08mimeType\x12\x10\n\x03url\x18\x05 \x01(\tR\x03url\"\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\"\xe4\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\x61ttachmentSearch\x12\x45\n\x10image_generation\x18\n \x01(\x0b\x32\x18.xai_api.ImageGenerationH\x00R\x0fimageGenerationB\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\"\xea\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\x12\x33\n\x13\x65nable_image_search\x18\x05 \x01(\x08H\x02R\x11\x65nableImageSearch\x88\x01\x01\x42\x1d\n\x1b_enable_image_understandingB\x10\n\x0e_user_locationB\x16\n\x14_enable_image_search\"\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\"9\n\x0fImageGeneration\x12\x1b\n\x06\x61\x63tion\x18\x01 \x01(\tH\x00R\x06\x61\x63tion\x88\x01\x01\x42\t\n\x07_action\"\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\"U\n\x15\x43ompactContextRequest\x12\x14\n\x05model\x18\x01 \x01(\tR\x05model\x12&\n\x05input\x18\x02 \x03(\x0b\x32\x10.xai_api.MessageR\x05input\"\xb7\x01\n\x16\x43ompactContextResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12+\n\x11\x65ncrypted_content\x18\x02 \x01(\tR\x10\x65ncryptedContent\x12\x32\n\x15\x64ropped_message_count\x18\x03 \x01(\rR\x13\x64roppedMessageCount\x12,\n\x05usage\x18\x04 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage*\xb2\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\x12.\n*INCLUDE_OPTION_CODE_EXECUTION_FILES_OUTPUT\x10\t*\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*|\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\x12\x0f\n\x0b\x45\x46\x46ORT_NONE\x10\x04\x12\x10\n\x0c\x45\x46\x46ORT_XHIGH\x10\x05*P\n\nAgentCount\x12\x1b\n\x17\x41GENT_COUNT_UNSPECIFIED\x10\x00\x12\x11\n\rAGENT_COUNT_4\x10\x01\x12\x12\n\x0e\x41GENT_COUNT_16\x10\x02*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*\xdb\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\x12(\n$TOOL_CALL_TYPE_IMAGE_GENERATION_TOOL\x10\n*\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\x99\x05\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\x12S\n\x0e\x43ompactContext\x12\x1e.xai_api.CompactContextRequest\x1a\x1f.xai_api.CompactContextResponse\"\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) @@ -42,24 +42,24 @@ _globals['_MESSAGEROLE'].values_by_name["ROLE_FUNCTION"]._serialized_options = b'\010\001' _globals['_MCP_EXTRAHEADERSENTRY']._loaded_options = None _globals['_MCP_EXTRAHEADERSENTRY']._serialized_options = b'8\001' - _globals['_INCLUDEOPTION']._serialized_start=10930 - _globals['_INCLUDEOPTION']._serialized_end=11364 - _globals['_MESSAGEROLE']._serialized_start=11367 - _globals['_MESSAGEROLE']._serialized_end=11508 - _globals['_REASONINGEFFORT']._serialized_start=11510 - _globals['_REASONINGEFFORT']._serialized_end=11634 - _globals['_AGENTCOUNT']._serialized_start=11636 - _globals['_AGENTCOUNT']._serialized_end=11716 - _globals['_TOOLMODE']._serialized_start=11718 - _globals['_TOOLMODE']._serialized_end=11815 - _globals['_FORMATTYPE']._serialized_start=11817 - _globals['_FORMATTYPE']._serialized_end=11934 - _globals['_TOOLCALLTYPE']._serialized_start=11937 - _globals['_TOOLCALLTYPE']._serialized_end=12242 - _globals['_TOOLCALLSTATUS']._serialized_start=12245 - _globals['_TOOLCALLSTATUS']._serialized_end=12389 - _globals['_SEARCHMODE']._serialized_start=12391 - _globals['_SEARCHMODE']._serialized_end=12491 + _globals['_INCLUDEOPTION']._serialized_start=11060 + _globals['_INCLUDEOPTION']._serialized_end=11494 + _globals['_MESSAGEROLE']._serialized_start=11497 + _globals['_MESSAGEROLE']._serialized_end=11638 + _globals['_REASONINGEFFORT']._serialized_start=11640 + _globals['_REASONINGEFFORT']._serialized_end=11764 + _globals['_AGENTCOUNT']._serialized_start=11766 + _globals['_AGENTCOUNT']._serialized_end=11846 + _globals['_TOOLMODE']._serialized_start=11848 + _globals['_TOOLMODE']._serialized_end=11945 + _globals['_FORMATTYPE']._serialized_start=11947 + _globals['_FORMATTYPE']._serialized_end=12064 + _globals['_TOOLCALLTYPE']._serialized_start=12067 + _globals['_TOOLCALLTYPE']._serialized_end=12414 + _globals['_TOOLCALLSTATUS']._serialized_start=12417 + _globals['_TOOLCALLSTATUS']._serialized_end=12561 + _globals['_SEARCHMODE']._serialized_start=12563 + _globals['_SEARCHMODE']._serialized_end=12663 _globals['_GETCOMPLETIONSREQUEST']._serialized_start=196 _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1589 _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1592 @@ -101,57 +101,59 @@ _globals['_TOOLCHOICE']._serialized_start=5205 _globals['_TOOLCHOICE']._serialized_end=5312 _globals['_TOOL']._serialized_start=5315 - _globals['_TOOL']._serialized_end=5728 - _globals['_MCP']._serialized_start=5731 - _globals['_MCP']._serialized_end=6090 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_start=6009 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_end=6072 - _globals['_WEBSEARCH']._serialized_start=6093 - _globals['_WEBSEARCH']._serialized_end=6455 - _globals['_WEBSEARCHUSERLOCATION']._serialized_start=6458 - _globals['_WEBSEARCHUSERLOCATION']._serialized_end=6644 - _globals['_XSEARCH']._serialized_start=6647 - _globals['_XSEARCH']._serialized_end=7088 - _globals['_CODEEXECUTION']._serialized_start=7090 - _globals['_CODEEXECUTION']._serialized_end=7105 - _globals['_COLLECTIONSSEARCH']._serialized_start=7108 - _globals['_COLLECTIONSSEARCH']._serialized_end=7501 - _globals['_ATTACHMENTSEARCH']._serialized_start=7503 - _globals['_ATTACHMENTSEARCH']._serialized_end=7558 - _globals['_FUNCTION']._serialized_start=7560 - _globals['_FUNCTION']._serialized_end=7680 - _globals['_TOOLCALL']._serialized_start=7683 - _globals['_TOOLCALL']._serialized_end=7922 - _globals['_FUNCTIONCALL']._serialized_start=7924 - _globals['_FUNCTIONCALL']._serialized_end=7988 - _globals['_RESPONSEFORMAT']._serialized_start=7990 - _globals['_RESPONSEFORMAT']._serialized_end=8100 - _globals['_SEARCHPARAMETERS']._serialized_start=8103 - _globals['_SEARCHPARAMETERS']._serialized_end=8432 - _globals['_SOURCE']._serialized_start=8435 - _globals['_SOURCE']._serialized_end=8610 - _globals['_WEBSOURCE']._serialized_start=8613 - _globals['_WEBSOURCE']._serialized_end=8788 - _globals['_NEWSSOURCE']._serialized_start=8791 - _globals['_NEWSSOURCE']._serialized_end=8924 - _globals['_XSOURCE']._serialized_start=8927 - _globals['_XSOURCE']._serialized_end=9176 - _globals['_RSSSOURCE']._serialized_start=9178 - _globals['_RSSSOURCE']._serialized_end=9211 - _globals['_REQUESTSETTINGS']._serialized_start=9214 - _globals['_REQUESTSETTINGS']._serialized_end=10013 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=10015 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=10076 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=10078 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=10142 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=10144 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=10209 - _globals['_DEBUGOUTPUT']._serialized_start=10212 - _globals['_DEBUGOUTPUT']._serialized_end=10654 - _globals['_COMPACTCONTEXTREQUEST']._serialized_start=10656 - _globals['_COMPACTCONTEXTREQUEST']._serialized_end=10741 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=10744 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=10927 - _globals['_CHAT']._serialized_start=12494 - _globals['_CHAT']._serialized_end=13159 + _globals['_TOOL']._serialized_end=5799 + _globals['_MCP']._serialized_start=5802 + _globals['_MCP']._serialized_end=6161 + _globals['_MCP_EXTRAHEADERSENTRY']._serialized_start=6080 + _globals['_MCP_EXTRAHEADERSENTRY']._serialized_end=6143 + _globals['_WEBSEARCH']._serialized_start=6164 + _globals['_WEBSEARCH']._serialized_end=6526 + _globals['_WEBSEARCHUSERLOCATION']._serialized_start=6529 + _globals['_WEBSEARCHUSERLOCATION']._serialized_end=6715 + _globals['_XSEARCH']._serialized_start=6718 + _globals['_XSEARCH']._serialized_end=7159 + _globals['_CODEEXECUTION']._serialized_start=7161 + _globals['_CODEEXECUTION']._serialized_end=7176 + _globals['_IMAGEGENERATION']._serialized_start=7178 + _globals['_IMAGEGENERATION']._serialized_end=7235 + _globals['_COLLECTIONSSEARCH']._serialized_start=7238 + _globals['_COLLECTIONSSEARCH']._serialized_end=7631 + _globals['_ATTACHMENTSEARCH']._serialized_start=7633 + _globals['_ATTACHMENTSEARCH']._serialized_end=7688 + _globals['_FUNCTION']._serialized_start=7690 + _globals['_FUNCTION']._serialized_end=7810 + _globals['_TOOLCALL']._serialized_start=7813 + _globals['_TOOLCALL']._serialized_end=8052 + _globals['_FUNCTIONCALL']._serialized_start=8054 + _globals['_FUNCTIONCALL']._serialized_end=8118 + _globals['_RESPONSEFORMAT']._serialized_start=8120 + _globals['_RESPONSEFORMAT']._serialized_end=8230 + _globals['_SEARCHPARAMETERS']._serialized_start=8233 + _globals['_SEARCHPARAMETERS']._serialized_end=8562 + _globals['_SOURCE']._serialized_start=8565 + _globals['_SOURCE']._serialized_end=8740 + _globals['_WEBSOURCE']._serialized_start=8743 + _globals['_WEBSOURCE']._serialized_end=8918 + _globals['_NEWSSOURCE']._serialized_start=8921 + _globals['_NEWSSOURCE']._serialized_end=9054 + _globals['_XSOURCE']._serialized_start=9057 + _globals['_XSOURCE']._serialized_end=9306 + _globals['_RSSSOURCE']._serialized_start=9308 + _globals['_RSSSOURCE']._serialized_end=9341 + _globals['_REQUESTSETTINGS']._serialized_start=9344 + _globals['_REQUESTSETTINGS']._serialized_end=10143 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=10145 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=10206 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=10208 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=10272 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=10274 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=10339 + _globals['_DEBUGOUTPUT']._serialized_start=10342 + _globals['_DEBUGOUTPUT']._serialized_end=10784 + _globals['_COMPACTCONTEXTREQUEST']._serialized_start=10786 + _globals['_COMPACTCONTEXTREQUEST']._serialized_end=10871 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=10874 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=11057 + _globals['_CHAT']._serialized_start=12666 + _globals['_CHAT']._serialized_end=13331 # @@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 d00a500..afea9cf 100644 --- a/src/xai_sdk/proto/v6/chat_pb2.pyi +++ b/src/xai_sdk/proto/v6/chat_pb2.pyi @@ -75,6 +75,7 @@ class ToolCallType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: _ClassVar[ToolCallType] TOOL_CALL_TYPE_MCP_TOOL: _ClassVar[ToolCallType] TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: _ClassVar[ToolCallType] + TOOL_CALL_TYPE_IMAGE_GENERATION_TOOL: _ClassVar[ToolCallType] class ToolCallStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -131,6 +132,7 @@ TOOL_CALL_TYPE_CODE_EXECUTION_TOOL: ToolCallType TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: ToolCallType TOOL_CALL_TYPE_MCP_TOOL: ToolCallType TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: ToolCallType +TOOL_CALL_TYPE_IMAGE_GENERATION_TOOL: ToolCallType TOOL_CALL_STATUS_IN_PROGRESS: ToolCallStatus TOOL_CALL_STATUS_COMPLETED: ToolCallStatus TOOL_CALL_STATUS_INCOMPLETE: ToolCallStatus @@ -439,7 +441,7 @@ class ToolChoice(_message.Message): def __init__(self, mode: _Optional[_Union[ToolMode, str]] = ..., function_name: _Optional[str] = ...) -> None: ... class Tool(_message.Message): - __slots__ = ("function", "web_search", "x_search", "code_execution", "collections_search", "mcp", "attachment_search") + __slots__ = ("function", "web_search", "x_search", "code_execution", "collections_search", "mcp", "attachment_search", "image_generation") FUNCTION_FIELD_NUMBER: _ClassVar[int] WEB_SEARCH_FIELD_NUMBER: _ClassVar[int] X_SEARCH_FIELD_NUMBER: _ClassVar[int] @@ -447,6 +449,7 @@ class Tool(_message.Message): COLLECTIONS_SEARCH_FIELD_NUMBER: _ClassVar[int] MCP_FIELD_NUMBER: _ClassVar[int] ATTACHMENT_SEARCH_FIELD_NUMBER: _ClassVar[int] + IMAGE_GENERATION_FIELD_NUMBER: _ClassVar[int] function: Function web_search: WebSearch x_search: XSearch @@ -454,7 +457,8 @@ class Tool(_message.Message): collections_search: CollectionsSearch mcp: MCP attachment_search: AttachmentSearch - def __init__(self, function: _Optional[_Union[Function, _Mapping]] = ..., web_search: _Optional[_Union[WebSearch, _Mapping]] = ..., x_search: _Optional[_Union[XSearch, _Mapping]] = ..., code_execution: _Optional[_Union[CodeExecution, _Mapping]] = ..., collections_search: _Optional[_Union[CollectionsSearch, _Mapping]] = ..., mcp: _Optional[_Union[MCP, _Mapping]] = ..., attachment_search: _Optional[_Union[AttachmentSearch, _Mapping]] = ...) -> None: ... + image_generation: ImageGeneration + def __init__(self, function: _Optional[_Union[Function, _Mapping]] = ..., web_search: _Optional[_Union[WebSearch, _Mapping]] = ..., x_search: _Optional[_Union[XSearch, _Mapping]] = ..., code_execution: _Optional[_Union[CodeExecution, _Mapping]] = ..., collections_search: _Optional[_Union[CollectionsSearch, _Mapping]] = ..., mcp: _Optional[_Union[MCP, _Mapping]] = ..., attachment_search: _Optional[_Union[AttachmentSearch, _Mapping]] = ..., image_generation: _Optional[_Union[ImageGeneration, _Mapping]] = ...) -> None: ... class MCP(_message.Message): __slots__ = ("server_label", "server_description", "server_url", "allowed_tool_names", "authorization", "extra_headers") @@ -525,6 +529,12 @@ class CodeExecution(_message.Message): __slots__ = () def __init__(self) -> None: ... +class ImageGeneration(_message.Message): + __slots__ = ("action",) + ACTION_FIELD_NUMBER: _ClassVar[int] + action: str + def __init__(self, action: _Optional[str] = ...) -> None: ... + class CollectionsSearch(_message.Message): __slots__ = ("collection_ids", "limit", "instructions", "hybrid_retrieval", "semantic_retrieval", "keyword_retrieval") COLLECTION_IDS_FIELD_NUMBER: _ClassVar[int] diff --git a/src/xai_sdk/proto/v6/chat_pb2_grpc.py b/src/xai_sdk/proto/v6/chat_pb2_grpc.py index 2aa8e2d..c43beaf 100644 --- a/src/xai_sdk/proto/v6/chat_pb2_grpc.py +++ b/src/xai_sdk/proto/v6/chat_pb2_grpc.py @@ -104,10 +104,10 @@ def DeleteStoredCompletion(self, request, context): raise NotImplementedError('Method not implemented!') def CompactContext(self, request, context): - """Compacts a full responses input context and returns a compacted context. + """Compacts a full input context and returns a compacted context. The client sends the current input items and receives back a compacted - set of items (with an opaque compaction summary) suitable for use as - the input to the next /v1/responses call. + set of items (with an opaque compaction blob) suitable for use as + the input to the next request. """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') diff --git a/src/xai_sdk/proto/v6/image_pb2.py b/src/xai_sdk/proto/v6/image_pb2.py index f52ee6c..e84ca0d 100644 --- a/src/xai_sdk/proto/v6/image_pb2.py +++ b/src/xai_sdk/proto/v6/image_pb2.py @@ -26,7 +26,7 @@ from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/image.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16xai/api/v1/usage.proto\"\x84\x04\n\x14GenerateImageRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x05 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x11\n\x01n\x18\x03 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\x12\n\x04user\x18\x04 \x01(\tR\x04user\x12,\n\x06\x66ormat\x18\x0b \x01(\x0e\x32\x14.xai_api.ImageFormatR\x06\x66ormat\x12\x41\n\x0c\x61spect_ratio\x18\x0e \x01(\x0e\x32\x19.xai_api.ImageAspectRatioH\x01R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x0f \x01(\x0e\x32\x18.xai_api.ImageResolutionH\x02R\nresolution\x88\x01\x01\x12\x30\n\x06images\x18\x11 \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x06images\x12\x45\n\x0fstorage_options\x18\x13 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x03R\x0estorageOptions\x88\x01\x01\x42\x04\n\x02_nB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_optionsJ\x04\x08\r\x10\x0e\"\xb6\x01\n\x0eStorageOptions\x12\x1a\n\x08\x66ilename\x18\x01 \x01(\tR\x08\x66ilename\x12(\n\rexpires_after\x18\x02 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x12=\n\npublic_url\x18\x03 \x01(\x0b\x32\x19.xai_api.PublicUrlOptionsH\x01R\tpublicUrl\x88\x01\x01\x42\x10\n\x0e_expires_afterB\r\n\x0b_public_url\"N\n\x10PublicUrlOptions\x12(\n\rexpires_after\x18\x01 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x42\x10\n\x0e_expires_after\"\xfb\x02\n\nFileOutput\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x1a\n\x08\x66ilename\x18\x02 \x01(\tR\x08\x66ilename\x12\"\n\npublic_url\x18\x04 \x01(\tH\x00R\tpublicUrl\x88\x01\x01\x12R\n\x15public_url_expires_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x12publicUrlExpiresAt\x88\x01\x01\x12>\n\nexpires_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\texpiresAt\x88\x01\x01\x12-\n\x10public_url_error\x18\x07 \x01(\tH\x03R\x0epublicUrlError\x88\x01\x01\x42\r\n\x0b_public_urlB\x18\n\x16_public_url_expires_atB\r\n\x0b_expires_atB\x13\n\x11_public_url_errorJ\x04\x08\x03\x10\x04\"\x84\x01\n\rImageResponse\x12/\n\x06images\x18\x01 \x03(\x0b\x32\x17.xai_api.GeneratedImageR\x06images\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\"\x83\x02\n\x0eGeneratedImage\x12\x18\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00R\x06\x62\x61se64\x12\x12\n\x03url\x18\x03 \x01(\tH\x00R\x03url\x12-\n\x12respect_moderation\x18\x04 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x08 \x01(\x0b\x32\x13.xai_api.FileOutputH\x01R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\t \x01(\tH\x02R\x0cstorageError\x88\x01\x01\x42\x07\n\x05imageB\x0e\n\x0c_file_outputB\x10\n\x0e_storage_errorJ\x04\x08\x02\x10\x03\"\x83\x01\n\x0fImageUrlContent\x12\x1d\n\timage_url\x18\x01 \x01(\tH\x00R\x08imageUrl\x12\x19\n\x07\x66ile_id\x18\x03 \x01(\tH\x00R\x06\x66ileId\x12,\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailR\x06\x64\x65tailB\x08\n\x06source*S\n\x0bImageDetail\x12\x12\n\x0e\x44\x45TAIL_INVALID\x10\x00\x12\x0f\n\x0b\x44\x45TAIL_AUTO\x10\x01\x12\x0e\n\nDETAIL_LOW\x10\x02\x12\x0f\n\x0b\x44\x45TAIL_HIGH\x10\x03*P\n\x0bImageFormat\x12\x16\n\x12IMG_FORMAT_INVALID\x10\x00\x12\x15\n\x11IMG_FORMAT_BASE64\x10\x01\x12\x12\n\x0eIMG_FORMAT_URL\x10\x02*j\n\x0cImageQuality\x12\x17\n\x13IMG_QUALITY_INVALID\x10\x00\x12\x13\n\x0fIMG_QUALITY_LOW\x10\x01\x12\x16\n\x12IMG_QUALITY_MEDIUM\x10\x02\x12\x14\n\x10IMG_QUALITY_HIGH\x10\x03*\xa7\x03\n\x10ImageAspectRatio\x12\x1c\n\x18IMG_ASPECT_RATIO_INVALID\x10\x00\x12\x18\n\x14IMG_ASPECT_RATIO_1_1\x10\x01\x12\x18\n\x14IMG_ASPECT_RATIO_3_4\x10\x02\x12\x18\n\x14IMG_ASPECT_RATIO_4_3\x10\x03\x12\x19\n\x15IMG_ASPECT_RATIO_9_16\x10\x04\x12\x19\n\x15IMG_ASPECT_RATIO_16_9\x10\x05\x12\x18\n\x14IMG_ASPECT_RATIO_2_3\x10\x06\x12\x18\n\x14IMG_ASPECT_RATIO_3_2\x10\x07\x12\x19\n\x15IMG_ASPECT_RATIO_AUTO\x10\x08\x12\x1b\n\x17IMG_ASPECT_RATIO_9_19_5\x10\t\x12\x1b\n\x17IMG_ASPECT_RATIO_19_5_9\x10\n\x12\x19\n\x15IMG_ASPECT_RATIO_9_20\x10\x0b\x12\x19\n\x15IMG_ASPECT_RATIO_20_9\x10\x0c\x12\x18\n\x14IMG_ASPECT_RATIO_1_2\x10\r\x12\x18\n\x14IMG_ASPECT_RATIO_2_1\x10\x0e*[\n\x0fImageResolution\x12\x1a\n\x16IMG_RESOLUTION_INVALID\x10\x00\x12\x15\n\x11IMG_RESOLUTION_1K\x10\x01\x12\x15\n\x11IMG_RESOLUTION_2K\x10\x02\x32Q\n\x05Image\x12H\n\rGenerateImage\x12\x1d.xai_api.GenerateImageRequest\x1a\x16.xai_api.ImageResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nImageProtoP\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\x16xai/api/v1/image.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x16xai/api/v1/usage.proto\"\xc6\x04\n\x14GenerateImageRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x05 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12\x11\n\x01n\x18\x03 \x01(\x05H\x00R\x01n\x88\x01\x01\x12\x12\n\x04user\x18\x04 \x01(\tR\x04user\x12,\n\x06\x66ormat\x18\x0b \x01(\x0e\x32\x14.xai_api.ImageFormatR\x06\x66ormat\x12\x34\n\x07quality\x18\x0c \x01(\x0e\x32\x15.xai_api.ImageQualityH\x01R\x07quality\x88\x01\x01\x12\x41\n\x0c\x61spect_ratio\x18\x0e \x01(\x0e\x32\x19.xai_api.ImageAspectRatioH\x02R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x0f \x01(\x0e\x32\x18.xai_api.ImageResolutionH\x03R\nresolution\x88\x01\x01\x12\x30\n\x06images\x18\x11 \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x06images\x12\x45\n\x0fstorage_options\x18\x13 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x04R\x0estorageOptions\x88\x01\x01\x42\x04\n\x02_nB\n\n\x08_qualityB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_optionsJ\x04\x08\r\x10\x0e\"\xb6\x01\n\x0eStorageOptions\x12\x1a\n\x08\x66ilename\x18\x01 \x01(\tR\x08\x66ilename\x12(\n\rexpires_after\x18\x02 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x12=\n\npublic_url\x18\x03 \x01(\x0b\x32\x19.xai_api.PublicUrlOptionsH\x01R\tpublicUrl\x88\x01\x01\x42\x10\n\x0e_expires_afterB\r\n\x0b_public_url\"N\n\x10PublicUrlOptions\x12(\n\rexpires_after\x18\x01 \x01(\x03H\x00R\x0c\x65xpiresAfter\x88\x01\x01\x42\x10\n\x0e_expires_after\"\xfb\x02\n\nFileOutput\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x1a\n\x08\x66ilename\x18\x02 \x01(\tR\x08\x66ilename\x12\"\n\npublic_url\x18\x04 \x01(\tH\x00R\tpublicUrl\x88\x01\x01\x12R\n\x15public_url_expires_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01R\x12publicUrlExpiresAt\x88\x01\x01\x12>\n\nexpires_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02R\texpiresAt\x88\x01\x01\x12-\n\x10public_url_error\x18\x07 \x01(\tH\x03R\x0epublicUrlError\x88\x01\x01\x42\r\n\x0b_public_urlB\x18\n\x16_public_url_expires_atB\r\n\x0b_expires_atB\x13\n\x11_public_url_errorJ\x04\x08\x03\x10\x04\"\x84\x01\n\rImageResponse\x12/\n\x06images\x18\x01 \x03(\x0b\x32\x17.xai_api.GeneratedImageR\x06images\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\"\x83\x02\n\x0eGeneratedImage\x12\x18\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00R\x06\x62\x61se64\x12\x12\n\x03url\x18\x03 \x01(\tH\x00R\x03url\x12-\n\x12respect_moderation\x18\x04 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x08 \x01(\x0b\x32\x13.xai_api.FileOutputH\x01R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\t \x01(\tH\x02R\x0cstorageError\x88\x01\x01\x42\x07\n\x05imageB\x0e\n\x0c_file_outputB\x10\n\x0e_storage_errorJ\x04\x08\x02\x10\x03\"\x83\x01\n\x0fImageUrlContent\x12\x1d\n\timage_url\x18\x01 \x01(\tH\x00R\x08imageUrl\x12\x19\n\x07\x66ile_id\x18\x03 \x01(\tH\x00R\x06\x66ileId\x12,\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailR\x06\x64\x65tailB\x08\n\x06source*S\n\x0bImageDetail\x12\x12\n\x0e\x44\x45TAIL_INVALID\x10\x00\x12\x0f\n\x0b\x44\x45TAIL_AUTO\x10\x01\x12\x0e\n\nDETAIL_LOW\x10\x02\x12\x0f\n\x0b\x44\x45TAIL_HIGH\x10\x03*P\n\x0bImageFormat\x12\x16\n\x12IMG_FORMAT_INVALID\x10\x00\x12\x15\n\x11IMG_FORMAT_BASE64\x10\x01\x12\x12\n\x0eIMG_FORMAT_URL\x10\x02*j\n\x0cImageQuality\x12\x17\n\x13IMG_QUALITY_INVALID\x10\x00\x12\x13\n\x0fIMG_QUALITY_LOW\x10\x01\x12\x16\n\x12IMG_QUALITY_MEDIUM\x10\x02\x12\x14\n\x10IMG_QUALITY_HIGH\x10\x03*\xa7\x03\n\x10ImageAspectRatio\x12\x1c\n\x18IMG_ASPECT_RATIO_INVALID\x10\x00\x12\x18\n\x14IMG_ASPECT_RATIO_1_1\x10\x01\x12\x18\n\x14IMG_ASPECT_RATIO_3_4\x10\x02\x12\x18\n\x14IMG_ASPECT_RATIO_4_3\x10\x03\x12\x19\n\x15IMG_ASPECT_RATIO_9_16\x10\x04\x12\x19\n\x15IMG_ASPECT_RATIO_16_9\x10\x05\x12\x18\n\x14IMG_ASPECT_RATIO_2_3\x10\x06\x12\x18\n\x14IMG_ASPECT_RATIO_3_2\x10\x07\x12\x19\n\x15IMG_ASPECT_RATIO_AUTO\x10\x08\x12\x1b\n\x17IMG_ASPECT_RATIO_9_19_5\x10\t\x12\x1b\n\x17IMG_ASPECT_RATIO_19_5_9\x10\n\x12\x19\n\x15IMG_ASPECT_RATIO_9_20\x10\x0b\x12\x19\n\x15IMG_ASPECT_RATIO_20_9\x10\x0c\x12\x18\n\x14IMG_ASPECT_RATIO_1_2\x10\r\x12\x18\n\x14IMG_ASPECT_RATIO_2_1\x10\x0e*[\n\x0fImageResolution\x12\x1a\n\x16IMG_RESOLUTION_INVALID\x10\x00\x12\x15\n\x11IMG_RESOLUTION_1K\x10\x01\x12\x15\n\x11IMG_RESOLUTION_2K\x10\x02\x32Q\n\x05Image\x12H\n\rGenerateImage\x12\x1d.xai_api.GenerateImageRequest\x1a\x16.xai_api.ImageResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nImageProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -34,30 +34,30 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\nImageProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_IMAGEDETAIL']._serialized_start=1789 - _globals['_IMAGEDETAIL']._serialized_end=1872 - _globals['_IMAGEFORMAT']._serialized_start=1874 - _globals['_IMAGEFORMAT']._serialized_end=1954 - _globals['_IMAGEQUALITY']._serialized_start=1956 - _globals['_IMAGEQUALITY']._serialized_end=2062 - _globals['_IMAGEASPECTRATIO']._serialized_start=2065 - _globals['_IMAGEASPECTRATIO']._serialized_end=2488 - _globals['_IMAGERESOLUTION']._serialized_start=2490 - _globals['_IMAGERESOLUTION']._serialized_end=2581 + _globals['_IMAGEDETAIL']._serialized_start=1855 + _globals['_IMAGEDETAIL']._serialized_end=1938 + _globals['_IMAGEFORMAT']._serialized_start=1940 + _globals['_IMAGEFORMAT']._serialized_end=2020 + _globals['_IMAGEQUALITY']._serialized_start=2022 + _globals['_IMAGEQUALITY']._serialized_end=2128 + _globals['_IMAGEASPECTRATIO']._serialized_start=2131 + _globals['_IMAGEASPECTRATIO']._serialized_end=2554 + _globals['_IMAGERESOLUTION']._serialized_start=2556 + _globals['_IMAGERESOLUTION']._serialized_end=2647 _globals['_GENERATEIMAGEREQUEST']._serialized_start=93 - _globals['_GENERATEIMAGEREQUEST']._serialized_end=609 - _globals['_STORAGEOPTIONS']._serialized_start=612 - _globals['_STORAGEOPTIONS']._serialized_end=794 - _globals['_PUBLICURLOPTIONS']._serialized_start=796 - _globals['_PUBLICURLOPTIONS']._serialized_end=874 - _globals['_FILEOUTPUT']._serialized_start=877 - _globals['_FILEOUTPUT']._serialized_end=1256 - _globals['_IMAGERESPONSE']._serialized_start=1259 - _globals['_IMAGERESPONSE']._serialized_end=1391 - _globals['_GENERATEDIMAGE']._serialized_start=1394 - _globals['_GENERATEDIMAGE']._serialized_end=1653 - _globals['_IMAGEURLCONTENT']._serialized_start=1656 - _globals['_IMAGEURLCONTENT']._serialized_end=1787 - _globals['_IMAGE']._serialized_start=2583 - _globals['_IMAGE']._serialized_end=2664 + _globals['_GENERATEIMAGEREQUEST']._serialized_end=675 + _globals['_STORAGEOPTIONS']._serialized_start=678 + _globals['_STORAGEOPTIONS']._serialized_end=860 + _globals['_PUBLICURLOPTIONS']._serialized_start=862 + _globals['_PUBLICURLOPTIONS']._serialized_end=940 + _globals['_FILEOUTPUT']._serialized_start=943 + _globals['_FILEOUTPUT']._serialized_end=1322 + _globals['_IMAGERESPONSE']._serialized_start=1325 + _globals['_IMAGERESPONSE']._serialized_end=1457 + _globals['_GENERATEDIMAGE']._serialized_start=1460 + _globals['_GENERATEDIMAGE']._serialized_end=1719 + _globals['_IMAGEURLCONTENT']._serialized_start=1722 + _globals['_IMAGEURLCONTENT']._serialized_end=1853 + _globals['_IMAGE']._serialized_start=2649 + _globals['_IMAGE']._serialized_end=2730 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v6/image_pb2.pyi b/src/xai_sdk/proto/v6/image_pb2.pyi index 97a504f..8601daf 100644 --- a/src/xai_sdk/proto/v6/image_pb2.pyi +++ b/src/xai_sdk/proto/v6/image_pb2.pyi @@ -83,13 +83,14 @@ IMG_RESOLUTION_1K: ImageResolution IMG_RESOLUTION_2K: ImageResolution class GenerateImageRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "n", "user", "format", "aspect_ratio", "resolution", "images", "storage_options") + __slots__ = ("prompt", "image", "model", "n", "user", "format", "quality", "aspect_ratio", "resolution", "images", "storage_options") PROMPT_FIELD_NUMBER: _ClassVar[int] IMAGE_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] N_FIELD_NUMBER: _ClassVar[int] USER_FIELD_NUMBER: _ClassVar[int] FORMAT_FIELD_NUMBER: _ClassVar[int] + QUALITY_FIELD_NUMBER: _ClassVar[int] ASPECT_RATIO_FIELD_NUMBER: _ClassVar[int] RESOLUTION_FIELD_NUMBER: _ClassVar[int] IMAGES_FIELD_NUMBER: _ClassVar[int] @@ -100,11 +101,12 @@ class GenerateImageRequest(_message.Message): n: int user: str format: ImageFormat + quality: ImageQuality aspect_ratio: ImageAspectRatio resolution: ImageResolution images: _containers.RepeatedCompositeFieldContainer[ImageUrlContent] storage_options: StorageOptions - def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., n: _Optional[int] = ..., user: _Optional[str] = ..., format: _Optional[_Union[ImageFormat, str]] = ..., aspect_ratio: _Optional[_Union[ImageAspectRatio, str]] = ..., resolution: _Optional[_Union[ImageResolution, str]] = ..., images: _Optional[_Iterable[_Union[ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[StorageOptions, _Mapping]] = ...) -> None: ... + def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., n: _Optional[int] = ..., user: _Optional[str] = ..., format: _Optional[_Union[ImageFormat, str]] = ..., quality: _Optional[_Union[ImageQuality, str]] = ..., aspect_ratio: _Optional[_Union[ImageAspectRatio, str]] = ..., resolution: _Optional[_Union[ImageResolution, str]] = ..., images: _Optional[_Iterable[_Union[ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[StorageOptions, _Mapping]] = ...) -> None: ... class StorageOptions(_message.Message): __slots__ = ("filename", "expires_after", "public_url") diff --git a/src/xai_sdk/proto/v6/usage_pb2.py b/src/xai_sdk/proto/v6/usage_pb2.py index 353289b..2732ac4 100644 --- a/src/xai_sdk/proto/v6/usage_pb2.py +++ b/src/xai_sdk/proto/v6/usage_pb2.py @@ -24,7 +24,7 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/usage.proto\x12\x07xai_api\"\x86\x04\n\rSamplingUsage\x12+\n\x11\x63ompletion_tokens\x18\x01 \x01(\x05R\x10\x63ompletionTokens\x12)\n\x10reasoning_tokens\x18\x06 \x01(\x05R\x0freasoningTokens\x12#\n\rprompt_tokens\x18\x02 \x01(\x05R\x0cpromptTokens\x12!\n\x0ctotal_tokens\x18\x03 \x01(\x05R\x0btotalTokens\x12,\n\x12prompt_text_tokens\x18\x04 \x01(\x05R\x10promptTextTokens\x12\x39\n\x19\x63\x61\x63hed_prompt_text_tokens\x18\x07 \x01(\x05R\x16\x63\x61\x63hedPromptTextTokens\x12.\n\x13prompt_image_tokens\x18\x05 \x01(\x05R\x11promptImageTokens\x12(\n\x10num_sources_used\x18\x08 \x01(\x05R\x0enumSourcesUsed\x12L\n\x16server_side_tools_used\x18\t \x03(\x0e\x32\x17.xai_api.ServerSideToolR\x13serverSideToolsUsed\x12.\n\x11\x63ost_in_usd_ticks\x18\x0b \x01(\x03H\x00R\x0e\x63ostInUsdTicks\x88\x01\x01\x42\x14\n\x12_cost_in_usd_ticks\"r\n\x0e\x45mbeddingUsage\x12.\n\x13num_text_embeddings\x18\x01 \x01(\x05R\x11numTextEmbeddings\x12\x30\n\x14num_image_embeddings\x18\x02 \x01(\x05R\x12numImageEmbeddings*`\n\x0bServiceTier\x12\x1c\n\x18SERVICE_TIER_UNSPECIFIED\x10\x00\x12\x18\n\x14SERVICE_TIER_DEFAULT\x10\x01\x12\x19\n\x15SERVICE_TIER_PRIORITY\x10\x02*\xe5\x02\n\x0eServerSideTool\x12\x1c\n\x18SERVER_SIDE_TOOL_INVALID\x10\x00\x12\x1f\n\x1bSERVER_SIDE_TOOL_WEB_SEARCH\x10\x01\x12\x1d\n\x19SERVER_SIDE_TOOL_X_SEARCH\x10\x02\x12#\n\x1fSERVER_SIDE_TOOL_CODE_EXECUTION\x10\x03\x12\x1f\n\x1bSERVER_SIDE_TOOL_VIEW_IMAGE\x10\x04\x12!\n\x1dSERVER_SIDE_TOOL_VIEW_X_VIDEO\x10\x05\x12\'\n#SERVER_SIDE_TOOL_COLLECTIONS_SEARCH\x10\x06\x12\x18\n\x14SERVER_SIDE_TOOL_MCP\x10\x07\x12&\n\"SERVER_SIDE_TOOL_ATTACHMENT_SEARCH\x10\x08\x12!\n\x1dSERVER_SIDE_TOOL_IMAGE_SEARCH\x10\nBQ\n\x0b\x63om.xai_apiB\nUsageProtoP\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\x16xai/api/v1/usage.proto\x12\x07xai_api\"\x86\x04\n\rSamplingUsage\x12+\n\x11\x63ompletion_tokens\x18\x01 \x01(\x05R\x10\x63ompletionTokens\x12)\n\x10reasoning_tokens\x18\x06 \x01(\x05R\x0freasoningTokens\x12#\n\rprompt_tokens\x18\x02 \x01(\x05R\x0cpromptTokens\x12!\n\x0ctotal_tokens\x18\x03 \x01(\x05R\x0btotalTokens\x12,\n\x12prompt_text_tokens\x18\x04 \x01(\x05R\x10promptTextTokens\x12\x39\n\x19\x63\x61\x63hed_prompt_text_tokens\x18\x07 \x01(\x05R\x16\x63\x61\x63hedPromptTextTokens\x12.\n\x13prompt_image_tokens\x18\x05 \x01(\x05R\x11promptImageTokens\x12(\n\x10num_sources_used\x18\x08 \x01(\x05R\x0enumSourcesUsed\x12L\n\x16server_side_tools_used\x18\t \x03(\x0e\x32\x17.xai_api.ServerSideToolR\x13serverSideToolsUsed\x12.\n\x11\x63ost_in_usd_ticks\x18\x0b \x01(\x03H\x00R\x0e\x63ostInUsdTicks\x88\x01\x01\x42\x14\n\x12_cost_in_usd_ticks\"r\n\x0e\x45mbeddingUsage\x12.\n\x13num_text_embeddings\x18\x01 \x01(\x05R\x11numTextEmbeddings\x12\x30\n\x14num_image_embeddings\x18\x02 \x01(\x05R\x12numImageEmbeddings*`\n\x0bServiceTier\x12\x1c\n\x18SERVICE_TIER_UNSPECIFIED\x10\x00\x12\x18\n\x14SERVICE_TIER_DEFAULT\x10\x01\x12\x19\n\x15SERVICE_TIER_PRIORITY\x10\x02*\x8c\x03\n\x0eServerSideTool\x12\x1c\n\x18SERVER_SIDE_TOOL_INVALID\x10\x00\x12\x1f\n\x1bSERVER_SIDE_TOOL_WEB_SEARCH\x10\x01\x12\x1d\n\x19SERVER_SIDE_TOOL_X_SEARCH\x10\x02\x12#\n\x1fSERVER_SIDE_TOOL_CODE_EXECUTION\x10\x03\x12\x1f\n\x1bSERVER_SIDE_TOOL_VIEW_IMAGE\x10\x04\x12!\n\x1dSERVER_SIDE_TOOL_VIEW_X_VIDEO\x10\x05\x12\'\n#SERVER_SIDE_TOOL_COLLECTIONS_SEARCH\x10\x06\x12\x18\n\x14SERVER_SIDE_TOOL_MCP\x10\x07\x12&\n\"SERVER_SIDE_TOOL_ATTACHMENT_SEARCH\x10\x08\x12!\n\x1dSERVER_SIDE_TOOL_IMAGE_SEARCH\x10\n\x12%\n!SERVER_SIDE_TOOL_IMAGE_GENERATION\x10\x0b\x42Q\n\x0b\x63om.xai_apiB\nUsageProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,7 +35,7 @@ _globals['_SERVICETIER']._serialized_start=672 _globals['_SERVICETIER']._serialized_end=768 _globals['_SERVERSIDETOOL']._serialized_start=771 - _globals['_SERVERSIDETOOL']._serialized_end=1128 + _globals['_SERVERSIDETOOL']._serialized_end=1167 _globals['_SAMPLINGUSAGE']._serialized_start=36 _globals['_SAMPLINGUSAGE']._serialized_end=554 _globals['_EMBEDDINGUSAGE']._serialized_start=556 diff --git a/src/xai_sdk/proto/v6/usage_pb2.pyi b/src/xai_sdk/proto/v6/usage_pb2.pyi index 418ff90..97e794b 100644 --- a/src/xai_sdk/proto/v6/usage_pb2.pyi +++ b/src/xai_sdk/proto/v6/usage_pb2.pyi @@ -25,6 +25,7 @@ class ServerSideTool(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): SERVER_SIDE_TOOL_MCP: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_IMAGE_SEARCH: _ClassVar[ServerSideTool] + SERVER_SIDE_TOOL_IMAGE_GENERATION: _ClassVar[ServerSideTool] SERVICE_TIER_UNSPECIFIED: ServiceTier SERVICE_TIER_DEFAULT: ServiceTier SERVICE_TIER_PRIORITY: ServiceTier @@ -38,6 +39,7 @@ SERVER_SIDE_TOOL_COLLECTIONS_SEARCH: ServerSideTool SERVER_SIDE_TOOL_MCP: ServerSideTool SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: ServerSideTool SERVER_SIDE_TOOL_IMAGE_SEARCH: ServerSideTool +SERVER_SIDE_TOOL_IMAGE_GENERATION: ServerSideTool class SamplingUsage(_message.Message): __slots__ = ("completion_tokens", "reasoning_tokens", "prompt_tokens", "total_tokens", "prompt_text_tokens", "cached_prompt_text_tokens", "prompt_image_tokens", "num_sources_used", "server_side_tools_used", "cost_in_usd_ticks") diff --git a/src/xai_sdk/proto/v6/video_pb2.py b/src/xai_sdk/proto/v6/video_pb2.py index 7f9f335..5689d51 100644 --- a/src/xai_sdk/proto/v6/video_pb2.py +++ b/src/xai_sdk/proto/v6/video_pb2.py @@ -27,7 +27,7 @@ from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/video.proto\x12\x07xai_api\x1a\x19xai/api/v1/deferred.proto\x1a\x16xai/api/v1/image.proto\x1a\x16xai/api/v1/usage.proto\"J\n\x0fVideoUrlContent\x12\x12\n\x03url\x18\x01 \x01(\tH\x00R\x03url\x12\x19\n\x07\x66ile_id\x18\x02 \x01(\tH\x00R\x06\x66ileIdB\x08\n\x06source\"\x94\x04\n\x14GenerateVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12.\n\x05video\x18\x06 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x41\n\x0c\x61spect_ratio\x18\x07 \x01(\x0e\x32\x19.xai_api.VideoAspectRatioH\x01R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x08 \x01(\x0e\x32\x18.xai_api.VideoResolutionH\x02R\nresolution\x88\x01\x01\x12\x43\n\x10reference_images\x18\r \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x0freferenceImages\x12\x45\n\x0fstorage_options\x18\x0e \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x03R\x0estorageOptions\x88\x01\x01\x42\x0b\n\t_durationB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_options\"8\n\x17GetDeferredVideoRequest\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\"\xd8\x01\n\rVideoResponse\x12-\n\x05video\x18\x01 \x01(\x0b\x32\x17.xai_api.GeneratedVideoR\x05video\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12.\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x13.xai_api.VideoErrorH\x00R\x05\x65rror\x88\x01\x01\x12\x1a\n\x08progress\x18\x07 \x01(\x05R\x08progressB\x08\n\x06_error\"\xf4\x01\n\x0eGeneratedVideo\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\x12\x1a\n\x08\x64uration\x18\x04 \x01(\x05R\x08\x64uration\x12-\n\x12respect_moderation\x18\x05 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x06 \x01(\x0b\x32\x13.xai_api.FileOutputH\x00R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\x07 \x01(\tH\x01R\x0cstorageError\x88\x01\x01\x42\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"\x91\x01\n\x18GetDeferredVideoResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x37\n\x08response\x18\x02 \x01(\x0b\x32\x16.xai_api.VideoResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\":\n\nVideoError\x12\x12\n\x04\x63ode\x18\x01 \x01(\tR\x04\x63ode\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\"\xfb\x01\n\x12\x45xtendVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05video\x18\x02 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12\x45\n\x0fstorage_options\x18\x06 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x01R\x0estorageOptions\x88\x01\x01\x42\x0b\n\t_durationB\x12\n\x10_storage_options*\xfc\x01\n\x10VideoAspectRatio\x12\"\n\x1eVIDEO_ASPECT_RATIO_UNSPECIFIED\x10\x00\x12\x1a\n\x16VIDEO_ASPECT_RATIO_1_1\x10\x01\x12\x1b\n\x17VIDEO_ASPECT_RATIO_16_9\x10\x02\x12\x1b\n\x17VIDEO_ASPECT_RATIO_9_16\x10\x03\x12\x1a\n\x16VIDEO_ASPECT_RATIO_4_3\x10\x04\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_4\x10\x05\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_2\x10\x06\x12\x1a\n\x16VIDEO_ASPECT_RATIO_2_3\x10\x07*i\n\x0fVideoResolution\x12 \n\x1cVIDEO_RESOLUTION_UNSPECIFIED\x10\x00\x12\x19\n\x15VIDEO_RESOLUTION_480P\x10\x01\x12\x19\n\x15VIDEO_RESOLUTION_720P\x10\x02\x32\x82\x02\n\x05Video\x12P\n\rGenerateVideo\x12\x1d.xai_api.GenerateVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12L\n\x0b\x45xtendVideo\x12\x1b.xai_api.ExtendVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12Y\n\x10GetDeferredVideo\x12 .xai_api.GetDeferredVideoRequest\x1a!.xai_api.GetDeferredVideoResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nVideoProtoP\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\x16xai/api/v1/video.proto\x12\x07xai_api\x1a\x19xai/api/v1/deferred.proto\x1a\x16xai/api/v1/image.proto\x1a\x16xai/api/v1/usage.proto\"J\n\x0fVideoUrlContent\x12\x12\n\x03url\x18\x01 \x01(\tH\x00R\x03url\x12\x19\n\x07\x66ile_id\x18\x02 \x01(\tH\x00R\x06\x66ileIdB\x08\n\x06source\">\n\x0f\x41udioUrlContent\x12\x1b\n\x08voice_id\x18\x02 \x01(\tH\x00R\x07voiceIdB\x08\n\x06sourceJ\x04\x08\x01\x10\x02\"\x9e\x05\n\x14GenerateVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05image\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentR\x05image\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12.\n\x05video\x18\x06 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x41\n\x0c\x61spect_ratio\x18\x07 \x01(\x0e\x32\x19.xai_api.VideoAspectRatioH\x01R\x0b\x61spectRatio\x88\x01\x01\x12=\n\nresolution\x18\x08 \x01(\x0e\x32\x18.xai_api.VideoResolutionH\x02R\nresolution\x88\x01\x01\x12\x43\n\x10reference_images\x18\r \x03(\x0b\x32\x18.xai_api.ImageUrlContentR\x0freferenceImages\x12\x45\n\x0fstorage_options\x18\x0e \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x03R\x0estorageOptions\x88\x01\x01\x12\x43\n\x10reference_audios\x18\x10 \x03(\x0b\x32\x18.xai_api.AudioUrlContentR\x0freferenceAudios\x12*\n\x0egenerate_audio\x18\x11 \x01(\x08H\x04R\rgenerateAudio\x88\x01\x01\x42\x0b\n\t_durationB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\x12\n\x10_storage_optionsB\x11\n\x0f_generate_audioJ\x04\x08\x0f\x10\x10\"8\n\x17GetDeferredVideoRequest\x12\x1d\n\nrequest_id\x18\x01 \x01(\tR\trequestId\"\xd8\x01\n\rVideoResponse\x12-\n\x05video\x18\x01 \x01(\x0b\x32\x17.xai_api.GeneratedVideoR\x05video\x12\x14\n\x05model\x18\x02 \x01(\tR\x05model\x12,\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12.\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x13.xai_api.VideoErrorH\x00R\x05\x65rror\x88\x01\x01\x12\x1a\n\x08progress\x18\x07 \x01(\x05R\x08progressB\x08\n\x06_error\"\xf4\x01\n\x0eGeneratedVideo\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\x12\x1a\n\x08\x64uration\x18\x04 \x01(\x05R\x08\x64uration\x12-\n\x12respect_moderation\x18\x05 \x01(\x08R\x11respectModeration\x12\x39\n\x0b\x66ile_output\x18\x06 \x01(\x0b\x32\x13.xai_api.FileOutputH\x00R\nfileOutput\x88\x01\x01\x12(\n\rstorage_error\x18\x07 \x01(\tH\x01R\x0cstorageError\x88\x01\x01\x42\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"\x91\x01\n\x18GetDeferredVideoResponse\x12/\n\x06status\x18\x01 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x37\n\x08response\x18\x02 \x01(\x0b\x32\x16.xai_api.VideoResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\":\n\nVideoError\x12\x12\n\x04\x63ode\x18\x01 \x01(\tR\x04\x63ode\x12\x18\n\x07message\x18\x02 \x01(\tR\x07message\"\x81\x02\n\x12\x45xtendVideoRequest\x12\x16\n\x06prompt\x18\x01 \x01(\tR\x06prompt\x12.\n\x05video\x18\x02 \x01(\x0b\x32\x18.xai_api.VideoUrlContentR\x05video\x12\x14\n\x05model\x18\x03 \x01(\tR\x05model\x12\x1f\n\x08\x64uration\x18\x04 \x01(\x05H\x00R\x08\x64uration\x88\x01\x01\x12\x45\n\x0fstorage_options\x18\x06 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x01R\x0estorageOptions\x88\x01\x01\x42\x0b\n\t_durationB\x12\n\x10_storage_optionsJ\x04\x08\x07\x10\x08*\xfc\x01\n\x10VideoAspectRatio\x12\"\n\x1eVIDEO_ASPECT_RATIO_UNSPECIFIED\x10\x00\x12\x1a\n\x16VIDEO_ASPECT_RATIO_1_1\x10\x01\x12\x1b\n\x17VIDEO_ASPECT_RATIO_16_9\x10\x02\x12\x1b\n\x17VIDEO_ASPECT_RATIO_9_16\x10\x03\x12\x1a\n\x16VIDEO_ASPECT_RATIO_4_3\x10\x04\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_4\x10\x05\x12\x1a\n\x16VIDEO_ASPECT_RATIO_3_2\x10\x06\x12\x1a\n\x16VIDEO_ASPECT_RATIO_2_3\x10\x07*i\n\x0fVideoResolution\x12 \n\x1cVIDEO_RESOLUTION_UNSPECIFIED\x10\x00\x12\x19\n\x15VIDEO_RESOLUTION_480P\x10\x01\x12\x19\n\x15VIDEO_RESOLUTION_720P\x10\x02\x32\x82\x02\n\x05Video\x12P\n\rGenerateVideo\x12\x1d.xai_api.GenerateVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12L\n\x0b\x45xtendVideo\x12\x1b.xai_api.ExtendVideoRequest\x1a\x1e.xai_api.StartDeferredResponse\"\x00\x12Y\n\x10GetDeferredVideo\x12 .xai_api.GetDeferredVideoRequest\x1a!.xai_api.GetDeferredVideoResponse\"\x00\x42Q\n\x0b\x63om.xai_apiB\nVideoProtoP\x01\xa2\x02\x03XXX\xaa\x02\x06XaiApi\xca\x02\x06XaiApi\xe2\x02\x12XaiApi\\GPBMetadata\xea\x02\x06XaiApib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) @@ -35,26 +35,28 @@ if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\nVideoProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_VIDEOASPECTRATIO']._serialized_start=1708 - _globals['_VIDEOASPECTRATIO']._serialized_end=1960 - _globals['_VIDEORESOLUTION']._serialized_start=1962 - _globals['_VIDEORESOLUTION']._serialized_end=2067 + _globals['_VIDEOASPECTRATIO']._serialized_start=1916 + _globals['_VIDEOASPECTRATIO']._serialized_end=2168 + _globals['_VIDEORESOLUTION']._serialized_start=2170 + _globals['_VIDEORESOLUTION']._serialized_end=2275 _globals['_VIDEOURLCONTENT']._serialized_start=110 _globals['_VIDEOURLCONTENT']._serialized_end=184 - _globals['_GENERATEVIDEOREQUEST']._serialized_start=187 - _globals['_GENERATEVIDEOREQUEST']._serialized_end=719 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=721 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=777 - _globals['_VIDEORESPONSE']._serialized_start=780 - _globals['_VIDEORESPONSE']._serialized_end=996 - _globals['_GENERATEDVIDEO']._serialized_start=999 - _globals['_GENERATEDVIDEO']._serialized_end=1243 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=1246 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1391 - _globals['_VIDEOERROR']._serialized_start=1393 - _globals['_VIDEOERROR']._serialized_end=1451 - _globals['_EXTENDVIDEOREQUEST']._serialized_start=1454 - _globals['_EXTENDVIDEOREQUEST']._serialized_end=1705 - _globals['_VIDEO']._serialized_start=2070 - _globals['_VIDEO']._serialized_end=2328 + _globals['_AUDIOURLCONTENT']._serialized_start=186 + _globals['_AUDIOURLCONTENT']._serialized_end=248 + _globals['_GENERATEVIDEOREQUEST']._serialized_start=251 + _globals['_GENERATEVIDEOREQUEST']._serialized_end=921 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=923 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=979 + _globals['_VIDEORESPONSE']._serialized_start=982 + _globals['_VIDEORESPONSE']._serialized_end=1198 + _globals['_GENERATEDVIDEO']._serialized_start=1201 + _globals['_GENERATEDVIDEO']._serialized_end=1445 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=1448 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1593 + _globals['_VIDEOERROR']._serialized_start=1595 + _globals['_VIDEOERROR']._serialized_end=1653 + _globals['_EXTENDVIDEOREQUEST']._serialized_start=1656 + _globals['_EXTENDVIDEOREQUEST']._serialized_end=1913 + _globals['_VIDEO']._serialized_start=2278 + _globals['_VIDEO']._serialized_end=2536 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v6/video_pb2.pyi b/src/xai_sdk/proto/v6/video_pb2.pyi index b8bd5a0..70bec33 100644 --- a/src/xai_sdk/proto/v6/video_pb2.pyi +++ b/src/xai_sdk/proto/v6/video_pb2.pyi @@ -46,8 +46,14 @@ class VideoUrlContent(_message.Message): file_id: str def __init__(self, url: _Optional[str] = ..., file_id: _Optional[str] = ...) -> None: ... +class AudioUrlContent(_message.Message): + __slots__ = ("voice_id",) + VOICE_ID_FIELD_NUMBER: _ClassVar[int] + voice_id: str + def __init__(self, voice_id: _Optional[str] = ...) -> None: ... + class GenerateVideoRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "duration", "video", "aspect_ratio", "resolution", "reference_images", "storage_options") + __slots__ = ("prompt", "image", "model", "duration", "video", "aspect_ratio", "resolution", "reference_images", "storage_options", "reference_audios", "generate_audio") PROMPT_FIELD_NUMBER: _ClassVar[int] IMAGE_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] @@ -57,6 +63,8 @@ class GenerateVideoRequest(_message.Message): RESOLUTION_FIELD_NUMBER: _ClassVar[int] REFERENCE_IMAGES_FIELD_NUMBER: _ClassVar[int] STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + REFERENCE_AUDIOS_FIELD_NUMBER: _ClassVar[int] + GENERATE_AUDIO_FIELD_NUMBER: _ClassVar[int] prompt: str image: _image_pb2.ImageUrlContent model: str @@ -66,7 +74,9 @@ class GenerateVideoRequest(_message.Message): resolution: VideoResolution reference_images: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUrlContent] storage_options: _image_pb2.StorageOptions - def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., aspect_ratio: _Optional[_Union[VideoAspectRatio, str]] = ..., resolution: _Optional[_Union[VideoResolution, str]] = ..., reference_images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ...) -> None: ... + reference_audios: _containers.RepeatedCompositeFieldContainer[AudioUrlContent] + generate_audio: bool + def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., aspect_ratio: _Optional[_Union[VideoAspectRatio, str]] = ..., resolution: _Optional[_Union[VideoResolution, str]] = ..., reference_images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ..., reference_audios: _Optional[_Iterable[_Union[AudioUrlContent, _Mapping]]] = ..., generate_audio: bool = ...) -> None: ... class GetDeferredVideoRequest(_message.Message): __slots__ = ("request_id",) diff --git a/src/xai_sdk/sync/image.py b/src/xai_sdk/sync/image.py index f25d333..6ce23d5 100644 --- a/src/xai_sdk/sync/image.py +++ b/src/xai_sdk/sync/image.py @@ -10,6 +10,7 @@ BaseImageResponse, ImageAspectRatio, ImageFormat, + ImageQuality, ImageResolution, _make_generate_request, _make_span_request_attributes, @@ -39,6 +40,7 @@ def prepare( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + quality: Optional[ImageQuality] = None, storage_options: Optional[Union[StorageOptions, image_pb2.StorageOptions]] = None, ) -> batch_pb2.BatchRequest: """Prepares an image generation request for batch processing. @@ -73,6 +75,10 @@ def prepare( image_format: The format of the image to return ("url" or "base64"). Defaults to "url". aspect_ratio: The aspect ratio of the image to generate. resolution: The image resolution to generate ("1k" or "2k"). + quality: Control generation quality with the optional quality + parameter. Allowed values are ``"low"`` and ``"medium"``. When + omitted, the default is ``"medium"``. The parameter is only + supported for ``grok-imagine-image-2.0``. storage_options: Persist the result to the Files API. Accepts a dict with a required ``filename`` and optional ``expires_after`` and ``public_url`` keys. Set ``public_url`` to also create a publicly shareable URL. @@ -124,6 +130,7 @@ def prepare( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + quality=quality, storage_options=storage_options, ) return batch_pb2.BatchRequest( @@ -144,6 +151,7 @@ def sample( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + quality: Optional[ImageQuality] = None, storage_options: Optional[Union[StorageOptions, image_pb2.StorageOptions]] = None, ) -> "ImageResponse": """Samples a single image based on the provided prompt. @@ -193,6 +201,10 @@ def sample( - `"1k"`: ~1 megapixel total. Dimensions vary by aspect ratio. - `"2k"`: ~4 megapixels total. Dimensions vary by aspect ratio. Only supported for grok-imagine models. + quality: Control generation quality with the optional quality + parameter. Allowed values are ``"low"`` and ``"medium"``. When + omitted, the default is ``"medium"``. The parameter is only + supported for ``grok-imagine-image-2.0``. storage_options: Persist the result to the Files API. Accepts a dict with a required ``filename`` and optional ``expires_after`` and ``public_url`` keys. Set ``public_url`` to also create a publicly shareable URL. @@ -217,6 +229,7 @@ def sample( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + quality=quality, storage_options=storage_options, ) with tracer.start_as_current_span( @@ -243,6 +256,7 @@ def sample_batch( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + quality: Optional[ImageQuality] = None, storage_options: Optional[Union[StorageOptions, image_pb2.StorageOptions]] = None, ) -> Sequence["ImageResponse"]: """Samples a batch of images based on the provided prompt. @@ -293,6 +307,10 @@ def sample_batch( - `"1k"`: ~1 megapixel total. Dimensions vary by aspect ratio. - `"2k"`: ~4 megapixels total. Dimensions vary by aspect ratio. Only supported for grok-imagine models. + quality: Control generation quality with the optional quality + parameter. Allowed values are ``"low"`` and ``"medium"``. When + omitted, the default is ``"medium"``. The parameter is only + supported for ``grok-imagine-image-2.0``. storage_options: Persist the results to the Files API. Accepts a dict with a required ``filename`` and optional ``expires_after`` and ``public_url`` keys. Set ``public_url`` to also create a publicly shareable URL. @@ -318,6 +336,7 @@ def sample_batch( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + quality=quality, storage_options=storage_options, ) with tracer.start_as_current_span( diff --git a/src/xai_sdk/types/__init__.py b/src/xai_sdk/types/__init__.py index 056c4fa..0cef157 100644 --- a/src/xai_sdk/types/__init__.py +++ b/src/xai_sdk/types/__init__.py @@ -10,7 +10,7 @@ ToolMode, ) from .common import ServiceTier -from .image import ImageAspectRatio, ImageFormat, ImageResolution +from .image import ImageAspectRatio, ImageFormat, ImageQuality, ImageResolution from .model import AllModels, ChatModel, ImageGenerationModel, VideoGenerationModel from .video import VideoAspectRatio, VideoResolution @@ -24,6 +24,7 @@ "ImageDetail", "ImageFormat", "ImageGenerationModel", + "ImageQuality", "ImageResolution", "IncludeOption", "IncludeOptionMap", diff --git a/src/xai_sdk/types/image.py b/src/xai_sdk/types/image.py index 312de14..db2ae9e 100644 --- a/src/xai_sdk/types/image.py +++ b/src/xai_sdk/types/image.py @@ -1,6 +1,6 @@ from typing import Literal, TypeAlias -__all__ = ["ImageAspectRatio", "ImageFormat", "ImageResolution"] +__all__ = ["ImageAspectRatio", "ImageFormat", "ImageQuality", "ImageResolution"] ImageFormat: TypeAlias = Literal["base64", "url"] ImageAspectRatio: TypeAlias = Literal[ @@ -19,3 +19,4 @@ "2:1", ] ImageResolution: TypeAlias = Literal["1k", "2k"] +ImageQuality: TypeAlias = Literal["low", "medium"] diff --git a/src/xai_sdk/types/model.py b/src/xai_sdk/types/model.py index 3d3f2fb..e02167c 100644 --- a/src/xai_sdk/types/model.py +++ b/src/xai_sdk/types/model.py @@ -44,6 +44,7 @@ ImageGenerationModel: TypeAlias = Literal[ "grok-imagine-image", + "grok-imagine-image-2.0", "grok-imagine-image-pro", "grok-imagine-image-quality", ] diff --git a/tests/aio/image_test.py b/tests/aio/image_test.py index 33bbed0..e245799 100644 --- a/tests/aio/image_test.py +++ b/tests/aio/image_test.py @@ -8,7 +8,12 @@ from xai_sdk import AsyncClient from xai_sdk.cost import USD_PER_TICK -from xai_sdk.image import BaseImageResponse, ImageFormat +from xai_sdk.image import ( + BaseImageResponse, + ImageFormat, + _make_generate_request, + _make_span_request_attributes, +) from xai_sdk.proto import batch_pb2, image_pb2, usage_pb2 from .. import server @@ -94,6 +99,53 @@ async def test_sample_batch_passes_aspect_ratio_and_resolution(client: AsyncClie assert request.resolution == image_pb2.ImageResolution.IMG_RESOLUTION_1K +@pytest.mark.asyncio(loop_scope="session") +async def test_sample_passes_quality(client: AsyncClient): + server.clear_last_image_request() + + await client.image.sample(prompt="foo", model="grok-imagine-image-2.0", quality="medium") + + request = server.get_last_image_request() + assert request is not None + assert request.HasField("quality") + assert request.quality == image_pb2.ImageQuality.IMG_QUALITY_MEDIUM + + +@pytest.mark.asyncio(loop_scope="session") +async def test_sample_batch_passes_quality(client: AsyncClient): + server.clear_last_image_request() + + await client.image.sample_batch(prompt="foo", model="grok-imagine-image-2.0", n=2, quality="low") + + request = server.get_last_image_request() + assert request is not None + assert request.HasField("quality") + assert request.quality == image_pb2.ImageQuality.IMG_QUALITY_LOW + + +@pytest.mark.asyncio(loop_scope="session") +async def test_sample_omits_quality_by_default(client: AsyncClient): + server.clear_last_image_request() + + await client.image.sample(prompt="foo", model="grok-imagine-image-2.0") + + request = server.get_last_image_request() + assert request is not None + assert not request.HasField("quality") + + +@pytest.mark.asyncio(loop_scope="session") +async def test_sample_rejects_invalid_quality(client: AsyncClient): + with pytest.raises(ValueError, match="Invalid image quality"): + await client.image.sample(prompt="foo", model="grok-imagine-image-2.0", quality="ultra") # type: ignore[arg-type] + + +def test_quality_included_in_span_request_attributes(): + request = _make_generate_request(prompt="foo", model="grok-imagine-image-2.0", quality="medium") + attributes = _make_span_request_attributes(request) + assert attributes["gen_ai.request.image.quality"] == "medium" + + @pytest.mark.asyncio(loop_scope="session") async def test_sample_passes_image_url(client: AsyncClient): server.clear_last_image_request() @@ -471,6 +523,31 @@ async def test_prepare_passes_image_file_id(client: AsyncClient): assert batch_req.image_request.image.file_id == "file_abc" +@pytest.mark.asyncio(loop_scope="session") +async def test_prepare_passes_quality(client: AsyncClient): + batch_req = client.image.prepare( + prompt="foo", + model="grok-imagine-image-2.0", + quality="medium", + ) + + assert batch_req.image_request.HasField("quality") + assert batch_req.image_request.quality == image_pb2.ImageQuality.IMG_QUALITY_MEDIUM + + +@pytest.mark.asyncio(loop_scope="session") +async def test_prepare_omits_quality_by_default(client: AsyncClient): + batch_req = client.image.prepare(prompt="foo", model="grok-imagine-image-2.0") + + assert not batch_req.image_request.HasField("quality") + + +@pytest.mark.asyncio(loop_scope="session") +async def test_prepare_rejects_invalid_quality(client: AsyncClient): + with pytest.raises(ValueError, match="Invalid image quality"): + client.image.prepare(prompt="foo", model="grok-imagine-image-2.0", quality="ultra") # type: ignore[arg-type] + + @pytest.mark.asyncio(loop_scope="session") async def test_sample_passes_storage_options(client: AsyncClient): server.clear_last_image_request() diff --git a/tests/sync/image_test.py b/tests/sync/image_test.py index b26d50d..f81d983 100644 --- a/tests/sync/image_test.py +++ b/tests/sync/image_test.py @@ -7,7 +7,12 @@ from xai_sdk import Client from xai_sdk.cost import USD_PER_TICK -from xai_sdk.image import BaseImageResponse, ImageFormat +from xai_sdk.image import ( + BaseImageResponse, + ImageFormat, + _make_generate_request, + _make_span_request_attributes, +) from xai_sdk.proto import batch_pb2, image_pb2, usage_pb2 from .. import server @@ -88,6 +93,55 @@ def test_sample_batch_passes_aspect_ratio_and_resolution(client: Client): assert request.resolution == image_pb2.ImageResolution.IMG_RESOLUTION_1K +def test_sample_passes_quality(client: Client): + server.clear_last_image_request() + + client.image.sample(prompt="foo", model="grok-imagine-image-2.0", quality="medium") + + request = server.get_last_image_request() + assert request is not None + assert request.HasField("quality") + assert request.quality == image_pb2.ImageQuality.IMG_QUALITY_MEDIUM + + +def test_sample_batch_passes_quality(client: Client): + server.clear_last_image_request() + + client.image.sample_batch(prompt="foo", model="grok-imagine-image-2.0", n=2, quality="low") + + request = server.get_last_image_request() + assert request is not None + assert request.HasField("quality") + assert request.quality == image_pb2.ImageQuality.IMG_QUALITY_LOW + + +def test_sample_omits_quality_by_default(client: Client): + server.clear_last_image_request() + + client.image.sample(prompt="foo", model="grok-imagine-image-2.0") + + request = server.get_last_image_request() + assert request is not None + assert not request.HasField("quality") + + +def test_sample_rejects_invalid_quality(client: Client): + with pytest.raises(ValueError, match="Invalid image quality"): + client.image.sample(prompt="foo", model="grok-imagine-image-2.0", quality="ultra") # type: ignore[arg-type] + + +def test_quality_included_in_span_request_attributes(): + request = _make_generate_request(prompt="foo", model="grok-imagine-image-2.0", quality="medium") + attributes = _make_span_request_attributes(request) + assert attributes["gen_ai.request.image.quality"] == "medium" + + +def test_quality_omitted_from_span_request_attributes_by_default(): + request = _make_generate_request(prompt="foo", model="grok-imagine-image") + attributes = _make_span_request_attributes(request) + assert "gen_ai.request.image.quality" not in attributes + + def test_sample_passes_image_url(client: Client): server.clear_last_image_request() @@ -466,6 +520,28 @@ def test_prepare_passes_image_file_id(client: Client): assert batch_req.image_request.image.file_id == "file_abc" +def test_prepare_passes_quality(client: Client): + batch_req = client.image.prepare( + prompt="foo", + model="grok-imagine-image-2.0", + quality="medium", + ) + + assert batch_req.image_request.HasField("quality") + assert batch_req.image_request.quality == image_pb2.ImageQuality.IMG_QUALITY_MEDIUM + + +def test_prepare_omits_quality_by_default(client: Client): + batch_req = client.image.prepare(prompt="foo", model="grok-imagine-image-2.0") + + assert not batch_req.image_request.HasField("quality") + + +def test_prepare_rejects_invalid_quality(client: Client): + with pytest.raises(ValueError, match="Invalid image quality"): + client.image.prepare(prompt="foo", model="grok-imagine-image-2.0", quality="ultra") # type: ignore[arg-type] + + def test_sample_passes_storage_options(client: Client): server.clear_last_image_request()