From 960e59403502b82dc663410ee7361029e91906e1 Mon Sep 17 00:00:00 2001 From: Denis Dorozhkin Date: Tue, 2 Jun 2026 06:51:42 +0000 Subject: [PATCH] feat: add service_tier support for priority processing Add per-request service_tier parameter to all SDK endpoints. Users can set service_tier='priority' on any request to opt into priority processing. Changes: - ServiceTier type: Literal['auto', 'default', 'priority'] - chat.create(): service_tier parameter - Response.service_tier: property returning the tier used - image.sample/prepare: service_tier parameter - video.generate/extend/start: service_tier parameter - Updated proto bindings (usage, chat, image, video) --- src/xai_sdk/aio/image.py | 7 + src/xai_sdk/aio/video.py | 13 + src/xai_sdk/chat.py | 32 ++ src/xai_sdk/image.py | 6 + src/xai_sdk/proto/v5/chat_pb2.py | 192 +++------ src/xai_sdk/proto/v5/chat_pb2.pyi | 618 +++++++++------------------- src/xai_sdk/proto/v5/image_pb2.py | 79 ++-- src/xai_sdk/proto/v5/image_pb2.pyi | 144 ++++++- src/xai_sdk/proto/v5/usage_pb2.py | 30 +- src/xai_sdk/proto/v5/usage_pb2.pyi | 31 +- src/xai_sdk/proto/v5/video_pb2.py | 72 ++-- src/xai_sdk/proto/v5/video_pb2.pyi | 79 +++- src/xai_sdk/proto/v6/chat_pb2.py | 192 +++------ src/xai_sdk/proto/v6/chat_pb2.pyi | 620 +++++++++-------------------- src/xai_sdk/proto/v6/image_pb2.py | 79 ++-- src/xai_sdk/proto/v6/image_pb2.pyi | 146 ++++++- src/xai_sdk/proto/v6/usage_pb2.py | 30 +- src/xai_sdk/proto/v6/usage_pb2.pyi | 31 +- src/xai_sdk/proto/v6/video_pb2.py | 72 ++-- src/xai_sdk/proto/v6/video_pb2.pyi | 79 +++- src/xai_sdk/sync/image.py | 7 + src/xai_sdk/sync/video.py | 13 + src/xai_sdk/types/__init__.py | 2 + src/xai_sdk/types/chat.py | 2 + src/xai_sdk/video.py | 11 + 25 files changed, 1277 insertions(+), 1310 deletions(-) diff --git a/src/xai_sdk/aio/image.py b/src/xai_sdk/aio/image.py index 3192e11..3a9be69 100644 --- a/src/xai_sdk/aio/image.py +++ b/src/xai_sdk/aio/image.py @@ -17,6 +17,7 @@ from ..proto import batch_pb2 from ..telemetry import get_tracer from ..types import ImageGenerationModel +from ..types.chat import ServiceTier tracer = get_tracer(__name__) @@ -36,6 +37,7 @@ def prepare( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + service_tier: Optional[ServiceTier] = None, ) -> batch_pb2.BatchRequest: """Prepares an image generation request for batch processing. @@ -96,6 +98,7 @@ def prepare( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + service_tier=service_tier, ) return batch_pb2.BatchRequest( image_request=request, @@ -113,6 +116,7 @@ async def sample( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + service_tier: Optional[ServiceTier] = None, ) -> "ImageResponse": """Samples a single image asynchronously based on the provided prompt. @@ -163,6 +167,7 @@ async def sample( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + service_tier=service_tier, ) with tracer.start_as_current_span( name=f"image.sample {model}", @@ -186,6 +191,7 @@ async def sample_batch( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + service_tier: Optional[ServiceTier] = None, ) -> Sequence["ImageResponse"]: """Samples a batch of images asynchronously based on the provided prompt. @@ -238,6 +244,7 @@ async def sample_batch( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + service_tier=service_tier, ) with tracer.start_as_current_span( name=f"image.sample_batch {model}", diff --git a/src/xai_sdk/aio/video.py b/src/xai_sdk/aio/video.py index f181570..d0dac26 100644 --- a/src/xai_sdk/aio/video.py +++ b/src/xai_sdk/aio/video.py @@ -9,6 +9,7 @@ from ..proto import batch_pb2, deferred_pb2, video_pb2 from ..telemetry import get_tracer from ..types import VideoGenerationModel +from ..types.chat import ServiceTier from ..video import ( DEFAULT_VIDEO_POLL_INTERVAL, DEFAULT_VIDEO_TIMEOUT, @@ -43,6 +44,7 @@ def prepare( aspect_ratio: Optional[VideoAspectRatio] = None, resolution: Optional[VideoResolution] = None, reference_image_urls: Optional[Sequence[str]] = None, + service_tier: Optional[ServiceTier] = None, ) -> batch_pb2.BatchRequest: """Prepares a video generation request for batch processing. @@ -103,6 +105,7 @@ def prepare( aspect_ratio=aspect_ratio, resolution=resolution, reference_image_urls=reference_image_urls, + service_tier=service_tier, ) return batch_pb2.BatchRequest( @@ -118,6 +121,7 @@ def prepare_extension( *, batch_request_id: Optional[str] = None, duration: Optional[int] = None, + service_tier: Optional[ServiceTier] = None, ) -> batch_pb2.BatchRequest: """Prepares a video extension request for batch processing. @@ -141,6 +145,7 @@ def prepare_extension( model, video_url, duration=duration, + service_tier=service_tier, ) return batch_pb2.BatchRequest( @@ -159,6 +164,7 @@ async def start( aspect_ratio: Optional[VideoAspectRatio] = None, resolution: Optional[VideoResolution] = None, reference_image_urls: Optional[Sequence[str]] = None, + service_tier: Optional[ServiceTier] = None, ) -> deferred_pb2.StartDeferredResponse: """Starts a video generation request and returns a request_id for polling.""" request = _make_generate_request( @@ -170,6 +176,7 @@ async def start( aspect_ratio=aspect_ratio, resolution=resolution, reference_image_urls=reference_image_urls, + service_tier=service_tier, ) with tracer.start_as_current_span( @@ -195,6 +202,7 @@ async def generate( aspect_ratio: Optional[VideoAspectRatio] = None, resolution: Optional[VideoResolution] = None, reference_image_urls: Optional[Sequence[str]] = None, + service_tier: Optional[ServiceTier] = None, timeout: Optional[datetime.timedelta] = None, interval: Optional[datetime.timedelta] = None, ) -> VideoResponse: @@ -295,6 +303,7 @@ async def generate( aspect_ratio=aspect_ratio, resolution=resolution, reference_image_urls=reference_image_urls, + service_tier=service_tier, ) with tracer.start_as_current_span( @@ -339,6 +348,7 @@ async def extend_start( video_url: str, *, duration: Optional[int] = None, + service_tier: Optional[ServiceTier] = None, ) -> deferred_pb2.StartDeferredResponse: """Starts a video extension request and returns a request_id for polling. @@ -358,6 +368,7 @@ async def extend_start( model, video_url, duration=duration, + service_tier=service_tier, ) with tracer.start_as_current_span( @@ -374,6 +385,7 @@ async def extend( video_url: str, *, duration: Optional[int] = None, + service_tier: Optional[ServiceTier] = None, timeout: Optional[datetime.timedelta] = None, interval: Optional[datetime.timedelta] = None, ) -> VideoResponse: @@ -441,6 +453,7 @@ async def extend( model, video_url, duration=duration, + service_tier=service_tier, ) with tracer.start_as_current_span( diff --git a/src/xai_sdk/chat.py b/src/xai_sdk/chat.py index 8f64edd..23a950b 100644 --- a/src/xai_sdk/chat.py +++ b/src/xai_sdk/chat.py @@ -23,6 +23,7 @@ IncludeOptionMap, ReasoningEffort, ResponseFormat, + ServiceTier, ToolMode, ) @@ -67,6 +68,7 @@ def create( include: Optional[Sequence[Union[IncludeOption, "chat_pb2.IncludeOption"]]] = None, agent_count: Optional[Union[AgentCount, "chat_pb2.AgentCount"]] = None, batch_request_id: Optional[str] = None, + service_tier: Optional[Union[ServiceTier, "usage_pb2.ServiceTier"]] = None, ) -> T: """Creates a new chat conversation. @@ -175,6 +177,9 @@ def create( batch_request_id: An optional user-provided identifier for the batch request. **If provided, it must be unique within the batch.**Used to identify the corresponding result when the response is returned to the user. + service_tier: The processing tier for this request. Set to `"priority"` for higher + scheduling priority. Valid values: `"auto"` (default), `"default"`, `"priority"`. + The response includes a `service_tier` field indicating which tier was actually used. Returns: A new chat request bound to a client. @@ -221,6 +226,12 @@ def create( else: agent_count_pb = agent_count + service_tier_pb: Optional[usage_pb2.ServiceTier] = None + if isinstance(service_tier, str): + service_tier_pb = _service_tier_to_proto(service_tier) + elif service_tier is not None: + service_tier_pb = service_tier + return self._make_chat( conversation_id=conversation_id, batch_request_id=batch_request_id, @@ -248,6 +259,7 @@ def create( max_turns=max_turns, include=include_pb, agent_count=agent_count_pb, + service_tier=service_tier_pb, ) @abc.abstractmethod @@ -922,6 +934,17 @@ def _include_option_to_proto(include_option: IncludeOption) -> chat_pb2.IncludeO raise ValueError(f"Invalid include option: {include_option}. Must be one of: {IncludeOptionMap.keys()}") +def _service_tier_to_proto(tier: ServiceTier) -> usage_pb2.ServiceTier: + """Converts a `ServiceTier` literal to a proto.""" + match tier: + case "priority": + return usage_pb2.ServiceTier.SERVICE_TIER_PRIORITY + case "default" | "auto": + return usage_pb2.ServiceTier.SERVICE_TIER_DEFAULT + case _: + raise ValueError(f"Invalid service tier: {tier}. Must be one of: 'auto', 'default', 'priority'.") + + def _agent_count_to_proto(agent_count: int) -> chat_pb2.AgentCount: """Converts an `AgentCount` literal to a proto.""" if agent_count in AgentCountMap: @@ -1286,6 +1309,15 @@ def system_fingerprint(self) -> str: """Returns the system fingerprint of this response.""" return self.proto.system_fingerprint + @property + def service_tier(self) -> str: + """Returns the processing tier used for this request. + + Returns ``"priority"`` if the request was served at the priority tier, + or ``"default"`` otherwise. + """ + return usage_pb2.ServiceTier.Name(self._proto.service_tier).removeprefix("SERVICE_TIER_").lower() + @property def tool_calls(self) -> Sequence[chat_pb2.ToolCall]: """Returns the all tool calls of this response.""" diff --git a/src/xai_sdk/image.py b/src/xai_sdk/image.py index 49db100..3ba068f 100644 --- a/src/xai_sdk/image.py +++ b/src/xai_sdk/image.py @@ -7,6 +7,7 @@ from .cost import cost_usd_from_usage from .meta import ProtoDecorator from .proto import image_pb2, image_pb2_grpc, usage_pb2 +from .types.chat import ServiceTier from .telemetry import should_disable_sensitive_attributes from .types import ImageAspectRatio, ImageFormat, ImageGenerationModel, ImageResolution @@ -130,6 +131,7 @@ def _make_generate_request( image_format: ImageFormat | None = None, aspect_ratio: ImageAspectRatio | None = None, resolution: ImageResolution | None = None, + service_tier: Union[ServiceTier, "usage_pb2.ServiceTier", None] = None, ) -> image_pb2.GenerateImageRequest: if image_url is not None and image_urls is not None: raise ValueError("Only one of image_url or image_urls can be set for a request.") @@ -163,6 +165,10 @@ 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 service_tier is not None: + from .chat import _service_tier_to_proto + + request.service_tier = _service_tier_to_proto(service_tier) if isinstance(service_tier, str) else service_tier return request diff --git a/src/xai_sdk/proto/v5/chat_pb2.py b/src/xai_sdk/proto/v5/chat_pb2.py index 7960853..0b87514 100644 --- a/src/xai_sdk/proto/v5/chat_pb2.py +++ b/src/xai_sdk/proto/v5/chat_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/chat.proto -# Protobuf Python Version: 5.29.1 +# source: chat.proto +# Protobuf Python Version: 5.28.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,11 +11,9 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 5, - 29, - 1, + 5, 0, 0, '', - 'xai/api/v1/chat.proto' + 'chat.proto' ) # @@protoc_insertion_point(imports) @@ -23,133 +21,71 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from . import deferred_pb2 as xai_dot_api_dot_v1_dot_deferred__pb2 -from . import documents_pb2 as xai_dot_api_dot_v1_dot_documents__pb2 -from . import image_pb2 as xai_dot_api_dot_v1_dot_image__pb2 -from . import sample_pb2 as xai_dot_api_dot_v1_dot_sample__pb2 -from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 +from . import deferred_pb2 as deferred__pb2 +from . import sample_pb2 as sample__pb2 +from . import usage_pb2 as usage__pb2 +from . import chat_types_pb2 as chat__types__pb2 +from . import chat_bidi_v2_pb2 as chat__bidi__v2__pb2 +from .chat_types_pb2 import * +from .chat_bidi_v2_pb2 import * -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\"\xb8\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\x42\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\"\x96\x03\n\x19GetChatCompletionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x33\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutputR\x07outputs\x12\x34\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x06 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x07 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\n \x03(\tR\tcitations\x12\x34\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettingsR\x08settings\x12\x37\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xe2\x02\n\x16GetChatCompletionChunk\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x38\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunkR\x07outputs\x12\x34\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x05 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\x07 \x03(\tR\tcitations\x12\x37\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xa2\x01\n\x1dGetDeferredCompletionResponse\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x43\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\"\xc9\x01\n\x10\x43ompletionOutput\x12:\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x02 \x01(\x05R\x05index\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessageR\x07message\x12-\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\"\x9a\x02\n\x11\x43ompletionMessage\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xbe\x01\n\x15\x43ompletionOutputChunk\x12$\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.DeltaR\x05\x64\x65lta\x12-\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\x12:\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x04 \x01(\x05R\x05index\"\x8e\x02\n\x05\x44\x65lta\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xad\x02\n\x0eInlineCitation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bstart_index\x18\x02 \x01(\x05R\nstartIndex\x12\x1b\n\tend_index\x18\x06 \x01(\x05R\x08\x65ndIndex\x12\x39\n\x0cweb_citation\x18\x03 \x01(\x0b\x32\x14.xai_api.WebCitationH\x00R\x0bwebCitation\x12\x33\n\nx_citation\x18\x04 \x01(\x0b\x32\x12.xai_api.XCitationH\x00R\txCitation\x12Q\n\x14\x63ollections_citation\x18\x05 \x01(\x0b\x32\x1c.xai_api.CollectionsCitationH\x00R\x13\x63ollectionsCitationB\n\n\x08\x63itation\"\x1f\n\x0bWebCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\x1d\n\tXCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xab\x01\n\x13\x43ollectionsCitation\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x19\n\x08\x63hunk_id\x18\x02 \x01(\tR\x07\x63hunkId\x12#\n\rchunk_content\x18\x03 \x01(\tR\x0c\x63hunkContent\x12\x14\n\x05score\x18\x04 \x01(\x02R\x05score\x12%\n\x0e\x63ollection_ids\x18\x05 \x03(\tR\rcollectionIds\"6\n\x08LogProbs\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProbR\x07\x63ontent\"\x87\x01\n\x07LogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\x12\x36\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProbR\x0btopLogprobs\"R\n\nTopLogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\"\x8f\x01\n\x07\x43ontent\x12\x14\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x12\x37\n\timage_url\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentH\x00R\x08imageUrl\x12*\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x14.xai_api.FileContentH\x00R\x04\x66ileB\t\n\x07\x63ontent\"\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*\x82\x03\n\rIncludeOption\x12\x1a\n\x16INCLUDE_OPTION_INVALID\x10\x00\x12)\n%INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT\x10\x01\x12\'\n#INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT\x10\x02\x12-\n)INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT\x10\x03\x12\x31\n-INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT\x10\x04\x12\x30\n,INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT\x10\x05\x12\"\n\x1eINCLUDE_OPTION_MCP_CALL_OUTPUT\x10\x06\x12#\n\x1fINCLUDE_OPTION_INLINE_CITATIONS\x10\x07\x12$\n INCLUDE_OPTION_VERBOSE_STREAMING\x10\x08*\x8d\x01\n\x0bMessageRole\x12\x10\n\x0cINVALID_ROLE\x10\x00\x12\r\n\tROLE_USER\x10\x01\x12\x12\n\x0eROLE_ASSISTANT\x10\x02\x12\x0f\n\x0bROLE_SYSTEM\x10\x03\x12\x15\n\rROLE_FUNCTION\x10\x04\x1a\x02\x08\x01\x12\r\n\tROLE_TOOL\x10\x05\x12\x12\n\x0eROLE_DEVELOPER\x10\x06*j\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*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\nchat.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0e\x64\x65\x66\x65rred.proto\x1a\x0csample.proto\x1a\x0busage.proto\x1a\x10\x63hat_types.proto\x1a\x12\x63hat_bidi_v2.proto\"\xd4\t\n\x15GetCompletionsRequest\x12\"\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.Message\x12\r\n\x05model\x18\x02 \x01(\t\x12\x0c\n\x04user\x18\x10 \x01(\t\x12\x0e\n\x01n\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nmax_tokens\x18\x07 \x01(\x05H\x01\x88\x01\x01\x12\x11\n\x04seed\x18\x0b \x01(\x05H\x02\x88\x01\x01\x12\x0c\n\x04stop\x18\x0c \x03(\t\x12\x18\n\x0btemperature\x18\x0e \x01(\x02H\x03\x88\x01\x01\x12\x12\n\x05top_p\x18\x0f \x01(\x02H\x04\x88\x01\x01\x12\x10\n\x08logprobs\x18\x05 \x01(\x08\x12\x19\n\x0ctop_logprobs\x18\x06 \x01(\x05H\x05\x88\x01\x01\x12\x1c\n\x05tools\x18\x11 \x03(\x0b\x32\r.xai_api.Tool\x12(\n\x0btool_choice\x18\x12 \x01(\x0b\x32\x13.xai_api.ToolChoice\x12\x30\n\x0fresponse_format\x18\n \x01(\x0b\x32\x17.xai_api.ResponseFormat\x12\x1e\n\x11\x66requency_penalty\x18\x03 \x01(\x02H\x06\x88\x01\x01\x12\x1d\n\x10presence_penalty\x18\t \x01(\x02H\x07\x88\x01\x01\x12\x37\n\x10reasoning_effort\x18\x13 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x08\x88\x01\x01\x12\x39\n\x11search_parameters\x18\x14 \x01(\x0b\x32\x19.xai_api.SearchParametersH\t\x88\x01\x01\x12 \n\x13parallel_tool_calls\x18\x15 \x01(\x08H\n\x88\x01\x01\x12!\n\x14previous_response_id\x18\x16 \x01(\tH\x0b\x88\x01\x01\x12\x16\n\x0estore_messages\x18\x17 \x01(\x08\x12\x1d\n\x15use_encrypted_content\x18\x18 \x01(\x08\x12\x16\n\tmax_turns\x18\x19 \x01(\x05H\x0c\x88\x01\x01\x12\'\n\x07include\x18\x1a \x03(\x0e\x32\x16.xai_api.IncludeOption\x12\x1b\n\x0e\x62ootstrap_host\x18\x1b \x01(\tH\r\x88\x01\x01\x12\x1b\n\x0e\x62ootstrap_room\x18\x1c \x01(\x04H\x0e\x88\x01\x01\x12-\n\x0b\x61gent_count\x18\x1d \x01(\x0e\x32\x13.xai_api.AgentCountH\x0f\x88\x01\x01\x12\x17\n\ncache_salt\x18\x1e \x01(\tH\x10\x88\x01\x01\x12/\n\x0cservice_tier\x18\x1f \x01(\x0e\x32\x14.xai_api.ServiceTierH\x11\x88\x01\x01\x42\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\x11\n\x0f_bootstrap_hostB\x11\n\x0f_bootstrap_roomB\x0e\n\x0c_agent_countB\r\n\x0b_cache_saltB\x0f\n\r_service_tierJ\x04\x08\x04\x10\x05\"\xbe\x03\n\x19GetChatCompletionResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12*\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutput\x12+\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05model\x18\x06 \x01(\t\x12\x1a\n\x12system_fingerprint\x18\x07 \x01(\t\x12%\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12\x11\n\tcitations\x18\n \x03(\t\x12*\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettings\x12*\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutput\x12)\n\x0coutput_files\x18\r \x03(\x0b\x32\x13.xai_api.OutputFile\x12(\n\x0einput_messages\x18\x0e \x03(\x0b\x32\x10.xai_api.Message\x12*\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTier\"\xea\x02\n\x16GetChatCompletionChunk\x12\n\n\x02id\x18\x01 \x01(\t\x12/\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunk\x12+\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05model\x18\x04 \x01(\t\x12\x1a\n\x12system_fingerprint\x18\x05 \x01(\t\x12%\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12\x11\n\tcitations\x18\x07 \x03(\t\x12*\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutput\x12)\n\x0coutput_files\x18\x0b \x03(\x0b\x32\x13.xai_api.OutputFile\x12*\n\x0cservice_tier\x18\x0c \x01(\x0e\x32\x14.xai_api.ServiceTier\"\x90\x01\n\x1dGetDeferredCompletionResponse\x12\'\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatus\x12\x39\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\"\xa1\x01\n\x10\x43ompletionOutput\x12,\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReason\x12\r\n\x05index\x18\x02 \x01(\x05\x12+\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessage\x12#\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbs\"\xfa\x01\n\x11\x43ompletionMessage\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x19\n\x11reasoning_content\x18\x04 \x01(\t\x12\"\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRole\x12%\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCall\x12\x19\n\x11\x65ncrypted_content\x18\x05 \x01(\t\x12*\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitation\x12\'\n\x1fis_reasoning_content_summarized\x18\x07 \x01(\x08\"\x98\x01\n\x15\x43ompletionOutputChunk\x12\x1d\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.Delta\x12#\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbs\x12,\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReason\x12\r\n\x05index\x18\x04 \x01(\x05\"\xee\x01\n\x05\x44\x65lta\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x19\n\x11reasoning_content\x18\x04 \x01(\t\x12\"\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRole\x12%\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCall\x12\x19\n\x11\x65ncrypted_content\x18\x05 \x01(\t\x12*\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitation\x12\'\n\x1fis_reasoning_content_summarized\x18\x07 \x01(\x08\"-\n\x08LogProbs\x12!\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProb\"c\n\x07LogProb\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0f\n\x07logprob\x18\x02 \x01(\x02\x12\r\n\x05\x62ytes\x18\x03 \x01(\x0c\x12)\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProb\";\n\nTopLogProb\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0f\n\x07logprob\x18\x02 \x01(\x02\x12\r\n\x05\x62ytes\x18\x03 \x01(\x0c\"\x82\x02\n\x07Message\x12!\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.Content\x12\x1e\n\x11reasoning_content\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\"\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRole\x12\x0c\n\x04name\x18\x03 \x01(\t\x12%\n\ntool_calls\x18\x04 \x03(\x0b\x32\x11.xai_api.ToolCall\x12\x19\n\x11\x65ncrypted_content\x18\x06 \x01(\t\x12\x19\n\x0ctool_call_id\x18\x07 \x01(\tH\x01\x88\x01\x01\x42\x14\n\x12_reasoning_contentB\x0f\n\r_tool_call_id\"\x85\x02\n\x10SearchParameters\x12!\n\x04mode\x18\x01 \x01(\x0e\x32\x13.xai_api.SearchMode\x12 \n\x07sources\x18\t \x03(\x0b\x32\x0f.xai_api.Source\x12-\n\tfrom_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07to_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10return_citations\x18\x07 \x01(\x08\x12\x1f\n\x12max_search_results\x18\x08 \x01(\x05H\x00\x88\x01\x01\x42\x15\n\x13_max_search_results\"\xe1\x04\n\x0fRequestSettings\x12\x17\n\nmax_tokens\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x1b\n\x13parallel_tool_calls\x18\x02 \x01(\x08\x12!\n\x14previous_response_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x37\n\x10reasoning_effort\x18\x04 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x02\x88\x01\x01\x12\x18\n\x0btemperature\x18\x05 \x01(\x02H\x03\x88\x01\x01\x12\x30\n\x0fresponse_format\x18\x06 \x01(\x0b\x32\x17.xai_api.ResponseFormat\x12(\n\x0btool_choice\x18\x07 \x01(\x0b\x32\x13.xai_api.ToolChoice\x12\x1c\n\x05tools\x18\x08 \x03(\x0b\x32\r.xai_api.Tool\x12\x12\n\x05top_p\x18\t \x01(\x02H\x04\x88\x01\x01\x12\x0c\n\x04user\x18\n \x01(\t\x12\x39\n\x11search_parameters\x18\x0b \x01(\x0b\x32\x19.xai_api.SearchParametersH\x05\x88\x01\x01\x12\x16\n\x0estore_messages\x18\x0c \x01(\x08\x12\x1d\n\x15use_encrypted_content\x18\r \x01(\x08\x12\'\n\x07include\x18\x0e \x03(\x0e\x32\x16.xai_api.IncludeOptionB\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\"\x9d\x01\n\x0fResponseHistory\x12\"\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.Message\x12\x34\n\x08response\x18\x02 \x01(\x0b\x32\".xai_api.GetChatCompletionResponse\x12\x1c\n\x0f\x63onversation_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x12\n\x10_conversation_id\"1\n\x1aGetStoredCompletionRequest\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\"4\n\x1d\x44\x65leteStoredCompletionRequest\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\"5\n\x1e\x44\x65leteStoredCompletionResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\"\xbc\x02\n\x0b\x44\x65\x62ugOutput\x12\x10\n\x08\x61ttempts\x18\x01 \x01(\x05\x12\x0f\n\x07request\x18\x02 \x01(\t\x12\x0e\n\x06prompt\x18\x03 \x01(\t\x12\x16\n\x0e\x65ngine_request\x18\t \x01(\t\x12\x11\n\tresponses\x18\x04 \x03(\t\x12\x0e\n\x06\x63hunks\x18\x0c \x03(\t\x12\x18\n\x10\x63\x61\x63he_read_count\x18\x05 \x01(\r\x12\x1e\n\x16\x63\x61\x63he_read_input_bytes\x18\x06 \x01(\x04\x12\x19\n\x11\x63\x61\x63he_write_count\x18\x07 \x01(\r\x12\x1f\n\x17\x63\x61\x63he_write_input_bytes\x18\x08 \x01(\x04\x12\x12\n\nlb_address\x18\n \x01(\t\x12\x13\n\x0bsampler_tag\x18\x0b \x01(\t\x12 \n\x18sampler_checkpoint_mount\x18\r \x01(\t\"G\n\x15\x43ompactContextRequest\x12\r\n\x05model\x18\x01 \x01(\t\x12\x1f\n\x05input\x18\x02 \x03(\x0b\x32\x10.xai_api.Message\"\x85\x01\n\x16\x43ompactContextResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x19\n\x11\x65ncrypted_content\x18\x02 \x01(\t\x12\x1d\n\x15\x64ropped_message_count\x18\x03 \x01(\r\x12%\n\x05usage\x18\x04 \x01(\x0b\x32\x16.xai_api.SamplingUsage*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\xe7\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\x12L\n\x18GetCompletionChunkBidiV2\x12\x14.xai_api.ClientEvent\x1a\x14.xai_api.ServerEvent\"\x00(\x01\x30\x01\x12S\n\x0e\x43ompactContext\x12\x1e.xai_api.CompactContextRequest\x1a\x1f.xai_api.CompactContextResponse\"\x00\x42\x1eZ\x1cproxy/gen/go/xai_api;xai_apiP\x04P\x05\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.chat_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chat_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\tChatProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_MESSAGEROLE'].values_by_name["ROLE_FUNCTION"]._loaded_options = None - _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=10588 - _globals['_INCLUDEOPTION']._serialized_end=10974 - _globals['_MESSAGEROLE']._serialized_start=10977 - _globals['_MESSAGEROLE']._serialized_end=11118 - _globals['_REASONINGEFFORT']._serialized_start=11120 - _globals['_REASONINGEFFORT']._serialized_end=11226 - _globals['_AGENTCOUNT']._serialized_start=11228 - _globals['_AGENTCOUNT']._serialized_end=11308 - _globals['_TOOLMODE']._serialized_start=11310 - _globals['_TOOLMODE']._serialized_end=11407 - _globals['_FORMATTYPE']._serialized_start=11409 - _globals['_FORMATTYPE']._serialized_end=11526 - _globals['_TOOLCALLTYPE']._serialized_start=11529 - _globals['_TOOLCALLTYPE']._serialized_end=11834 - _globals['_TOOLCALLSTATUS']._serialized_start=11837 - _globals['_TOOLCALLSTATUS']._serialized_end=11981 - _globals['_SEARCHMODE']._serialized_start=11983 - _globals['_SEARCHMODE']._serialized_end=12083 - _globals['_GETCOMPLETIONSREQUEST']._serialized_start=196 - _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1532 - _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1535 - _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_end=1941 - _globals['_GETCHATCOMPLETIONCHUNK']._serialized_start=1944 - _globals['_GETCHATCOMPLETIONCHUNK']._serialized_end=2298 - _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_start=2301 - _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_end=2463 - _globals['_COMPLETIONOUTPUT']._serialized_start=2466 - _globals['_COMPLETIONOUTPUT']._serialized_end=2667 - _globals['_COMPLETIONMESSAGE']._serialized_start=2670 - _globals['_COMPLETIONMESSAGE']._serialized_end=2952 - _globals['_COMPLETIONOUTPUTCHUNK']._serialized_start=2955 - _globals['_COMPLETIONOUTPUTCHUNK']._serialized_end=3145 - _globals['_DELTA']._serialized_start=3148 - _globals['_DELTA']._serialized_end=3418 - _globals['_INLINECITATION']._serialized_start=3421 - _globals['_INLINECITATION']._serialized_end=3722 - _globals['_WEBCITATION']._serialized_start=3724 - _globals['_WEBCITATION']._serialized_end=3755 - _globals['_XCITATION']._serialized_start=3757 - _globals['_XCITATION']._serialized_end=3786 - _globals['_COLLECTIONSCITATION']._serialized_start=3789 - _globals['_COLLECTIONSCITATION']._serialized_end=3960 - _globals['_LOGPROBS']._serialized_start=3962 - _globals['_LOGPROBS']._serialized_end=4016 - _globals['_LOGPROB']._serialized_start=4019 - _globals['_LOGPROB']._serialized_end=4154 - _globals['_TOPLOGPROB']._serialized_start=4156 - _globals['_TOPLOGPROB']._serialized_end=4238 - _globals['_CONTENT']._serialized_start=4241 - _globals['_CONTENT']._serialized_end=4384 - _globals['_FILECONTENT']._serialized_start=4387 - _globals['_FILECONTENT']._serialized_end=4520 - _globals['_MESSAGE']._serialized_start=4523 - _globals['_MESSAGE']._serialized_end=4861 - _globals['_TOOLCHOICE']._serialized_start=4863 - _globals['_TOOLCHOICE']._serialized_end=4970 - _globals['_TOOL']._serialized_start=4973 - _globals['_TOOL']._serialized_end=5386 - _globals['_MCP']._serialized_start=5389 - _globals['_MCP']._serialized_end=5748 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_start=5667 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_end=5730 - _globals['_WEBSEARCH']._serialized_start=5751 - _globals['_WEBSEARCH']._serialized_end=6113 - _globals['_WEBSEARCHUSERLOCATION']._serialized_start=6116 - _globals['_WEBSEARCHUSERLOCATION']._serialized_end=6302 - _globals['_XSEARCH']._serialized_start=6305 - _globals['_XSEARCH']._serialized_end=6746 - _globals['_CODEEXECUTION']._serialized_start=6748 - _globals['_CODEEXECUTION']._serialized_end=6763 - _globals['_COLLECTIONSSEARCH']._serialized_start=6766 - _globals['_COLLECTIONSSEARCH']._serialized_end=7159 - _globals['_ATTACHMENTSEARCH']._serialized_start=7161 - _globals['_ATTACHMENTSEARCH']._serialized_end=7216 - _globals['_FUNCTION']._serialized_start=7218 - _globals['_FUNCTION']._serialized_end=7338 - _globals['_TOOLCALL']._serialized_start=7341 - _globals['_TOOLCALL']._serialized_end=7580 - _globals['_FUNCTIONCALL']._serialized_start=7582 - _globals['_FUNCTIONCALL']._serialized_end=7646 - _globals['_RESPONSEFORMAT']._serialized_start=7648 - _globals['_RESPONSEFORMAT']._serialized_end=7758 - _globals['_SEARCHPARAMETERS']._serialized_start=7761 - _globals['_SEARCHPARAMETERS']._serialized_end=8090 - _globals['_SOURCE']._serialized_start=8093 - _globals['_SOURCE']._serialized_end=8268 - _globals['_WEBSOURCE']._serialized_start=8271 - _globals['_WEBSOURCE']._serialized_end=8446 - _globals['_NEWSSOURCE']._serialized_start=8449 - _globals['_NEWSSOURCE']._serialized_end=8582 - _globals['_XSOURCE']._serialized_start=8585 - _globals['_XSOURCE']._serialized_end=8834 - _globals['_RSSSOURCE']._serialized_start=8836 - _globals['_RSSSOURCE']._serialized_end=8869 - _globals['_REQUESTSETTINGS']._serialized_start=8872 - _globals['_REQUESTSETTINGS']._serialized_end=9671 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=9673 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=9734 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=9736 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=9800 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=9802 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=9867 - _globals['_DEBUGOUTPUT']._serialized_start=9870 - _globals['_DEBUGOUTPUT']._serialized_end=10312 - _globals['_COMPACTCONTEXTREQUEST']._serialized_start=10314 - _globals['_COMPACTCONTEXTREQUEST']._serialized_end=10399 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=10402 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=10585 - _globals['_CHAT']._serialized_start=12086 - _globals['_CHAT']._serialized_end=12751 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_SEARCHMODE']._serialized_start=5344 + _globals['_SEARCHMODE']._serialized_end=5444 + _globals['_GETCOMPLETIONSREQUEST']._serialized_start=138 + _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1374 + _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1377 + _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_end=1823 + _globals['_GETCHATCOMPLETIONCHUNK']._serialized_start=1826 + _globals['_GETCHATCOMPLETIONCHUNK']._serialized_end=2188 + _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_start=2191 + _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_end=2335 + _globals['_COMPLETIONOUTPUT']._serialized_start=2338 + _globals['_COMPLETIONOUTPUT']._serialized_end=2499 + _globals['_COMPLETIONMESSAGE']._serialized_start=2502 + _globals['_COMPLETIONMESSAGE']._serialized_end=2752 + _globals['_COMPLETIONOUTPUTCHUNK']._serialized_start=2755 + _globals['_COMPLETIONOUTPUTCHUNK']._serialized_end=2907 + _globals['_DELTA']._serialized_start=2910 + _globals['_DELTA']._serialized_end=3148 + _globals['_LOGPROBS']._serialized_start=3150 + _globals['_LOGPROBS']._serialized_end=3195 + _globals['_LOGPROB']._serialized_start=3197 + _globals['_LOGPROB']._serialized_end=3296 + _globals['_TOPLOGPROB']._serialized_start=3298 + _globals['_TOPLOGPROB']._serialized_end=3357 + _globals['_MESSAGE']._serialized_start=3360 + _globals['_MESSAGE']._serialized_end=3618 + _globals['_SEARCHPARAMETERS']._serialized_start=3621 + _globals['_SEARCHPARAMETERS']._serialized_end=3882 + _globals['_REQUESTSETTINGS']._serialized_start=3885 + _globals['_REQUESTSETTINGS']._serialized_end=4494 + _globals['_RESPONSEHISTORY']._serialized_start=4497 + _globals['_RESPONSEHISTORY']._serialized_end=4654 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=4656 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=4705 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=4707 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=4759 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=4761 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=4814 + _globals['_DEBUGOUTPUT']._serialized_start=4817 + _globals['_DEBUGOUTPUT']._serialized_end=5133 + _globals['_COMPACTCONTEXTREQUEST']._serialized_start=5135 + _globals['_COMPACTCONTEXTREQUEST']._serialized_end=5206 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=5209 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=5342 + _globals['_CHAT']._serialized_start=5447 + _globals['_CHAT']._serialized_end=6190 # @@protoc_insertion_point(module_scope) + +from .chat_types_pb2 import * # re-export split types + +from .chat_bidi_v2_pb2 import * # re-export split types diff --git a/src/xai_sdk/proto/v5/chat_pb2.pyi b/src/xai_sdk/proto/v5/chat_pb2.pyi index 76531a4..a6fbd13 100644 --- a/src/xai_sdk/proto/v5/chat_pb2.pyi +++ b/src/xai_sdk/proto/v5/chat_pb2.pyi @@ -1,84 +1,135 @@ from google.protobuf import timestamp_pb2 as _timestamp_pb2 from . import deferred_pb2 as _deferred_pb2 -from . import documents_pb2 as _documents_pb2 -from . import image_pb2 as _image_pb2 from . import sample_pb2 as _sample_pb2 from . import usage_pb2 as _usage_pb2 +from . import chat_types_pb2 as _chat_types_pb2 +from . import chat_bidi_v2_pb2 as _chat_bidi_v2_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union +from chat_types_pb2 import Content as Content +from chat_types_pb2 import FileContent as FileContent +from chat_types_pb2 import ToolChoice as ToolChoice +from chat_types_pb2 import Tool as Tool +from chat_types_pb2 import MCP as MCP +from chat_types_pb2 import WebSearch as WebSearch +from chat_types_pb2 import WebSearchUserLocation as WebSearchUserLocation +from chat_types_pb2 import XSearch as XSearch +from chat_types_pb2 import CodeExecution as CodeExecution +from chat_types_pb2 import CollectionsSearch as CollectionsSearch +from chat_types_pb2 import AttachmentSearch as AttachmentSearch +from chat_types_pb2 import LocationsSearch as LocationsSearch +from chat_types_pb2 import Function as Function +from chat_types_pb2 import LiveSearch as LiveSearch +from chat_types_pb2 import ToolCall as ToolCall +from chat_types_pb2 import FunctionCall as FunctionCall +from chat_types_pb2 import ResponseFormat as ResponseFormat +from chat_types_pb2 import InlineCitation as InlineCitation +from chat_types_pb2 import WebCitation as WebCitation +from chat_types_pb2 import XCitation as XCitation +from chat_types_pb2 import CollectionsCitation as CollectionsCitation +from chat_types_pb2 import OutputFile as OutputFile +from chat_types_pb2 import Source as Source +from chat_types_pb2 import WebSource as WebSource +from chat_types_pb2 import NewsSource as NewsSource +from chat_types_pb2 import XSource as XSource +from chat_types_pb2 import RssSource as RssSource +from chat_types_pb2 import MessageRole as MessageRole +from chat_types_pb2 import ReasoningEffort as ReasoningEffort +from chat_types_pb2 import AgentCount as AgentCount +from chat_types_pb2 import IncludeOption as IncludeOption +from chat_types_pb2 import ToolMode as ToolMode +from chat_types_pb2 import FormatType as FormatType +from chat_types_pb2 import ToolCallType as ToolCallType +from chat_types_pb2 import ToolCallStatus as ToolCallStatus +from chat_bidi_v2_pb2 import ServerEvent as ServerEvent +from chat_bidi_v2_pb2 import ResponseCreatedEvent as ResponseCreatedEvent +from chat_bidi_v2_pb2 import ResponseCompletedEvent as ResponseCompletedEvent +from chat_bidi_v2_pb2 import ResponseFailedEvent as ResponseFailedEvent +from chat_bidi_v2_pb2 import ResponseIncompleteEvent as ResponseIncompleteEvent +from chat_bidi_v2_pb2 import AgentInfo as AgentInfo +from chat_bidi_v2_pb2 import OutputItem as OutputItem +from chat_bidi_v2_pb2 import OutputMessageContent as OutputMessageContent +from chat_bidi_v2_pb2 import OutputTextAnnotation as OutputTextAnnotation +from chat_bidi_v2_pb2 import ToolCallInfo as ToolCallInfo +from chat_bidi_v2_pb2 import ContentPart as ContentPart +from chat_bidi_v2_pb2 import OutputItemAddedEvent as OutputItemAddedEvent +from chat_bidi_v2_pb2 import OutputItemDoneEvent as OutputItemDoneEvent +from chat_bidi_v2_pb2 import OutputTextDeltaEvent as OutputTextDeltaEvent +from chat_bidi_v2_pb2 import OutputTextDoneEvent as OutputTextDoneEvent +from chat_bidi_v2_pb2 import OutputTextAnnotationAddedEvent as OutputTextAnnotationAddedEvent +from chat_bidi_v2_pb2 import ReasoningTextDeltaEvent as ReasoningTextDeltaEvent +from chat_bidi_v2_pb2 import ReasoningTextDoneEvent as ReasoningTextDoneEvent +from chat_bidi_v2_pb2 import ToolCallArgumentsDeltaEvent as ToolCallArgumentsDeltaEvent +from chat_bidi_v2_pb2 import ToolCallArgumentsDoneEvent as ToolCallArgumentsDoneEvent +from chat_bidi_v2_pb2 import ToolCallInProgressEvent as ToolCallInProgressEvent +from chat_bidi_v2_pb2 import ToolCallCompletedEvent as ToolCallCompletedEvent +from chat_bidi_v2_pb2 import ToolCallFailedEvent as ToolCallFailedEvent +from chat_bidi_v2_pb2 import ErrorEvent as ErrorEvent +from chat_bidi_v2_pb2 import StreamError as StreamError +from chat_bidi_v2_pb2 import ClientEvent as ClientEvent +from chat_bidi_v2_pb2 import ToolResultEvent as ToolResultEvent +from chat_bidi_v2_pb2 import CancelResponseEvent as CancelResponseEvent +from chat_bidi_v2_pb2 import ConversationRequest as ConversationRequest +from chat_bidi_v2_pb2 import InputItem as InputItem +from chat_bidi_v2_pb2 import InputMessage as InputMessage +from chat_bidi_v2_pb2 import FunctionCallOutput as FunctionCallOutput +from chat_bidi_v2_pb2 import AgentRole as AgentRole DESCRIPTOR: _descriptor.FileDescriptor - -class IncludeOption(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INCLUDE_OPTION_INVALID: _ClassVar[IncludeOption] - INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_MCP_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_INLINE_CITATIONS: _ClassVar[IncludeOption] - INCLUDE_OPTION_VERBOSE_STREAMING: _ClassVar[IncludeOption] - -class MessageRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INVALID_ROLE: _ClassVar[MessageRole] - ROLE_USER: _ClassVar[MessageRole] - ROLE_ASSISTANT: _ClassVar[MessageRole] - ROLE_SYSTEM: _ClassVar[MessageRole] - ROLE_FUNCTION: _ClassVar[MessageRole] - ROLE_TOOL: _ClassVar[MessageRole] - ROLE_DEVELOPER: _ClassVar[MessageRole] - -class ReasoningEffort(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INVALID_EFFORT: _ClassVar[ReasoningEffort] - EFFORT_LOW: _ClassVar[ReasoningEffort] - EFFORT_MEDIUM: _ClassVar[ReasoningEffort] - EFFORT_HIGH: _ClassVar[ReasoningEffort] - EFFORT_NONE: _ClassVar[ReasoningEffort] - -class AgentCount(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - AGENT_COUNT_UNSPECIFIED: _ClassVar[AgentCount] - AGENT_COUNT_4: _ClassVar[AgentCount] - AGENT_COUNT_16: _ClassVar[AgentCount] - -class ToolMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOOL_MODE_INVALID: _ClassVar[ToolMode] - TOOL_MODE_AUTO: _ClassVar[ToolMode] - TOOL_MODE_NONE: _ClassVar[ToolMode] - TOOL_MODE_REQUIRED: _ClassVar[ToolMode] - -class FormatType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - FORMAT_TYPE_INVALID: _ClassVar[FormatType] - FORMAT_TYPE_TEXT: _ClassVar[FormatType] - FORMAT_TYPE_JSON_OBJECT: _ClassVar[FormatType] - FORMAT_TYPE_JSON_SCHEMA: _ClassVar[FormatType] - -class ToolCallType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOOL_CALL_TYPE_INVALID: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_CLIENT_SIDE_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_WEB_SEARCH_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_X_SEARCH_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_CODE_EXECUTION_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_MCP_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: _ClassVar[ToolCallType] - -class ToolCallStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOOL_CALL_STATUS_IN_PROGRESS: _ClassVar[ToolCallStatus] - TOOL_CALL_STATUS_COMPLETED: _ClassVar[ToolCallStatus] - TOOL_CALL_STATUS_INCOMPLETE: _ClassVar[ToolCallStatus] - TOOL_CALL_STATUS_FAILED: _ClassVar[ToolCallStatus] +INVALID_ROLE: _chat_types_pb2.MessageRole +ROLE_USER: _chat_types_pb2.MessageRole +ROLE_ASSISTANT: _chat_types_pb2.MessageRole +ROLE_SYSTEM: _chat_types_pb2.MessageRole +ROLE_FUNCTION: _chat_types_pb2.MessageRole +ROLE_TOOL: _chat_types_pb2.MessageRole +ROLE_DEVELOPER: _chat_types_pb2.MessageRole +INVALID_EFFORT: _chat_types_pb2.ReasoningEffort +EFFORT_LOW: _chat_types_pb2.ReasoningEffort +EFFORT_MEDIUM: _chat_types_pb2.ReasoningEffort +EFFORT_HIGH: _chat_types_pb2.ReasoningEffort +EFFORT_NONE: _chat_types_pb2.ReasoningEffort +AGENT_COUNT_UNSPECIFIED: _chat_types_pb2.AgentCount +AGENT_COUNT_4: _chat_types_pb2.AgentCount +AGENT_COUNT_16: _chat_types_pb2.AgentCount +INCLUDE_OPTION_INVALID: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_MCP_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_INLINE_CITATIONS: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_VERBOSE_STREAMING: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_CODE_EXECUTION_FILES_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_TOOL_CALL_STREAMING: _chat_types_pb2.IncludeOption +TOOL_MODE_INVALID: _chat_types_pb2.ToolMode +TOOL_MODE_AUTO: _chat_types_pb2.ToolMode +TOOL_MODE_NONE: _chat_types_pb2.ToolMode +TOOL_MODE_REQUIRED: _chat_types_pb2.ToolMode +FORMAT_TYPE_INVALID: _chat_types_pb2.FormatType +FORMAT_TYPE_TEXT: _chat_types_pb2.FormatType +FORMAT_TYPE_JSON_OBJECT: _chat_types_pb2.FormatType +FORMAT_TYPE_JSON_SCHEMA: _chat_types_pb2.FormatType +TOOL_CALL_TYPE_INVALID: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_CLIENT_SIDE_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_WEB_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_X_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_CODE_EXECUTION_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_MCP_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_CONNECTOR_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_LOCATIONS_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_STATUS_IN_PROGRESS: _chat_types_pb2.ToolCallStatus +TOOL_CALL_STATUS_COMPLETED: _chat_types_pb2.ToolCallStatus +TOOL_CALL_STATUS_INCOMPLETE: _chat_types_pb2.ToolCallStatus +TOOL_CALL_STATUS_FAILED: _chat_types_pb2.ToolCallStatus +AGENT_ROLE_UNSPECIFIED: _chat_bidi_v2_pb2.AgentRole +AGENT_ROLE_LEADER: _chat_bidi_v2_pb2.AgentRole +AGENT_ROLE_MEMBER: _chat_bidi_v2_pb2.AgentRole class SearchMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -86,57 +137,13 @@ class SearchMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): OFF_SEARCH_MODE: _ClassVar[SearchMode] ON_SEARCH_MODE: _ClassVar[SearchMode] AUTO_SEARCH_MODE: _ClassVar[SearchMode] -INCLUDE_OPTION_INVALID: IncludeOption -INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_MCP_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_INLINE_CITATIONS: IncludeOption -INCLUDE_OPTION_VERBOSE_STREAMING: IncludeOption -INVALID_ROLE: MessageRole -ROLE_USER: MessageRole -ROLE_ASSISTANT: MessageRole -ROLE_SYSTEM: MessageRole -ROLE_FUNCTION: MessageRole -ROLE_TOOL: MessageRole -ROLE_DEVELOPER: MessageRole -INVALID_EFFORT: ReasoningEffort -EFFORT_LOW: ReasoningEffort -EFFORT_MEDIUM: ReasoningEffort -EFFORT_HIGH: ReasoningEffort -EFFORT_NONE: ReasoningEffort -AGENT_COUNT_UNSPECIFIED: AgentCount -AGENT_COUNT_4: AgentCount -AGENT_COUNT_16: AgentCount -TOOL_MODE_INVALID: ToolMode -TOOL_MODE_AUTO: ToolMode -TOOL_MODE_NONE: ToolMode -TOOL_MODE_REQUIRED: ToolMode -FORMAT_TYPE_INVALID: FormatType -FORMAT_TYPE_TEXT: FormatType -FORMAT_TYPE_JSON_OBJECT: FormatType -FORMAT_TYPE_JSON_SCHEMA: FormatType -TOOL_CALL_TYPE_INVALID: ToolCallType -TOOL_CALL_TYPE_CLIENT_SIDE_TOOL: ToolCallType -TOOL_CALL_TYPE_WEB_SEARCH_TOOL: ToolCallType -TOOL_CALL_TYPE_X_SEARCH_TOOL: ToolCallType -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_STATUS_IN_PROGRESS: ToolCallStatus -TOOL_CALL_STATUS_COMPLETED: ToolCallStatus -TOOL_CALL_STATUS_INCOMPLETE: ToolCallStatus -TOOL_CALL_STATUS_FAILED: ToolCallStatus INVALID_SEARCH_MODE: SearchMode OFF_SEARCH_MODE: SearchMode ON_SEARCH_MODE: SearchMode AUTO_SEARCH_MODE: SearchMode class GetCompletionsRequest(_message.Message): - __slots__ = ("messages", "model", "user", "n", "max_tokens", "seed", "stop", "temperature", "top_p", "logprobs", "top_logprobs", "tools", "tool_choice", "response_format", "frequency_penalty", "presence_penalty", "reasoning_effort", "search_parameters", "parallel_tool_calls", "previous_response_id", "store_messages", "use_encrypted_content", "max_turns", "include", "agent_count") + __slots__ = ("messages", "model", "user", "n", "max_tokens", "seed", "stop", "temperature", "top_p", "logprobs", "top_logprobs", "tools", "tool_choice", "response_format", "frequency_penalty", "presence_penalty", "reasoning_effort", "search_parameters", "parallel_tool_calls", "previous_response_id", "store_messages", "use_encrypted_content", "max_turns", "include", "bootstrap_host", "bootstrap_room", "agent_count", "cache_salt", "service_tier") MESSAGES_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] USER_FIELD_NUMBER: _ClassVar[int] @@ -161,7 +168,11 @@ class GetCompletionsRequest(_message.Message): USE_ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] MAX_TURNS_FIELD_NUMBER: _ClassVar[int] INCLUDE_FIELD_NUMBER: _ClassVar[int] + BOOTSTRAP_HOST_FIELD_NUMBER: _ClassVar[int] + BOOTSTRAP_ROOM_FIELD_NUMBER: _ClassVar[int] AGENT_COUNT_FIELD_NUMBER: _ClassVar[int] + CACHE_SALT_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] messages: _containers.RepeatedCompositeFieldContainer[Message] model: str user: str @@ -173,24 +184,28 @@ class GetCompletionsRequest(_message.Message): top_p: float logprobs: bool top_logprobs: int - tools: _containers.RepeatedCompositeFieldContainer[Tool] - tool_choice: ToolChoice - response_format: ResponseFormat + tools: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Tool] + tool_choice: _chat_types_pb2.ToolChoice + response_format: _chat_types_pb2.ResponseFormat frequency_penalty: float presence_penalty: float - reasoning_effort: ReasoningEffort + reasoning_effort: _chat_types_pb2.ReasoningEffort search_parameters: SearchParameters parallel_tool_calls: bool previous_response_id: str store_messages: bool use_encrypted_content: bool max_turns: int - include: _containers.RepeatedScalarFieldContainer[IncludeOption] - agent_count: AgentCount - def __init__(self, messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., model: _Optional[str] = ..., user: _Optional[str] = ..., n: _Optional[int] = ..., max_tokens: _Optional[int] = ..., seed: _Optional[int] = ..., stop: _Optional[_Iterable[str]] = ..., temperature: _Optional[float] = ..., top_p: _Optional[float] = ..., logprobs: bool = ..., top_logprobs: _Optional[int] = ..., tools: _Optional[_Iterable[_Union[Tool, _Mapping]]] = ..., tool_choice: _Optional[_Union[ToolChoice, _Mapping]] = ..., response_format: _Optional[_Union[ResponseFormat, _Mapping]] = ..., frequency_penalty: _Optional[float] = ..., presence_penalty: _Optional[float] = ..., reasoning_effort: _Optional[_Union[ReasoningEffort, str]] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., parallel_tool_calls: bool = ..., previous_response_id: _Optional[str] = ..., store_messages: bool = ..., use_encrypted_content: bool = ..., max_turns: _Optional[int] = ..., include: _Optional[_Iterable[_Union[IncludeOption, str]]] = ..., agent_count: _Optional[_Union[AgentCount, str]] = ...) -> None: ... + include: _containers.RepeatedScalarFieldContainer[_chat_types_pb2.IncludeOption] + bootstrap_host: str + bootstrap_room: int + agent_count: _chat_types_pb2.AgentCount + cache_salt: str + service_tier: _usage_pb2.ServiceTier + def __init__(self, messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., model: _Optional[str] = ..., user: _Optional[str] = ..., n: _Optional[int] = ..., max_tokens: _Optional[int] = ..., seed: _Optional[int] = ..., stop: _Optional[_Iterable[str]] = ..., temperature: _Optional[float] = ..., top_p: _Optional[float] = ..., logprobs: bool = ..., top_logprobs: _Optional[int] = ..., tools: _Optional[_Iterable[_Union[_chat_types_pb2.Tool, _Mapping]]] = ..., tool_choice: _Optional[_Union[_chat_types_pb2.ToolChoice, _Mapping]] = ..., response_format: _Optional[_Union[_chat_types_pb2.ResponseFormat, _Mapping]] = ..., frequency_penalty: _Optional[float] = ..., presence_penalty: _Optional[float] = ..., reasoning_effort: _Optional[_Union[_chat_types_pb2.ReasoningEffort, str]] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., parallel_tool_calls: bool = ..., previous_response_id: _Optional[str] = ..., store_messages: bool = ..., use_encrypted_content: bool = ..., max_turns: _Optional[int] = ..., include: _Optional[_Iterable[_Union[_chat_types_pb2.IncludeOption, str]]] = ..., bootstrap_host: _Optional[str] = ..., bootstrap_room: _Optional[int] = ..., agent_count: _Optional[_Union[_chat_types_pb2.AgentCount, str]] = ..., cache_salt: _Optional[str] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetChatCompletionResponse(_message.Message): - __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "settings", "debug_output") + __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "settings", "debug_output", "output_files", "input_messages", "service_tier") ID_FIELD_NUMBER: _ClassVar[int] OUTPUTS_FIELD_NUMBER: _ClassVar[int] CREATED_FIELD_NUMBER: _ClassVar[int] @@ -200,6 +215,9 @@ class GetChatCompletionResponse(_message.Message): CITATIONS_FIELD_NUMBER: _ClassVar[int] SETTINGS_FIELD_NUMBER: _ClassVar[int] DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FILES_FIELD_NUMBER: _ClassVar[int] + INPUT_MESSAGES_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] id: str outputs: _containers.RepeatedCompositeFieldContainer[CompletionOutput] created: _timestamp_pb2.Timestamp @@ -209,10 +227,13 @@ class GetChatCompletionResponse(_message.Message): citations: _containers.RepeatedScalarFieldContainer[str] settings: RequestSettings debug_output: DebugOutput - def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutput, _Mapping]]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., settings: _Optional[_Union[RequestSettings, _Mapping]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ...) -> None: ... + output_files: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.OutputFile] + input_messages: _containers.RepeatedCompositeFieldContainer[Message] + service_tier: _usage_pb2.ServiceTier + def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutput, _Mapping]]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., settings: _Optional[_Union[RequestSettings, _Mapping]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ..., output_files: _Optional[_Iterable[_Union[_chat_types_pb2.OutputFile, _Mapping]]] = ..., input_messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetChatCompletionChunk(_message.Message): - __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "debug_output") + __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "debug_output", "output_files", "service_tier") ID_FIELD_NUMBER: _ClassVar[int] OUTPUTS_FIELD_NUMBER: _ClassVar[int] CREATED_FIELD_NUMBER: _ClassVar[int] @@ -221,6 +242,8 @@ class GetChatCompletionChunk(_message.Message): USAGE_FIELD_NUMBER: _ClassVar[int] CITATIONS_FIELD_NUMBER: _ClassVar[int] DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FILES_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] id: str outputs: _containers.RepeatedCompositeFieldContainer[CompletionOutputChunk] created: _timestamp_pb2.Timestamp @@ -229,7 +252,9 @@ class GetChatCompletionChunk(_message.Message): usage: _usage_pb2.SamplingUsage citations: _containers.RepeatedScalarFieldContainer[str] debug_output: DebugOutput - def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutputChunk, _Mapping]]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ...) -> None: ... + output_files: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.OutputFile] + service_tier: _usage_pb2.ServiceTier + def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutputChunk, _Mapping]]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ..., output_files: _Optional[_Iterable[_Union[_chat_types_pb2.OutputFile, _Mapping]]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetDeferredCompletionResponse(_message.Message): __slots__ = ("status", "response") @@ -252,20 +277,22 @@ class CompletionOutput(_message.Message): def __init__(self, finish_reason: _Optional[_Union[_sample_pb2.FinishReason, str]] = ..., index: _Optional[int] = ..., message: _Optional[_Union[CompletionMessage, _Mapping]] = ..., logprobs: _Optional[_Union[LogProbs, _Mapping]] = ...) -> None: ... class CompletionMessage(_message.Message): - __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations") + __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations", "is_reasoning_content_summarized") CONTENT_FIELD_NUMBER: _ClassVar[int] REASONING_CONTENT_FIELD_NUMBER: _ClassVar[int] ROLE_FIELD_NUMBER: _ClassVar[int] TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] CITATIONS_FIELD_NUMBER: _ClassVar[int] + IS_REASONING_CONTENT_SUMMARIZED_FIELD_NUMBER: _ClassVar[int] content: str reasoning_content: str - role: MessageRole - tool_calls: _containers.RepeatedCompositeFieldContainer[ToolCall] + role: _chat_types_pb2.MessageRole + tool_calls: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.ToolCall] encrypted_content: str - citations: _containers.RepeatedCompositeFieldContainer[InlineCitation] - def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[InlineCitation, _Mapping]]] = ...) -> None: ... + citations: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.InlineCitation] + is_reasoning_content_summarized: bool + def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[_chat_types_pb2.MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[_chat_types_pb2.ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[_chat_types_pb2.InlineCitation, _Mapping]]] = ..., is_reasoning_content_summarized: bool = ...) -> None: ... class CompletionOutputChunk(_message.Message): __slots__ = ("delta", "logprobs", "finish_reason", "index") @@ -280,62 +307,22 @@ class CompletionOutputChunk(_message.Message): def __init__(self, delta: _Optional[_Union[Delta, _Mapping]] = ..., logprobs: _Optional[_Union[LogProbs, _Mapping]] = ..., finish_reason: _Optional[_Union[_sample_pb2.FinishReason, str]] = ..., index: _Optional[int] = ...) -> None: ... class Delta(_message.Message): - __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations") + __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations", "is_reasoning_content_summarized") CONTENT_FIELD_NUMBER: _ClassVar[int] REASONING_CONTENT_FIELD_NUMBER: _ClassVar[int] ROLE_FIELD_NUMBER: _ClassVar[int] TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] CITATIONS_FIELD_NUMBER: _ClassVar[int] + IS_REASONING_CONTENT_SUMMARIZED_FIELD_NUMBER: _ClassVar[int] content: str reasoning_content: str - role: MessageRole - tool_calls: _containers.RepeatedCompositeFieldContainer[ToolCall] + role: _chat_types_pb2.MessageRole + tool_calls: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.ToolCall] encrypted_content: str - citations: _containers.RepeatedCompositeFieldContainer[InlineCitation] - def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[InlineCitation, _Mapping]]] = ...) -> None: ... - -class InlineCitation(_message.Message): - __slots__ = ("id", "start_index", "end_index", "web_citation", "x_citation", "collections_citation") - ID_FIELD_NUMBER: _ClassVar[int] - START_INDEX_FIELD_NUMBER: _ClassVar[int] - END_INDEX_FIELD_NUMBER: _ClassVar[int] - WEB_CITATION_FIELD_NUMBER: _ClassVar[int] - X_CITATION_FIELD_NUMBER: _ClassVar[int] - COLLECTIONS_CITATION_FIELD_NUMBER: _ClassVar[int] - id: str - start_index: int - end_index: int - web_citation: WebCitation - x_citation: XCitation - collections_citation: CollectionsCitation - def __init__(self, id: _Optional[str] = ..., start_index: _Optional[int] = ..., end_index: _Optional[int] = ..., web_citation: _Optional[_Union[WebCitation, _Mapping]] = ..., x_citation: _Optional[_Union[XCitation, _Mapping]] = ..., collections_citation: _Optional[_Union[CollectionsCitation, _Mapping]] = ...) -> None: ... - -class WebCitation(_message.Message): - __slots__ = ("url",) - URL_FIELD_NUMBER: _ClassVar[int] - url: str - def __init__(self, url: _Optional[str] = ...) -> None: ... - -class XCitation(_message.Message): - __slots__ = ("url",) - URL_FIELD_NUMBER: _ClassVar[int] - url: str - def __init__(self, url: _Optional[str] = ...) -> None: ... - -class CollectionsCitation(_message.Message): - __slots__ = ("file_id", "chunk_id", "chunk_content", "score", "collection_ids") - FILE_ID_FIELD_NUMBER: _ClassVar[int] - CHUNK_ID_FIELD_NUMBER: _ClassVar[int] - CHUNK_CONTENT_FIELD_NUMBER: _ClassVar[int] - SCORE_FIELD_NUMBER: _ClassVar[int] - COLLECTION_IDS_FIELD_NUMBER: _ClassVar[int] - file_id: str - chunk_id: str - chunk_content: str - score: float - collection_ids: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, file_id: _Optional[str] = ..., chunk_id: _Optional[str] = ..., chunk_content: _Optional[str] = ..., score: _Optional[float] = ..., collection_ids: _Optional[_Iterable[str]] = ...) -> None: ... + citations: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.InlineCitation] + is_reasoning_content_summarized: bool + def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[_chat_types_pb2.MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[_chat_types_pb2.ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[_chat_types_pb2.InlineCitation, _Mapping]]] = ..., is_reasoning_content_summarized: bool = ...) -> None: ... class LogProbs(_message.Message): __slots__ = ("content",) @@ -365,30 +352,6 @@ class TopLogProb(_message.Message): bytes: bytes def __init__(self, token: _Optional[str] = ..., logprob: _Optional[float] = ..., bytes: _Optional[bytes] = ...) -> None: ... -class Content(_message.Message): - __slots__ = ("text", "image_url", "file") - TEXT_FIELD_NUMBER: _ClassVar[int] - IMAGE_URL_FIELD_NUMBER: _ClassVar[int] - FILE_FIELD_NUMBER: _ClassVar[int] - text: str - image_url: _image_pb2.ImageUrlContent - file: FileContent - def __init__(self, text: _Optional[str] = ..., image_url: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., file: _Optional[_Union[FileContent, _Mapping]] = ...) -> None: ... - -class FileContent(_message.Message): - __slots__ = ("file_id", "data", "filename", "mime_type", "url") - FILE_ID_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - FILENAME_FIELD_NUMBER: _ClassVar[int] - MIME_TYPE_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - file_id: str - data: bytes - filename: str - mime_type: str - url: str - def __init__(self, file_id: _Optional[str] = ..., data: _Optional[bytes] = ..., filename: _Optional[str] = ..., mime_type: _Optional[str] = ..., url: _Optional[str] = ...) -> None: ... - class Message(_message.Message): __slots__ = ("content", "reasoning_content", "role", "name", "tool_calls", "encrypted_content", "tool_call_id") CONTENT_FIELD_NUMBER: _ClassVar[int] @@ -398,173 +361,14 @@ class Message(_message.Message): TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] TOOL_CALL_ID_FIELD_NUMBER: _ClassVar[int] - content: _containers.RepeatedCompositeFieldContainer[Content] + content: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Content] reasoning_content: str - role: MessageRole + role: _chat_types_pb2.MessageRole name: str - tool_calls: _containers.RepeatedCompositeFieldContainer[ToolCall] + tool_calls: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.ToolCall] encrypted_content: str tool_call_id: str - def __init__(self, content: _Optional[_Iterable[_Union[Content, _Mapping]]] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[MessageRole, str]] = ..., name: _Optional[str] = ..., tool_calls: _Optional[_Iterable[_Union[ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., tool_call_id: _Optional[str] = ...) -> None: ... - -class ToolChoice(_message.Message): - __slots__ = ("mode", "function_name") - MODE_FIELD_NUMBER: _ClassVar[int] - FUNCTION_NAME_FIELD_NUMBER: _ClassVar[int] - mode: ToolMode - function_name: str - 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") - FUNCTION_FIELD_NUMBER: _ClassVar[int] - WEB_SEARCH_FIELD_NUMBER: _ClassVar[int] - X_SEARCH_FIELD_NUMBER: _ClassVar[int] - CODE_EXECUTION_FIELD_NUMBER: _ClassVar[int] - COLLECTIONS_SEARCH_FIELD_NUMBER: _ClassVar[int] - MCP_FIELD_NUMBER: _ClassVar[int] - ATTACHMENT_SEARCH_FIELD_NUMBER: _ClassVar[int] - function: Function - web_search: WebSearch - x_search: XSearch - code_execution: CodeExecution - 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: ... - -class MCP(_message.Message): - __slots__ = ("server_label", "server_description", "server_url", "allowed_tool_names", "authorization", "extra_headers") - class ExtraHeadersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - SERVER_LABEL_FIELD_NUMBER: _ClassVar[int] - SERVER_DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - SERVER_URL_FIELD_NUMBER: _ClassVar[int] - ALLOWED_TOOL_NAMES_FIELD_NUMBER: _ClassVar[int] - AUTHORIZATION_FIELD_NUMBER: _ClassVar[int] - EXTRA_HEADERS_FIELD_NUMBER: _ClassVar[int] - server_label: str - server_description: str - server_url: str - allowed_tool_names: _containers.RepeatedScalarFieldContainer[str] - authorization: str - extra_headers: _containers.ScalarMap[str, str] - def __init__(self, server_label: _Optional[str] = ..., server_description: _Optional[str] = ..., server_url: _Optional[str] = ..., allowed_tool_names: _Optional[_Iterable[str]] = ..., authorization: _Optional[str] = ..., extra_headers: _Optional[_Mapping[str, str]] = ...) -> None: ... - -class WebSearch(_message.Message): - __slots__ = ("excluded_domains", "allowed_domains", "enable_image_understanding", "user_location", "enable_image_search") - EXCLUDED_DOMAINS_FIELD_NUMBER: _ClassVar[int] - ALLOWED_DOMAINS_FIELD_NUMBER: _ClassVar[int] - ENABLE_IMAGE_UNDERSTANDING_FIELD_NUMBER: _ClassVar[int] - USER_LOCATION_FIELD_NUMBER: _ClassVar[int] - ENABLE_IMAGE_SEARCH_FIELD_NUMBER: _ClassVar[int] - excluded_domains: _containers.RepeatedScalarFieldContainer[str] - allowed_domains: _containers.RepeatedScalarFieldContainer[str] - enable_image_understanding: bool - user_location: WebSearchUserLocation - enable_image_search: bool - def __init__(self, excluded_domains: _Optional[_Iterable[str]] = ..., allowed_domains: _Optional[_Iterable[str]] = ..., enable_image_understanding: bool = ..., user_location: _Optional[_Union[WebSearchUserLocation, _Mapping]] = ..., enable_image_search: bool = ...) -> None: ... - -class WebSearchUserLocation(_message.Message): - __slots__ = ("country", "city", "region", "timezone") - COUNTRY_FIELD_NUMBER: _ClassVar[int] - CITY_FIELD_NUMBER: _ClassVar[int] - REGION_FIELD_NUMBER: _ClassVar[int] - TIMEZONE_FIELD_NUMBER: _ClassVar[int] - country: str - city: str - region: str - timezone: str - def __init__(self, country: _Optional[str] = ..., city: _Optional[str] = ..., region: _Optional[str] = ..., timezone: _Optional[str] = ...) -> None: ... - -class XSearch(_message.Message): - __slots__ = ("from_date", "to_date", "allowed_x_handles", "excluded_x_handles", "enable_image_understanding", "enable_video_understanding") - FROM_DATE_FIELD_NUMBER: _ClassVar[int] - TO_DATE_FIELD_NUMBER: _ClassVar[int] - ALLOWED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - EXCLUDED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - ENABLE_IMAGE_UNDERSTANDING_FIELD_NUMBER: _ClassVar[int] - ENABLE_VIDEO_UNDERSTANDING_FIELD_NUMBER: _ClassVar[int] - from_date: _timestamp_pb2.Timestamp - to_date: _timestamp_pb2.Timestamp - allowed_x_handles: _containers.RepeatedScalarFieldContainer[str] - excluded_x_handles: _containers.RepeatedScalarFieldContainer[str] - enable_image_understanding: bool - enable_video_understanding: bool - def __init__(self, from_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., to_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., allowed_x_handles: _Optional[_Iterable[str]] = ..., excluded_x_handles: _Optional[_Iterable[str]] = ..., enable_image_understanding: bool = ..., enable_video_understanding: bool = ...) -> None: ... - -class CodeExecution(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class CollectionsSearch(_message.Message): - __slots__ = ("collection_ids", "limit", "instructions", "hybrid_retrieval", "semantic_retrieval", "keyword_retrieval") - COLLECTION_IDS_FIELD_NUMBER: _ClassVar[int] - LIMIT_FIELD_NUMBER: _ClassVar[int] - INSTRUCTIONS_FIELD_NUMBER: _ClassVar[int] - HYBRID_RETRIEVAL_FIELD_NUMBER: _ClassVar[int] - SEMANTIC_RETRIEVAL_FIELD_NUMBER: _ClassVar[int] - KEYWORD_RETRIEVAL_FIELD_NUMBER: _ClassVar[int] - collection_ids: _containers.RepeatedScalarFieldContainer[str] - limit: int - instructions: str - hybrid_retrieval: _documents_pb2.HybridRetrieval - semantic_retrieval: _documents_pb2.SemanticRetrieval - keyword_retrieval: _documents_pb2.KeywordRetrieval - def __init__(self, collection_ids: _Optional[_Iterable[str]] = ..., limit: _Optional[int] = ..., instructions: _Optional[str] = ..., hybrid_retrieval: _Optional[_Union[_documents_pb2.HybridRetrieval, _Mapping]] = ..., semantic_retrieval: _Optional[_Union[_documents_pb2.SemanticRetrieval, _Mapping]] = ..., keyword_retrieval: _Optional[_Union[_documents_pb2.KeywordRetrieval, _Mapping]] = ...) -> None: ... - -class AttachmentSearch(_message.Message): - __slots__ = ("limit",) - LIMIT_FIELD_NUMBER: _ClassVar[int] - limit: int - def __init__(self, limit: _Optional[int] = ...) -> None: ... - -class Function(_message.Message): - __slots__ = ("name", "description", "strict", "parameters") - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - STRICT_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - name: str - description: str - strict: bool - parameters: str - def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., strict: bool = ..., parameters: _Optional[str] = ...) -> None: ... - -class ToolCall(_message.Message): - __slots__ = ("id", "type", "status", "error_message", "function") - ID_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - ERROR_MESSAGE_FIELD_NUMBER: _ClassVar[int] - FUNCTION_FIELD_NUMBER: _ClassVar[int] - id: str - type: ToolCallType - status: ToolCallStatus - error_message: str - function: FunctionCall - def __init__(self, id: _Optional[str] = ..., type: _Optional[_Union[ToolCallType, str]] = ..., status: _Optional[_Union[ToolCallStatus, str]] = ..., error_message: _Optional[str] = ..., function: _Optional[_Union[FunctionCall, _Mapping]] = ...) -> None: ... - -class FunctionCall(_message.Message): - __slots__ = ("name", "arguments") - NAME_FIELD_NUMBER: _ClassVar[int] - ARGUMENTS_FIELD_NUMBER: _ClassVar[int] - name: str - arguments: str - def __init__(self, name: _Optional[str] = ..., arguments: _Optional[str] = ...) -> None: ... - -class ResponseFormat(_message.Message): - __slots__ = ("format_type", "schema") - FORMAT_TYPE_FIELD_NUMBER: _ClassVar[int] - SCHEMA_FIELD_NUMBER: _ClassVar[int] - format_type: FormatType - schema: str - def __init__(self, format_type: _Optional[_Union[FormatType, str]] = ..., schema: _Optional[str] = ...) -> None: ... + def __init__(self, content: _Optional[_Iterable[_Union[_chat_types_pb2.Content, _Mapping]]] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[_chat_types_pb2.MessageRole, str]] = ..., name: _Optional[str] = ..., tool_calls: _Optional[_Iterable[_Union[_chat_types_pb2.ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., tool_call_id: _Optional[str] = ...) -> None: ... class SearchParameters(_message.Message): __slots__ = ("mode", "sources", "from_date", "to_date", "return_citations", "max_search_results") @@ -575,64 +379,12 @@ class SearchParameters(_message.Message): RETURN_CITATIONS_FIELD_NUMBER: _ClassVar[int] MAX_SEARCH_RESULTS_FIELD_NUMBER: _ClassVar[int] mode: SearchMode - sources: _containers.RepeatedCompositeFieldContainer[Source] + sources: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Source] from_date: _timestamp_pb2.Timestamp to_date: _timestamp_pb2.Timestamp return_citations: bool max_search_results: int - def __init__(self, mode: _Optional[_Union[SearchMode, str]] = ..., sources: _Optional[_Iterable[_Union[Source, _Mapping]]] = ..., from_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., to_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., return_citations: bool = ..., max_search_results: _Optional[int] = ...) -> None: ... - -class Source(_message.Message): - __slots__ = ("web", "news", "x", "rss") - WEB_FIELD_NUMBER: _ClassVar[int] - NEWS_FIELD_NUMBER: _ClassVar[int] - X_FIELD_NUMBER: _ClassVar[int] - RSS_FIELD_NUMBER: _ClassVar[int] - web: WebSource - news: NewsSource - x: XSource - rss: RssSource - def __init__(self, web: _Optional[_Union[WebSource, _Mapping]] = ..., news: _Optional[_Union[NewsSource, _Mapping]] = ..., x: _Optional[_Union[XSource, _Mapping]] = ..., rss: _Optional[_Union[RssSource, _Mapping]] = ...) -> None: ... - -class WebSource(_message.Message): - __slots__ = ("excluded_websites", "allowed_websites", "country", "safe_search") - EXCLUDED_WEBSITES_FIELD_NUMBER: _ClassVar[int] - ALLOWED_WEBSITES_FIELD_NUMBER: _ClassVar[int] - COUNTRY_FIELD_NUMBER: _ClassVar[int] - SAFE_SEARCH_FIELD_NUMBER: _ClassVar[int] - excluded_websites: _containers.RepeatedScalarFieldContainer[str] - allowed_websites: _containers.RepeatedScalarFieldContainer[str] - country: str - safe_search: bool - def __init__(self, excluded_websites: _Optional[_Iterable[str]] = ..., allowed_websites: _Optional[_Iterable[str]] = ..., country: _Optional[str] = ..., safe_search: bool = ...) -> None: ... - -class NewsSource(_message.Message): - __slots__ = ("excluded_websites", "country", "safe_search") - EXCLUDED_WEBSITES_FIELD_NUMBER: _ClassVar[int] - COUNTRY_FIELD_NUMBER: _ClassVar[int] - SAFE_SEARCH_FIELD_NUMBER: _ClassVar[int] - excluded_websites: _containers.RepeatedScalarFieldContainer[str] - country: str - safe_search: bool - def __init__(self, excluded_websites: _Optional[_Iterable[str]] = ..., country: _Optional[str] = ..., safe_search: bool = ...) -> None: ... - -class XSource(_message.Message): - __slots__ = ("included_x_handles", "excluded_x_handles", "post_favorite_count", "post_view_count") - INCLUDED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - EXCLUDED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - POST_FAVORITE_COUNT_FIELD_NUMBER: _ClassVar[int] - POST_VIEW_COUNT_FIELD_NUMBER: _ClassVar[int] - included_x_handles: _containers.RepeatedScalarFieldContainer[str] - excluded_x_handles: _containers.RepeatedScalarFieldContainer[str] - post_favorite_count: int - post_view_count: int - def __init__(self, included_x_handles: _Optional[_Iterable[str]] = ..., excluded_x_handles: _Optional[_Iterable[str]] = ..., post_favorite_count: _Optional[int] = ..., post_view_count: _Optional[int] = ...) -> None: ... - -class RssSource(_message.Message): - __slots__ = ("links",) - LINKS_FIELD_NUMBER: _ClassVar[int] - links: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, links: _Optional[_Iterable[str]] = ...) -> None: ... + def __init__(self, mode: _Optional[_Union[SearchMode, str]] = ..., sources: _Optional[_Iterable[_Union[_chat_types_pb2.Source, _Mapping]]] = ..., from_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., to_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., return_citations: bool = ..., max_search_results: _Optional[int] = ...) -> None: ... class RequestSettings(_message.Message): __slots__ = ("max_tokens", "parallel_tool_calls", "previous_response_id", "reasoning_effort", "temperature", "response_format", "tool_choice", "tools", "top_p", "user", "search_parameters", "store_messages", "use_encrypted_content", "include") @@ -653,18 +405,28 @@ class RequestSettings(_message.Message): max_tokens: int parallel_tool_calls: bool previous_response_id: str - reasoning_effort: ReasoningEffort + reasoning_effort: _chat_types_pb2.ReasoningEffort temperature: float - response_format: ResponseFormat - tool_choice: ToolChoice - tools: _containers.RepeatedCompositeFieldContainer[Tool] + response_format: _chat_types_pb2.ResponseFormat + tool_choice: _chat_types_pb2.ToolChoice + tools: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Tool] top_p: float user: str search_parameters: SearchParameters store_messages: bool use_encrypted_content: bool - include: _containers.RepeatedScalarFieldContainer[IncludeOption] - def __init__(self, max_tokens: _Optional[int] = ..., parallel_tool_calls: bool = ..., previous_response_id: _Optional[str] = ..., reasoning_effort: _Optional[_Union[ReasoningEffort, str]] = ..., temperature: _Optional[float] = ..., response_format: _Optional[_Union[ResponseFormat, _Mapping]] = ..., tool_choice: _Optional[_Union[ToolChoice, _Mapping]] = ..., tools: _Optional[_Iterable[_Union[Tool, _Mapping]]] = ..., top_p: _Optional[float] = ..., user: _Optional[str] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., store_messages: bool = ..., use_encrypted_content: bool = ..., include: _Optional[_Iterable[_Union[IncludeOption, str]]] = ...) -> None: ... + include: _containers.RepeatedScalarFieldContainer[_chat_types_pb2.IncludeOption] + def __init__(self, max_tokens: _Optional[int] = ..., parallel_tool_calls: bool = ..., previous_response_id: _Optional[str] = ..., reasoning_effort: _Optional[_Union[_chat_types_pb2.ReasoningEffort, str]] = ..., temperature: _Optional[float] = ..., response_format: _Optional[_Union[_chat_types_pb2.ResponseFormat, _Mapping]] = ..., tool_choice: _Optional[_Union[_chat_types_pb2.ToolChoice, _Mapping]] = ..., tools: _Optional[_Iterable[_Union[_chat_types_pb2.Tool, _Mapping]]] = ..., top_p: _Optional[float] = ..., user: _Optional[str] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., store_messages: bool = ..., use_encrypted_content: bool = ..., include: _Optional[_Iterable[_Union[_chat_types_pb2.IncludeOption, str]]] = ...) -> None: ... + +class ResponseHistory(_message.Message): + __slots__ = ("messages", "response", "conversation_id") + MESSAGES_FIELD_NUMBER: _ClassVar[int] + RESPONSE_FIELD_NUMBER: _ClassVar[int] + CONVERSATION_ID_FIELD_NUMBER: _ClassVar[int] + messages: _containers.RepeatedCompositeFieldContainer[Message] + response: GetChatCompletionResponse + conversation_id: str + def __init__(self, messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., response: _Optional[_Union[GetChatCompletionResponse, _Mapping]] = ..., conversation_id: _Optional[str] = ...) -> None: ... class GetStoredCompletionRequest(_message.Message): __slots__ = ("response_id",) @@ -685,7 +447,7 @@ class DeleteStoredCompletionResponse(_message.Message): def __init__(self, response_id: _Optional[str] = ...) -> None: ... class DebugOutput(_message.Message): - __slots__ = ("attempts", "request", "prompt", "engine_request", "responses", "chunks", "cache_read_count", "cache_read_input_bytes", "cache_write_count", "cache_write_input_bytes", "lb_address", "sampler_tag") + __slots__ = ("attempts", "request", "prompt", "engine_request", "responses", "chunks", "cache_read_count", "cache_read_input_bytes", "cache_write_count", "cache_write_input_bytes", "lb_address", "sampler_tag", "sampler_checkpoint_mount") ATTEMPTS_FIELD_NUMBER: _ClassVar[int] REQUEST_FIELD_NUMBER: _ClassVar[int] PROMPT_FIELD_NUMBER: _ClassVar[int] @@ -698,6 +460,7 @@ class DebugOutput(_message.Message): CACHE_WRITE_INPUT_BYTES_FIELD_NUMBER: _ClassVar[int] LB_ADDRESS_FIELD_NUMBER: _ClassVar[int] SAMPLER_TAG_FIELD_NUMBER: _ClassVar[int] + SAMPLER_CHECKPOINT_MOUNT_FIELD_NUMBER: _ClassVar[int] attempts: int request: str prompt: str @@ -710,7 +473,8 @@ class DebugOutput(_message.Message): cache_write_input_bytes: int lb_address: str sampler_tag: str - def __init__(self, attempts: _Optional[int] = ..., request: _Optional[str] = ..., prompt: _Optional[str] = ..., engine_request: _Optional[str] = ..., responses: _Optional[_Iterable[str]] = ..., chunks: _Optional[_Iterable[str]] = ..., cache_read_count: _Optional[int] = ..., cache_read_input_bytes: _Optional[int] = ..., cache_write_count: _Optional[int] = ..., cache_write_input_bytes: _Optional[int] = ..., lb_address: _Optional[str] = ..., sampler_tag: _Optional[str] = ...) -> None: ... + sampler_checkpoint_mount: str + def __init__(self, attempts: _Optional[int] = ..., request: _Optional[str] = ..., prompt: _Optional[str] = ..., engine_request: _Optional[str] = ..., responses: _Optional[_Iterable[str]] = ..., chunks: _Optional[_Iterable[str]] = ..., cache_read_count: _Optional[int] = ..., cache_read_input_bytes: _Optional[int] = ..., cache_write_count: _Optional[int] = ..., cache_write_input_bytes: _Optional[int] = ..., lb_address: _Optional[str] = ..., sampler_tag: _Optional[str] = ..., sampler_checkpoint_mount: _Optional[str] = ...) -> None: ... class CompactContextRequest(_message.Message): __slots__ = ("model", "input") diff --git a/src/xai_sdk/proto/v5/image_pb2.py b/src/xai_sdk/proto/v5/image_pb2.py index 7a7c599..6fa4786 100644 --- a/src/xai_sdk/proto/v5/image_pb2.py +++ b/src/xai_sdk/proto/v5/image_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/image.proto -# Protobuf Python Version: 5.29.1 +# source: image.proto +# Protobuf Python Version: 5.28.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,46 +11,65 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 5, - 29, - 1, + 5, 0, 0, '', - 'xai/api/v1/image.proto' + 'image.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from . import usage_pb2 as usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/image.proto\x12\x07xai_api\x1a\x16xai/api/v1/usage.proto\"\xa9\x03\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\x06imagesB\x04\n\x02_nB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionJ\x04\x08\r\x10\x0e\"\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\"|\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\x11respectModerationB\x07\n\x05imageJ\x04\x08\x02\x10\x03\"\\\n\x0fImageUrlContent\x12\x1b\n\timage_url\x18\x01 \x01(\tR\x08imageUrl\x12,\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailR\x06\x64\x65tail*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\x0bimage.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0busage.proto\"\x9a\x05\n\x14GenerateImageRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\'\n\x05image\x18\x05 \x01(\x0b\x32\x18.xai_api.ImageUrlContent\x12\r\n\x05model\x18\x02 \x01(\t\x12\x0e\n\x01n\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x0c\n\x04user\x18\x04 \x01(\t\x12$\n\x06\x66ormat\x18\x0b \x01(\x0e\x32\x14.xai_api.ImageFormat\x12+\n\x07quality\x18\x0c \x01(\x0e\x32\x15.xai_api.ImageQualityH\x01\x88\x01\x01\x12\x34\n\x0c\x61spect_ratio\x18\x0e \x01(\x0e\x32\x19.xai_api.ImageAspectRatioH\x02\x88\x01\x01\x12\x31\n\nresolution\x18\x0f \x01(\x0e\x32\x18.xai_api.ImageResolutionH\x03\x88\x01\x01\x12\x31\n\nmoderation\x18\x10 \x01(\x0e\x32\x18.xai_api.ModerationLevelH\x04\x88\x01\x01\x12(\n\x06images\x18\x11 \x03(\x0b\x32\x18.xai_api.ImageUrlContent\x12/\n\x0fsafety_settings\x18\x12 \x03(\x0b\x32\x16.xai_api.SafetySetting\x12\x35\n\x0fstorage_options\x18\x13 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x05\x88\x01\x01\x12/\n\x0cservice_tier\x18\x14 \x01(\x0e\x32\x14.xai_api.ServiceTierH\x06\x88\x01\x01\x42\x04\n\x02_nB\n\n\x08_qualityB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\r\n\x0b_moderationB\x12\n\x10_storage_optionsB\x0f\n\r_service_tierJ\x04\x08\r\x10\x0e\"\xa5\x01\n\x0eStorageOptions\x12\x15\n\x08\x66ilename\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rexpires_after\x18\x02 \x01(\x03H\x01\x88\x01\x01\x12\x32\n\npublic_url\x18\x03 \x01(\x0b\x32\x19.xai_api.PublicUrlOptionsH\x02\x88\x01\x01\x42\x0b\n\t_filenameB\x10\n\x0e_expires_afterB\r\n\x0b_public_url\"@\n\x10PublicUrlOptions\x12\x1a\n\rexpires_after\x18\x01 \x01(\x03H\x00\x88\x01\x01\x42\x10\n\x0e_expires_after\"\xaf\x02\n\nFileOutput\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x10\n\x08\x66ilename\x18\x02 \x01(\t\x12\x17\n\npublic_url\x18\x04 \x01(\tH\x00\x88\x01\x01\x12>\n\x15public_url_expires_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x88\x01\x01\x12\x33\n\nexpires_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02\x88\x01\x01\x12\x1d\n\x10public_url_error\x18\x07 \x01(\tH\x03\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\"\x9a\x01\n\rImageResponse\x12\'\n\x06images\x18\x01 \x03(\x0b\x32\x17.xai_api.GeneratedImage\x12\r\n\x05model\x18\x02 \x01(\t\x12%\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12\x19\n\x0c\x62lock_reason\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_block_reason\"\x82\x03\n\x0eGeneratedImage\x12\x10\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00\x12\r\n\x03url\x18\x03 \x01(\tH\x00\x12\x19\n\x11up_sampled_prompt\x18\x02 \x01(\t\x12\x1a\n\x12respect_moderation\x18\x04 \x01(\x08\x12=\n\x0c\x64\x65\x62ug_output\x18\x05 \x01(\x0b\x32\".xai_api.GeneratedImageDebugOutputH\x01\x88\x01\x01\x12?\n\x15moderation_categories\x18\x06 \x03(\x0b\x32 .xai_api.ModerationCategoryScore\x12\x11\n\tmime_type\x18\x07 \x01(\t\x12-\n\x0b\x66ile_output\x18\x08 \x01(\x0b\x32\x13.xai_api.FileOutputH\x02\x88\x01\x01\x12\x1a\n\rstorage_error\x18\t \x01(\tH\x03\x88\x01\x01\x42\x07\n\x05imageB\x0f\n\r_debug_outputB\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"I\n\x17ModerationCategoryScore\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x01\x12\x11\n\tthreshold\x18\x03 \x01(\x01\"U\n\x0e\x43\x61ndidateImage\x12\x10\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00\x12\r\n\x03url\x18\x02 \x01(\tH\x00\x12\x19\n\x11up_sampled_prompt\x18\x03 \x01(\tB\x07\n\x05image\"\x93\x01\n\x19GeneratedImageDebugOutput\x12\x31\n\x10\x63\x61ndidate_images\x18\x01 \x03(\x0b\x32\x17.xai_api.CandidateImage\x12\x16\n\x0egrading_scores\x18\x02 \x03(\x05\x12\x16\n\x0e\x62\x65st_local_idx\x18\x03 \x01(\x05\x12\x13\n\x0braw_grading\x18\x04 \x01(\t\"i\n\x0fImageUrlContent\x12\x13\n\timage_url\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x66ile_id\x18\x03 \x01(\tH\x00\x12$\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailB\x08\n\x06source\"g\n\rSafetySetting\x12)\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32\x17.xai_api.SafetyCategory\x12+\n\tthreshold\x18\x02 \x01(\x0e\x32\x18.xai_api.SafetyThreshold*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*\x7f\n\x0fModerationLevel\x12\x1c\n\x18MODERATION_LEVEL_INVALID\x10\x00\x12\x18\n\x14MODERATION_LEVEL_LOW\x10\x01\x12\x19\n\x15MODERATION_LEVEL_AUTO\x10\x02\x12\x19\n\x15MODERATION_LEVEL_HIGH\x10\x03*\x7f\n\x0eSafetyCategory\x12\x1f\n\x1bSAFETY_CATEGORY_UNSPECIFIED\x10\x00\x12%\n!SAFETY_CATEGORY_SEXUALLY_EXPLICIT\x10\x01\x12%\n!SAFETY_CATEGORY_DANGEROUS_CONTENT\x10\x02*U\n\x0fSafetyThreshold\x12\x0f\n\x0b\x42LOCK_UNSET\x10\x00\x12\x17\n\x13\x42LOCK_LOW_THRESHOLD\x10\x01\x12\x18\n\x14\x42LOCK_HIGH_THRESHOLD\x10\x02\x32Q\n\x05Image\x12H\n\rGenerateImage\x12\x1d.xai_api.GenerateImageRequest\x1a\x16.xai_api.ImageResponse\"\x00\x42\x1eZ\x1cproxy/gen/go/xai_api;xai_apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.image_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'image_pb2', _globals) 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=842 - _globals['_IMAGEDETAIL']._serialized_end=925 - _globals['_IMAGEFORMAT']._serialized_start=927 - _globals['_IMAGEFORMAT']._serialized_end=1007 - _globals['_IMAGEQUALITY']._serialized_start=1009 - _globals['_IMAGEQUALITY']._serialized_end=1115 - _globals['_IMAGEASPECTRATIO']._serialized_start=1118 - _globals['_IMAGEASPECTRATIO']._serialized_end=1541 - _globals['_IMAGERESOLUTION']._serialized_start=1543 - _globals['_IMAGERESOLUTION']._serialized_end=1634 - _globals['_GENERATEIMAGEREQUEST']._serialized_start=60 - _globals['_GENERATEIMAGEREQUEST']._serialized_end=485 - _globals['_IMAGERESPONSE']._serialized_start=488 - _globals['_IMAGERESPONSE']._serialized_end=620 - _globals['_GENERATEDIMAGE']._serialized_start=622 - _globals['_GENERATEDIMAGE']._serialized_end=746 - _globals['_IMAGEURLCONTENT']._serialized_start=748 - _globals['_IMAGEURLCONTENT']._serialized_end=840 - _globals['_IMAGE']._serialized_start=1636 - _globals['_IMAGE']._serialized_end=1717 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_IMAGEDETAIL']._serialized_start=2349 + _globals['_IMAGEDETAIL']._serialized_end=2432 + _globals['_IMAGEFORMAT']._serialized_start=2434 + _globals['_IMAGEFORMAT']._serialized_end=2514 + _globals['_IMAGEQUALITY']._serialized_start=2516 + _globals['_IMAGEQUALITY']._serialized_end=2622 + _globals['_IMAGEASPECTRATIO']._serialized_start=2625 + _globals['_IMAGEASPECTRATIO']._serialized_end=3048 + _globals['_IMAGERESOLUTION']._serialized_start=3050 + _globals['_IMAGERESOLUTION']._serialized_end=3141 + _globals['_MODERATIONLEVEL']._serialized_start=3143 + _globals['_MODERATIONLEVEL']._serialized_end=3270 + _globals['_SAFETYCATEGORY']._serialized_start=3272 + _globals['_SAFETYCATEGORY']._serialized_end=3399 + _globals['_SAFETYTHRESHOLD']._serialized_start=3401 + _globals['_SAFETYTHRESHOLD']._serialized_end=3486 + _globals['_GENERATEIMAGEREQUEST']._serialized_start=71 + _globals['_GENERATEIMAGEREQUEST']._serialized_end=737 + _globals['_STORAGEOPTIONS']._serialized_start=740 + _globals['_STORAGEOPTIONS']._serialized_end=905 + _globals['_PUBLICURLOPTIONS']._serialized_start=907 + _globals['_PUBLICURLOPTIONS']._serialized_end=971 + _globals['_FILEOUTPUT']._serialized_start=974 + _globals['_FILEOUTPUT']._serialized_end=1277 + _globals['_IMAGERESPONSE']._serialized_start=1280 + _globals['_IMAGERESPONSE']._serialized_end=1434 + _globals['_GENERATEDIMAGE']._serialized_start=1437 + _globals['_GENERATEDIMAGE']._serialized_end=1823 + _globals['_MODERATIONCATEGORYSCORE']._serialized_start=1825 + _globals['_MODERATIONCATEGORYSCORE']._serialized_end=1898 + _globals['_CANDIDATEIMAGE']._serialized_start=1900 + _globals['_CANDIDATEIMAGE']._serialized_end=1985 + _globals['_GENERATEDIMAGEDEBUGOUTPUT']._serialized_start=1988 + _globals['_GENERATEDIMAGEDEBUGOUTPUT']._serialized_end=2135 + _globals['_IMAGEURLCONTENT']._serialized_start=2137 + _globals['_IMAGEURLCONTENT']._serialized_end=2242 + _globals['_SAFETYSETTING']._serialized_start=2244 + _globals['_SAFETYSETTING']._serialized_end=2347 + _globals['_IMAGE']._serialized_start=3488 + _globals['_IMAGE']._serialized_end=3569 # @@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 2bd7ac4..dd10e50 100644 --- a/src/xai_sdk/proto/v5/image_pb2.pyi +++ b/src/xai_sdk/proto/v5/image_pb2.pyi @@ -1,3 +1,4 @@ +from google.protobuf import timestamp_pb2 as _timestamp_pb2 from . import usage_pb2 as _usage_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper @@ -50,6 +51,25 @@ class ImageResolution(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): IMG_RESOLUTION_INVALID: _ClassVar[ImageResolution] IMG_RESOLUTION_1K: _ClassVar[ImageResolution] IMG_RESOLUTION_2K: _ClassVar[ImageResolution] + +class ModerationLevel(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + MODERATION_LEVEL_INVALID: _ClassVar[ModerationLevel] + MODERATION_LEVEL_LOW: _ClassVar[ModerationLevel] + MODERATION_LEVEL_AUTO: _ClassVar[ModerationLevel] + MODERATION_LEVEL_HIGH: _ClassVar[ModerationLevel] + +class SafetyCategory(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SAFETY_CATEGORY_UNSPECIFIED: _ClassVar[SafetyCategory] + SAFETY_CATEGORY_SEXUALLY_EXPLICIT: _ClassVar[SafetyCategory] + SAFETY_CATEGORY_DANGEROUS_CONTENT: _ClassVar[SafetyCategory] + +class SafetyThreshold(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + BLOCK_UNSET: _ClassVar[SafetyThreshold] + BLOCK_LOW_THRESHOLD: _ClassVar[SafetyThreshold] + BLOCK_HIGH_THRESHOLD: _ClassVar[SafetyThreshold] DETAIL_INVALID: ImageDetail DETAIL_AUTO: ImageDetail DETAIL_LOW: ImageDetail @@ -79,53 +99,161 @@ IMG_ASPECT_RATIO_2_1: ImageAspectRatio IMG_RESOLUTION_INVALID: ImageResolution IMG_RESOLUTION_1K: ImageResolution IMG_RESOLUTION_2K: ImageResolution +MODERATION_LEVEL_INVALID: ModerationLevel +MODERATION_LEVEL_LOW: ModerationLevel +MODERATION_LEVEL_AUTO: ModerationLevel +MODERATION_LEVEL_HIGH: ModerationLevel +SAFETY_CATEGORY_UNSPECIFIED: SafetyCategory +SAFETY_CATEGORY_SEXUALLY_EXPLICIT: SafetyCategory +SAFETY_CATEGORY_DANGEROUS_CONTENT: SafetyCategory +BLOCK_UNSET: SafetyThreshold +BLOCK_LOW_THRESHOLD: SafetyThreshold +BLOCK_HIGH_THRESHOLD: SafetyThreshold class GenerateImageRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "n", "user", "format", "aspect_ratio", "resolution", "images") + __slots__ = ("prompt", "image", "model", "n", "user", "format", "quality", "aspect_ratio", "resolution", "moderation", "images", "safety_settings", "storage_options", "service_tier") 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] + MODERATION_FIELD_NUMBER: _ClassVar[int] IMAGES_FIELD_NUMBER: _ClassVar[int] + SAFETY_SETTINGS_FIELD_NUMBER: _ClassVar[int] + STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] prompt: str image: ImageUrlContent model: str n: int user: str format: ImageFormat + quality: ImageQuality aspect_ratio: ImageAspectRatio resolution: ImageResolution + moderation: ModerationLevel images: _containers.RepeatedCompositeFieldContainer[ImageUrlContent] - 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]]] = ...) -> None: ... + safety_settings: _containers.RepeatedCompositeFieldContainer[SafetySetting] + storage_options: StorageOptions + service_tier: _usage_pb2.ServiceTier + 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]] = ..., moderation: _Optional[_Union[ModerationLevel, str]] = ..., images: _Optional[_Iterable[_Union[ImageUrlContent, _Mapping]]] = ..., safety_settings: _Optional[_Iterable[_Union[SafetySetting, _Mapping]]] = ..., storage_options: _Optional[_Union[StorageOptions, _Mapping]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... + +class StorageOptions(_message.Message): + __slots__ = ("filename", "expires_after", "public_url") + FILENAME_FIELD_NUMBER: _ClassVar[int] + EXPIRES_AFTER_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_FIELD_NUMBER: _ClassVar[int] + filename: str + expires_after: int + public_url: PublicUrlOptions + def __init__(self, filename: _Optional[str] = ..., expires_after: _Optional[int] = ..., public_url: _Optional[_Union[PublicUrlOptions, _Mapping]] = ...) -> None: ... + +class PublicUrlOptions(_message.Message): + __slots__ = ("expires_after",) + EXPIRES_AFTER_FIELD_NUMBER: _ClassVar[int] + expires_after: int + def __init__(self, expires_after: _Optional[int] = ...) -> None: ... + +class FileOutput(_message.Message): + __slots__ = ("file_id", "filename", "public_url", "public_url_expires_at", "expires_at", "public_url_error") + FILE_ID_FIELD_NUMBER: _ClassVar[int] + FILENAME_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] + EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_ERROR_FIELD_NUMBER: _ClassVar[int] + file_id: str + filename: str + public_url: str + public_url_expires_at: _timestamp_pb2.Timestamp + expires_at: _timestamp_pb2.Timestamp + public_url_error: str + def __init__(self, file_id: _Optional[str] = ..., filename: _Optional[str] = ..., public_url: _Optional[str] = ..., public_url_expires_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., expires_at: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., public_url_error: _Optional[str] = ...) -> None: ... class ImageResponse(_message.Message): - __slots__ = ("images", "model", "usage") + __slots__ = ("images", "model", "usage", "block_reason") IMAGES_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] USAGE_FIELD_NUMBER: _ClassVar[int] + BLOCK_REASON_FIELD_NUMBER: _ClassVar[int] images: _containers.RepeatedCompositeFieldContainer[GeneratedImage] model: str usage: _usage_pb2.SamplingUsage - def __init__(self, images: _Optional[_Iterable[_Union[GeneratedImage, _Mapping]]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ...) -> None: ... + block_reason: str + def __init__(self, images: _Optional[_Iterable[_Union[GeneratedImage, _Mapping]]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., block_reason: _Optional[str] = ...) -> None: ... class GeneratedImage(_message.Message): - __slots__ = ("base64", "url", "respect_moderation") + __slots__ = ("base64", "url", "up_sampled_prompt", "respect_moderation", "debug_output", "moderation_categories", "mime_type", "file_output", "storage_error") BASE64_FIELD_NUMBER: _ClassVar[int] URL_FIELD_NUMBER: _ClassVar[int] + UP_SAMPLED_PROMPT_FIELD_NUMBER: _ClassVar[int] RESPECT_MODERATION_FIELD_NUMBER: _ClassVar[int] + DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + MODERATION_CATEGORIES_FIELD_NUMBER: _ClassVar[int] + MIME_TYPE_FIELD_NUMBER: _ClassVar[int] + FILE_OUTPUT_FIELD_NUMBER: _ClassVar[int] + STORAGE_ERROR_FIELD_NUMBER: _ClassVar[int] base64: str url: str + up_sampled_prompt: str respect_moderation: bool - def __init__(self, base64: _Optional[str] = ..., url: _Optional[str] = ..., respect_moderation: bool = ...) -> None: ... + debug_output: GeneratedImageDebugOutput + moderation_categories: _containers.RepeatedCompositeFieldContainer[ModerationCategoryScore] + mime_type: str + file_output: FileOutput + storage_error: str + def __init__(self, base64: _Optional[str] = ..., url: _Optional[str] = ..., up_sampled_prompt: _Optional[str] = ..., respect_moderation: bool = ..., debug_output: _Optional[_Union[GeneratedImageDebugOutput, _Mapping]] = ..., moderation_categories: _Optional[_Iterable[_Union[ModerationCategoryScore, _Mapping]]] = ..., mime_type: _Optional[str] = ..., file_output: _Optional[_Union[FileOutput, _Mapping]] = ..., storage_error: _Optional[str] = ...) -> None: ... + +class ModerationCategoryScore(_message.Message): + __slots__ = ("name", "score", "threshold") + NAME_FIELD_NUMBER: _ClassVar[int] + SCORE_FIELD_NUMBER: _ClassVar[int] + THRESHOLD_FIELD_NUMBER: _ClassVar[int] + name: str + score: float + threshold: float + def __init__(self, name: _Optional[str] = ..., score: _Optional[float] = ..., threshold: _Optional[float] = ...) -> None: ... + +class CandidateImage(_message.Message): + __slots__ = ("base64", "url", "up_sampled_prompt") + BASE64_FIELD_NUMBER: _ClassVar[int] + URL_FIELD_NUMBER: _ClassVar[int] + UP_SAMPLED_PROMPT_FIELD_NUMBER: _ClassVar[int] + base64: str + url: str + up_sampled_prompt: str + def __init__(self, base64: _Optional[str] = ..., url: _Optional[str] = ..., up_sampled_prompt: _Optional[str] = ...) -> None: ... + +class GeneratedImageDebugOutput(_message.Message): + __slots__ = ("candidate_images", "grading_scores", "best_local_idx", "raw_grading") + CANDIDATE_IMAGES_FIELD_NUMBER: _ClassVar[int] + GRADING_SCORES_FIELD_NUMBER: _ClassVar[int] + BEST_LOCAL_IDX_FIELD_NUMBER: _ClassVar[int] + RAW_GRADING_FIELD_NUMBER: _ClassVar[int] + candidate_images: _containers.RepeatedCompositeFieldContainer[CandidateImage] + grading_scores: _containers.RepeatedScalarFieldContainer[int] + best_local_idx: int + raw_grading: str + def __init__(self, candidate_images: _Optional[_Iterable[_Union[CandidateImage, _Mapping]]] = ..., grading_scores: _Optional[_Iterable[int]] = ..., best_local_idx: _Optional[int] = ..., raw_grading: _Optional[str] = ...) -> None: ... class ImageUrlContent(_message.Message): - __slots__ = ("image_url", "detail") + __slots__ = ("image_url", "file_id", "detail") IMAGE_URL_FIELD_NUMBER: _ClassVar[int] + FILE_ID_FIELD_NUMBER: _ClassVar[int] DETAIL_FIELD_NUMBER: _ClassVar[int] image_url: str + file_id: str detail: ImageDetail - def __init__(self, image_url: _Optional[str] = ..., detail: _Optional[_Union[ImageDetail, str]] = ...) -> None: ... + def __init__(self, image_url: _Optional[str] = ..., file_id: _Optional[str] = ..., detail: _Optional[_Union[ImageDetail, str]] = ...) -> None: ... + +class SafetySetting(_message.Message): + __slots__ = ("category", "threshold") + CATEGORY_FIELD_NUMBER: _ClassVar[int] + THRESHOLD_FIELD_NUMBER: _ClassVar[int] + category: SafetyCategory + threshold: SafetyThreshold + def __init__(self, category: _Optional[_Union[SafetyCategory, str]] = ..., threshold: _Optional[_Union[SafetyThreshold, str]] = ...) -> None: ... diff --git a/src/xai_sdk/proto/v5/usage_pb2.py b/src/xai_sdk/proto/v5/usage_pb2.py index 5c7d3c6..77bb385 100644 --- a/src/xai_sdk/proto/v5/usage_pb2.py +++ b/src/xai_sdk/proto/v5/usage_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/usage.proto -# Protobuf Python Version: 5.29.1 +# source: usage.proto +# Protobuf Python Version: 5.28.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,11 +11,9 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 5, - 29, - 1, + 5, 0, 0, '', - 'xai/api/v1/usage.proto' + 'usage.proto' ) # @@protoc_insertion_point(imports) @@ -24,18 +22,20 @@ -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*\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\x0busage.proto\x12\x07xai_api\"\x80\x06\n\rSamplingUsage\x12\x19\n\x11\x63ompletion_tokens\x18\x01 \x01(\x05\x12\x18\n\x10reasoning_tokens\x18\x06 \x01(\x05\x12\x15\n\rprompt_tokens\x18\x02 \x01(\x05\x12\x14\n\x0ctotal_tokens\x18\x03 \x01(\x05\x12\x1a\n\x12prompt_text_tokens\x18\x04 \x01(\x05\x12!\n\x19\x63\x61\x63hed_prompt_text_tokens\x18\x07 \x01(\x05\x12\x1b\n\x13prompt_image_tokens\x18\x05 \x01(\x05\x12\x18\n\x10num_sources_used\x18\x08 \x01(\x05\x12\x37\n\x16server_side_tools_used\x18\t \x03(\x0e\x32\x17.xai_api.ServerSideTool\x12\x1d\n\x10\x63ost_in_nano_usd\x18\n \x01(\x03H\x00\x88\x01\x01\x12\x1e\n\x11\x63ost_in_usd_ticks\x18\x0b \x01(\x03H\x01\x88\x01\x01\x12\x1d\n\x10num_input_images\x18\r \x01(\x05H\x02\x88\x01\x01\x12!\n\x14num_generated_images\x18\x0e \x01(\x05H\x03\x88\x01\x01\x12!\n\x14input_video_duration\x18\x0f \x01(\x05H\x04\x88\x01\x01\x12%\n\x18generated_video_duration\x18\x10 \x01(\x05H\x05\x88\x01\x01\x12\'\n\x1agenerated_video_resolution\x18\x11 \x01(\x05H\x06\x88\x01\x01\x12\x1d\n\x15\x63ontext_prompt_tokens\x18\x12 \x01(\x05\x12\x1d\n\x15\x63ontext_output_tokens\x18\x13 \x01(\x05\x42\x13\n\x11_cost_in_nano_usdB\x14\n\x12_cost_in_usd_ticksB\x13\n\x11_num_input_imagesB\x17\n\x15_num_generated_imagesB\x17\n\x15_input_video_durationB\x1b\n\x19_generated_video_durationB\x1d\n\x1b_generated_video_resolution\"K\n\x0e\x45mbeddingUsage\x12\x1b\n\x13num_text_embeddings\x18\x01 \x01(\x05\x12\x1c\n\x14num_image_embeddings\x18\x02 \x01(\x05*`\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!SERVER_SIDE_TOOL_LOCATIONS_SEARCH\x10\t\x12!\n\x1dSERVER_SIDE_TOOL_IMAGE_SEARCH\x10\nB\x1eZ\x1cproxy/gen/go/xai_api;xai_apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.usage_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'usage_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\nUsageProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_SERVERSIDETOOL']._serialized_start=673 - _globals['_SERVERSIDETOOL']._serialized_end=1030 - _globals['_SAMPLINGUSAGE']._serialized_start=36 - _globals['_SAMPLINGUSAGE']._serialized_end=554 - _globals['_EMBEDDINGUSAGE']._serialized_start=556 - _globals['_EMBEDDINGUSAGE']._serialized_end=670 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_SERVICETIER']._serialized_start=872 + _globals['_SERVICETIER']._serialized_end=968 + _globals['_SERVERSIDETOOL']._serialized_start=971 + _globals['_SERVERSIDETOOL']._serialized_end=1367 + _globals['_SAMPLINGUSAGE']._serialized_start=25 + _globals['_SAMPLINGUSAGE']._serialized_end=793 + _globals['_EMBEDDINGUSAGE']._serialized_start=795 + _globals['_EMBEDDINGUSAGE']._serialized_end=870 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v5/usage_pb2.pyi b/src/xai_sdk/proto/v5/usage_pb2.pyi index 47c4296..8b5e46a 100644 --- a/src/xai_sdk/proto/v5/usage_pb2.pyi +++ b/src/xai_sdk/proto/v5/usage_pb2.pyi @@ -6,6 +6,12 @@ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Optional as _Op DESCRIPTOR: _descriptor.FileDescriptor +class ServiceTier(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SERVICE_TIER_UNSPECIFIED: _ClassVar[ServiceTier] + SERVICE_TIER_DEFAULT: _ClassVar[ServiceTier] + SERVICE_TIER_PRIORITY: _ClassVar[ServiceTier] + class ServerSideTool(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () SERVER_SIDE_TOOL_INVALID: _ClassVar[ServerSideTool] @@ -17,7 +23,11 @@ class ServerSideTool(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): SERVER_SIDE_TOOL_COLLECTIONS_SEARCH: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_MCP: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: _ClassVar[ServerSideTool] + SERVER_SIDE_TOOL_LOCATIONS_SEARCH: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_IMAGE_SEARCH: _ClassVar[ServerSideTool] +SERVICE_TIER_UNSPECIFIED: ServiceTier +SERVICE_TIER_DEFAULT: ServiceTier +SERVICE_TIER_PRIORITY: ServiceTier SERVER_SIDE_TOOL_INVALID: ServerSideTool SERVER_SIDE_TOOL_WEB_SEARCH: ServerSideTool SERVER_SIDE_TOOL_X_SEARCH: ServerSideTool @@ -27,10 +37,11 @@ SERVER_SIDE_TOOL_VIEW_X_VIDEO: ServerSideTool SERVER_SIDE_TOOL_COLLECTIONS_SEARCH: ServerSideTool SERVER_SIDE_TOOL_MCP: ServerSideTool SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: ServerSideTool +SERVER_SIDE_TOOL_LOCATIONS_SEARCH: ServerSideTool SERVER_SIDE_TOOL_IMAGE_SEARCH: 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") + __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_nano_usd", "cost_in_usd_ticks", "num_input_images", "num_generated_images", "input_video_duration", "generated_video_duration", "generated_video_resolution", "context_prompt_tokens", "context_output_tokens") COMPLETION_TOKENS_FIELD_NUMBER: _ClassVar[int] REASONING_TOKENS_FIELD_NUMBER: _ClassVar[int] PROMPT_TOKENS_FIELD_NUMBER: _ClassVar[int] @@ -40,7 +51,15 @@ class SamplingUsage(_message.Message): PROMPT_IMAGE_TOKENS_FIELD_NUMBER: _ClassVar[int] NUM_SOURCES_USED_FIELD_NUMBER: _ClassVar[int] SERVER_SIDE_TOOLS_USED_FIELD_NUMBER: _ClassVar[int] + COST_IN_NANO_USD_FIELD_NUMBER: _ClassVar[int] COST_IN_USD_TICKS_FIELD_NUMBER: _ClassVar[int] + NUM_INPUT_IMAGES_FIELD_NUMBER: _ClassVar[int] + NUM_GENERATED_IMAGES_FIELD_NUMBER: _ClassVar[int] + INPUT_VIDEO_DURATION_FIELD_NUMBER: _ClassVar[int] + GENERATED_VIDEO_DURATION_FIELD_NUMBER: _ClassVar[int] + GENERATED_VIDEO_RESOLUTION_FIELD_NUMBER: _ClassVar[int] + CONTEXT_PROMPT_TOKENS_FIELD_NUMBER: _ClassVar[int] + CONTEXT_OUTPUT_TOKENS_FIELD_NUMBER: _ClassVar[int] completion_tokens: int reasoning_tokens: int prompt_tokens: int @@ -50,8 +69,16 @@ class SamplingUsage(_message.Message): prompt_image_tokens: int num_sources_used: int server_side_tools_used: _containers.RepeatedScalarFieldContainer[ServerSideTool] + cost_in_nano_usd: int cost_in_usd_ticks: int - def __init__(self, completion_tokens: _Optional[int] = ..., reasoning_tokens: _Optional[int] = ..., prompt_tokens: _Optional[int] = ..., total_tokens: _Optional[int] = ..., prompt_text_tokens: _Optional[int] = ..., cached_prompt_text_tokens: _Optional[int] = ..., prompt_image_tokens: _Optional[int] = ..., num_sources_used: _Optional[int] = ..., server_side_tools_used: _Optional[_Iterable[_Union[ServerSideTool, str]]] = ..., cost_in_usd_ticks: _Optional[int] = ...) -> None: ... + num_input_images: int + num_generated_images: int + input_video_duration: int + generated_video_duration: int + generated_video_resolution: int + context_prompt_tokens: int + context_output_tokens: int + def __init__(self, completion_tokens: _Optional[int] = ..., reasoning_tokens: _Optional[int] = ..., prompt_tokens: _Optional[int] = ..., total_tokens: _Optional[int] = ..., prompt_text_tokens: _Optional[int] = ..., cached_prompt_text_tokens: _Optional[int] = ..., prompt_image_tokens: _Optional[int] = ..., num_sources_used: _Optional[int] = ..., server_side_tools_used: _Optional[_Iterable[_Union[ServerSideTool, str]]] = ..., cost_in_nano_usd: _Optional[int] = ..., cost_in_usd_ticks: _Optional[int] = ..., num_input_images: _Optional[int] = ..., num_generated_images: _Optional[int] = ..., input_video_duration: _Optional[int] = ..., generated_video_duration: _Optional[int] = ..., generated_video_resolution: _Optional[int] = ..., context_prompt_tokens: _Optional[int] = ..., context_output_tokens: _Optional[int] = ...) -> None: ... class EmbeddingUsage(_message.Message): __slots__ = ("num_text_embeddings", "num_image_embeddings") diff --git a/src/xai_sdk/proto/v5/video_pb2.py b/src/xai_sdk/proto/v5/video_pb2.py index 8176716..df56b87 100644 --- a/src/xai_sdk/proto/v5/video_pb2.py +++ b/src/xai_sdk/proto/v5/video_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/video.proto -# Protobuf Python Version: 5.29.1 +# source: video.proto +# Protobuf Python Version: 5.28.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,50 +11,54 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 5, - 29, - 1, + 5, 0, 0, '', - 'xai/api/v1/video.proto' + 'video.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from . import deferred_pb2 as xai_dot_api_dot_v1_dot_deferred__pb2 -from . import image_pb2 as xai_dot_api_dot_v1_dot_image__pb2 -from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 +from . import image_pb2 as image__pb2 +from . import deferred_pb2 as deferred__pb2 +from . import usage_pb2 as 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\"#\n\x0fVideoUrlContent\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xb9\x03\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\x0freferenceImagesB\x0b\n\t_durationB\x0f\n\r_aspect_ratioB\r\n\x0b_resolution\"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\"m\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\"\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\"\xa0\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\x42\x0b\n\t_duration*\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\x0bvideo.proto\x12\x07xai_api\x1a\x0bimage.proto\x1a\x0e\x64\x65\x66\x65rred.proto\x1a\x0busage.proto\"=\n\x0fVideoUrlContent\x12\r\n\x03url\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x66ile_id\x18\x02 \x01(\tH\x00\x42\x08\n\x06source\"!\n\x0bVideoOutput\x12\x12\n\nupload_url\x18\x01 \x01(\t\"\xf8\x05\n\x14GenerateVideoRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\'\n\x05image\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContent\x12\r\n\x05model\x18\x03 \x01(\t\x12\x15\n\x08\x64uration\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12%\n\x04size\x18\x05 \x01(\x0e\x32\x12.xai_api.VideoSizeH\x01\x88\x01\x01\x12\'\n\x05video\x18\x06 \x01(\x0b\x32\x18.xai_api.VideoUrlContent\x12\x34\n\x0c\x61spect_ratio\x18\x07 \x01(\x0e\x32\x19.xai_api.VideoAspectRatioH\x02\x88\x01\x01\x12\x31\n\nresolution\x18\x08 \x01(\x0e\x32\x18.xai_api.VideoResolutionH\x03\x88\x01\x01\x12\x31\n\nmoderation\x18\t \x01(\x0e\x32\x18.xai_api.ModerationLevelH\x04\x88\x01\x01\x12)\n\x06output\x18\n \x01(\x0b\x32\x14.xai_api.VideoOutputH\x05\x88\x01\x01\x12/\n\x0fsafety_settings\x18\x0b \x03(\x0b\x32\x16.xai_api.SafetySetting\x12(\n\x06images\x18\x0c \x03(\x0b\x32\x18.xai_api.ImageUrlContent\x12\x32\n\x10reference_images\x18\r \x03(\x0b\x32\x18.xai_api.ImageUrlContent\x12\x35\n\x0fstorage_options\x18\x0e \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x06\x88\x01\x01\x12/\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTierH\x07\x88\x01\x01\x42\x0b\n\t_durationB\x07\n\x05_sizeB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\r\n\x0b_moderationB\t\n\x07_outputB\x12\n\x10_storage_optionsB\x0f\n\r_service_tier\"-\n\x17GetDeferredVideoRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\x8f\x02\n\rVideoResponse\x12&\n\x05video\x18\x01 \x01(\x0b\x32\x17.xai_api.GeneratedVideo\x12\r\n\x05model\x18\x02 \x01(\t\x12%\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12/\n\x0c\x64\x65\x62ug_output\x18\x04 \x01(\x0b\x32\x19.xai_api.VideoDebugOutput\x12\x19\n\x0c\x62lock_reason\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\'\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x13.xai_api.VideoErrorH\x01\x88\x01\x01\x12\x10\n\x08progress\x18\x07 \x01(\x05\x42\x0f\n\r_block_reasonB\x08\n\x06_error\"\xb8\x01\n\x0eGeneratedVideo\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x10\n\x08\x64uration\x18\x04 \x01(\x05\x12\x1a\n\x12respect_moderation\x18\x05 \x01(\x08\x12-\n\x0b\x66ile_output\x18\x06 \x01(\x0b\x32\x13.xai_api.FileOutputH\x00\x88\x01\x01\x12\x1a\n\rstorage_error\x18\x07 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"\x7f\n\x18GetDeferredVideoResponse\x12\'\n\x06status\x18\x01 \x01(\x0e\x32\x17.xai_api.DeferredStatus\x12-\n\x08response\x18\x02 \x01(\x0b\x32\x16.xai_api.VideoResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\",\n\x10VideoDebugOutput\x12\x18\n\x10upsampled_prompt\x18\x01 \x01(\t\"+\n\nVideoError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\"\xc3\x02\n\x12\x45xtendVideoRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\'\n\x05video\x18\x02 \x01(\x0b\x32\x18.xai_api.VideoUrlContent\x12\r\n\x05model\x18\x03 \x01(\t\x12\x15\n\x08\x64uration\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12)\n\x06output\x18\x05 \x01(\x0b\x32\x14.xai_api.VideoOutputH\x01\x88\x01\x01\x12\x35\n\x0fstorage_options\x18\x06 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x02\x88\x01\x01\x12/\n\x0cservice_tier\x18\x07 \x01(\x0e\x32\x14.xai_api.ServiceTierH\x03\x88\x01\x01\x42\x0b\n\t_durationB\t\n\x07_outputB\x12\n\x10_storage_optionsB\x0f\n\r_service_tier*\x8b\x01\n\tVideoSize\x12\x1a\n\x16VIDEO_SIZE_UNSPECIFIED\x10\x00\x12\x16\n\x12VIDEO_SIZE_848X480\x10\x01\x12\x17\n\x13VIDEO_SIZE_1696X960\x10\x02\x12\x17\n\x13VIDEO_SIZE_1280X720\x10\x03\x12\x18\n\x14VIDEO_SIZE_1920X1080\x10\x04*\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*\x85\x01\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\x12\x1a\n\x16VIDEO_RESOLUTION_1080P\x10\x03\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\x42\x1eZ\x1cproxy/gen/go/xai_api;xai_apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.video_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'video_pb2', _globals) 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=1351 - _globals['_VIDEOASPECTRATIO']._serialized_end=1603 - _globals['_VIDEORESOLUTION']._serialized_start=1605 - _globals['_VIDEORESOLUTION']._serialized_end=1710 - _globals['_VIDEOURLCONTENT']._serialized_start=110 - _globals['_VIDEOURLCONTENT']._serialized_end=145 - _globals['_GENERATEVIDEOREQUEST']._serialized_start=148 - _globals['_GENERATEVIDEOREQUEST']._serialized_end=589 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=591 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=647 - _globals['_VIDEORESPONSE']._serialized_start=650 - _globals['_VIDEORESPONSE']._serialized_end=866 - _globals['_GENERATEDVIDEO']._serialized_start=868 - _globals['_GENERATEDVIDEO']._serialized_end=977 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=980 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1125 - _globals['_VIDEOERROR']._serialized_start=1127 - _globals['_VIDEOERROR']._serialized_end=1185 - _globals['_EXTENDVIDEOREQUEST']._serialized_start=1188 - _globals['_EXTENDVIDEOREQUEST']._serialized_end=1348 - _globals['_VIDEO']._serialized_start=1713 - _globals['_VIDEO']._serialized_end=1971 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_VIDEOSIZE']._serialized_start=1982 + _globals['_VIDEOSIZE']._serialized_end=2121 + _globals['_VIDEOASPECTRATIO']._serialized_start=2124 + _globals['_VIDEOASPECTRATIO']._serialized_end=2376 + _globals['_VIDEORESOLUTION']._serialized_start=2379 + _globals['_VIDEORESOLUTION']._serialized_end=2512 + _globals['_VIDEOURLCONTENT']._serialized_start=66 + _globals['_VIDEOURLCONTENT']._serialized_end=127 + _globals['_VIDEOOUTPUT']._serialized_start=129 + _globals['_VIDEOOUTPUT']._serialized_end=162 + _globals['_GENERATEVIDEOREQUEST']._serialized_start=165 + _globals['_GENERATEVIDEOREQUEST']._serialized_end=925 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=927 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=972 + _globals['_VIDEORESPONSE']._serialized_start=975 + _globals['_VIDEORESPONSE']._serialized_end=1246 + _globals['_GENERATEDVIDEO']._serialized_start=1249 + _globals['_GENERATEDVIDEO']._serialized_end=1433 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=1435 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1562 + _globals['_VIDEODEBUGOUTPUT']._serialized_start=1564 + _globals['_VIDEODEBUGOUTPUT']._serialized_end=1608 + _globals['_VIDEOERROR']._serialized_start=1610 + _globals['_VIDEOERROR']._serialized_end=1653 + _globals['_EXTENDVIDEOREQUEST']._serialized_start=1656 + _globals['_EXTENDVIDEOREQUEST']._serialized_end=1979 + _globals['_VIDEO']._serialized_start=2515 + _globals['_VIDEO']._serialized_end=2773 # @@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 363acb9..6b72e29 100644 --- a/src/xai_sdk/proto/v5/video_pb2.pyi +++ b/src/xai_sdk/proto/v5/video_pb2.pyi @@ -1,5 +1,5 @@ -from . import deferred_pb2 as _deferred_pb2 from . import image_pb2 as _image_pb2 +from . import deferred_pb2 as _deferred_pb2 from . import usage_pb2 as _usage_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper @@ -9,6 +9,14 @@ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Map DESCRIPTOR: _descriptor.FileDescriptor +class VideoSize(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + VIDEO_SIZE_UNSPECIFIED: _ClassVar[VideoSize] + VIDEO_SIZE_848X480: _ClassVar[VideoSize] + VIDEO_SIZE_1696X960: _ClassVar[VideoSize] + VIDEO_SIZE_1280X720: _ClassVar[VideoSize] + VIDEO_SIZE_1920X1080: _ClassVar[VideoSize] + class VideoAspectRatio(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () VIDEO_ASPECT_RATIO_UNSPECIFIED: _ClassVar[VideoAspectRatio] @@ -25,6 +33,12 @@ class VideoResolution(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): VIDEO_RESOLUTION_UNSPECIFIED: _ClassVar[VideoResolution] VIDEO_RESOLUTION_480P: _ClassVar[VideoResolution] VIDEO_RESOLUTION_720P: _ClassVar[VideoResolution] + VIDEO_RESOLUTION_1080P: _ClassVar[VideoResolution] +VIDEO_SIZE_UNSPECIFIED: VideoSize +VIDEO_SIZE_848X480: VideoSize +VIDEO_SIZE_1696X960: VideoSize +VIDEO_SIZE_1280X720: VideoSize +VIDEO_SIZE_1920X1080: VideoSize VIDEO_ASPECT_RATIO_UNSPECIFIED: VideoAspectRatio VIDEO_ASPECT_RATIO_1_1: VideoAspectRatio VIDEO_ASPECT_RATIO_16_9: VideoAspectRatio @@ -36,32 +50,55 @@ VIDEO_ASPECT_RATIO_2_3: VideoAspectRatio VIDEO_RESOLUTION_UNSPECIFIED: VideoResolution VIDEO_RESOLUTION_480P: VideoResolution VIDEO_RESOLUTION_720P: VideoResolution +VIDEO_RESOLUTION_1080P: VideoResolution class VideoUrlContent(_message.Message): - __slots__ = ("url",) + __slots__ = ("url", "file_id") URL_FIELD_NUMBER: _ClassVar[int] + FILE_ID_FIELD_NUMBER: _ClassVar[int] url: str - def __init__(self, url: _Optional[str] = ...) -> None: ... + file_id: str + def __init__(self, url: _Optional[str] = ..., file_id: _Optional[str] = ...) -> None: ... + +class VideoOutput(_message.Message): + __slots__ = ("upload_url",) + UPLOAD_URL_FIELD_NUMBER: _ClassVar[int] + upload_url: str + def __init__(self, upload_url: _Optional[str] = ...) -> None: ... class GenerateVideoRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "duration", "video", "aspect_ratio", "resolution", "reference_images") + __slots__ = ("prompt", "image", "model", "duration", "size", "video", "aspect_ratio", "resolution", "moderation", "output", "safety_settings", "images", "reference_images", "storage_options", "service_tier") PROMPT_FIELD_NUMBER: _ClassVar[int] IMAGE_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] DURATION_FIELD_NUMBER: _ClassVar[int] + SIZE_FIELD_NUMBER: _ClassVar[int] VIDEO_FIELD_NUMBER: _ClassVar[int] ASPECT_RATIO_FIELD_NUMBER: _ClassVar[int] RESOLUTION_FIELD_NUMBER: _ClassVar[int] + MODERATION_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FIELD_NUMBER: _ClassVar[int] + SAFETY_SETTINGS_FIELD_NUMBER: _ClassVar[int] + IMAGES_FIELD_NUMBER: _ClassVar[int] REFERENCE_IMAGES_FIELD_NUMBER: _ClassVar[int] + STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] prompt: str image: _image_pb2.ImageUrlContent model: str duration: int + size: VideoSize video: VideoUrlContent aspect_ratio: VideoAspectRatio resolution: VideoResolution + moderation: _image_pb2.ModerationLevel + output: VideoOutput + safety_settings: _containers.RepeatedCompositeFieldContainer[_image_pb2.SafetySetting] + images: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUrlContent] reference_images: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUrlContent] - 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]]] = ...) -> None: ... + storage_options: _image_pb2.StorageOptions + service_tier: _usage_pb2.ServiceTier + def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., size: _Optional[_Union[VideoSize, str]] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., aspect_ratio: _Optional[_Union[VideoAspectRatio, str]] = ..., resolution: _Optional[_Union[VideoResolution, str]] = ..., moderation: _Optional[_Union[_image_pb2.ModerationLevel, str]] = ..., output: _Optional[_Union[VideoOutput, _Mapping]] = ..., safety_settings: _Optional[_Iterable[_Union[_image_pb2.SafetySetting, _Mapping]]] = ..., images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., reference_images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetDeferredVideoRequest(_message.Message): __slots__ = ("request_id",) @@ -70,28 +107,36 @@ class GetDeferredVideoRequest(_message.Message): def __init__(self, request_id: _Optional[str] = ...) -> None: ... class VideoResponse(_message.Message): - __slots__ = ("video", "model", "usage", "error", "progress") + __slots__ = ("video", "model", "usage", "debug_output", "block_reason", "error", "progress") VIDEO_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] USAGE_FIELD_NUMBER: _ClassVar[int] + DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + BLOCK_REASON_FIELD_NUMBER: _ClassVar[int] ERROR_FIELD_NUMBER: _ClassVar[int] PROGRESS_FIELD_NUMBER: _ClassVar[int] video: GeneratedVideo model: str usage: _usage_pb2.SamplingUsage + debug_output: VideoDebugOutput + block_reason: str error: VideoError progress: int - def __init__(self, video: _Optional[_Union[GeneratedVideo, _Mapping]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., error: _Optional[_Union[VideoError, _Mapping]] = ..., progress: _Optional[int] = ...) -> None: ... + def __init__(self, video: _Optional[_Union[GeneratedVideo, _Mapping]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., debug_output: _Optional[_Union[VideoDebugOutput, _Mapping]] = ..., block_reason: _Optional[str] = ..., error: _Optional[_Union[VideoError, _Mapping]] = ..., progress: _Optional[int] = ...) -> None: ... class GeneratedVideo(_message.Message): - __slots__ = ("url", "duration", "respect_moderation") + __slots__ = ("url", "duration", "respect_moderation", "file_output", "storage_error") URL_FIELD_NUMBER: _ClassVar[int] DURATION_FIELD_NUMBER: _ClassVar[int] RESPECT_MODERATION_FIELD_NUMBER: _ClassVar[int] + FILE_OUTPUT_FIELD_NUMBER: _ClassVar[int] + STORAGE_ERROR_FIELD_NUMBER: _ClassVar[int] url: str duration: int respect_moderation: bool - def __init__(self, url: _Optional[str] = ..., duration: _Optional[int] = ..., respect_moderation: bool = ...) -> None: ... + file_output: _image_pb2.FileOutput + storage_error: str + def __init__(self, url: _Optional[str] = ..., duration: _Optional[int] = ..., respect_moderation: bool = ..., file_output: _Optional[_Union[_image_pb2.FileOutput, _Mapping]] = ..., storage_error: _Optional[str] = ...) -> None: ... class GetDeferredVideoResponse(_message.Message): __slots__ = ("status", "response") @@ -101,6 +146,12 @@ class GetDeferredVideoResponse(_message.Message): response: VideoResponse def __init__(self, status: _Optional[_Union[_deferred_pb2.DeferredStatus, str]] = ..., response: _Optional[_Union[VideoResponse, _Mapping]] = ...) -> None: ... +class VideoDebugOutput(_message.Message): + __slots__ = ("upsampled_prompt",) + UPSAMPLED_PROMPT_FIELD_NUMBER: _ClassVar[int] + upsampled_prompt: str + def __init__(self, upsampled_prompt: _Optional[str] = ...) -> None: ... + class VideoError(_message.Message): __slots__ = ("code", "message") CODE_FIELD_NUMBER: _ClassVar[int] @@ -110,13 +161,19 @@ class VideoError(_message.Message): def __init__(self, code: _Optional[str] = ..., message: _Optional[str] = ...) -> None: ... class ExtendVideoRequest(_message.Message): - __slots__ = ("prompt", "video", "model", "duration") + __slots__ = ("prompt", "video", "model", "duration", "output", "storage_options", "service_tier") PROMPT_FIELD_NUMBER: _ClassVar[int] VIDEO_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] DURATION_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FIELD_NUMBER: _ClassVar[int] + STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] prompt: str video: VideoUrlContent model: str duration: int - def __init__(self, prompt: _Optional[str] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ...) -> None: ... + output: VideoOutput + storage_options: _image_pb2.StorageOptions + service_tier: _usage_pb2.ServiceTier + def __init__(self, prompt: _Optional[str] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., output: _Optional[_Union[VideoOutput, _Mapping]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... diff --git a/src/xai_sdk/proto/v6/chat_pb2.py b/src/xai_sdk/proto/v6/chat_pb2.py index 411364b..43854d0 100644 --- a/src/xai_sdk/proto/v6/chat_pb2.py +++ b/src/xai_sdk/proto/v6/chat_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/chat.proto -# Protobuf Python Version: 6.30.0 +# source: chat.proto +# Protobuf Python Version: 6.33.5 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,11 +11,9 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 6, - 30, - 0, + 6, 0, 0, '', - 'xai/api/v1/chat.proto' + 'chat.proto' ) # @@protoc_insertion_point(imports) @@ -23,133 +21,71 @@ from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from . import deferred_pb2 as xai_dot_api_dot_v1_dot_deferred__pb2 -from . import documents_pb2 as xai_dot_api_dot_v1_dot_documents__pb2 -from . import image_pb2 as xai_dot_api_dot_v1_dot_image__pb2 -from . import sample_pb2 as xai_dot_api_dot_v1_dot_sample__pb2 -from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 +from . import deferred_pb2 as deferred__pb2 +from . import sample_pb2 as sample__pb2 +from . import usage_pb2 as usage__pb2 +from . import chat_types_pb2 as chat__types__pb2 +from . import chat_bidi_v2_pb2 as chat__bidi__v2__pb2 +from .chat_types_pb2 import * +from .chat_bidi_v2_pb2 import * -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\"\xb8\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\x42\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\"\x96\x03\n\x19GetChatCompletionResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x33\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutputR\x07outputs\x12\x34\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x06 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x07 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\n \x03(\tR\tcitations\x12\x34\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettingsR\x08settings\x12\x37\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xe2\x02\n\x16GetChatCompletionChunk\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x38\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunkR\x07outputs\x12\x34\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampR\x07\x63reated\x12\x14\n\x05model\x18\x04 \x01(\tR\x05model\x12-\n\x12system_fingerprint\x18\x05 \x01(\tR\x11systemFingerprint\x12,\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsageR\x05usage\x12\x1c\n\tcitations\x18\x07 \x03(\tR\tcitations\x12\x37\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutputR\x0b\x64\x65\x62ugOutput\"\xa2\x01\n\x1dGetDeferredCompletionResponse\x12/\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatusR\x06status\x12\x43\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00R\x08response\x88\x01\x01\x42\x0b\n\t_response\"\xc9\x01\n\x10\x43ompletionOutput\x12:\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x02 \x01(\x05R\x05index\x12\x34\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessageR\x07message\x12-\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\"\x9a\x02\n\x11\x43ompletionMessage\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xbe\x01\n\x15\x43ompletionOutputChunk\x12$\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.DeltaR\x05\x64\x65lta\x12-\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbsR\x08logprobs\x12:\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReasonR\x0c\x66inishReason\x12\x14\n\x05index\x18\x04 \x01(\x05R\x05index\"\x8e\x02\n\x05\x44\x65lta\x12\x18\n\x07\x63ontent\x18\x01 \x01(\tR\x07\x63ontent\x12+\n\x11reasoning_content\x18\x04 \x01(\tR\x10reasoningContent\x12(\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRoleR\x04role\x12\x30\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCallR\ttoolCalls\x12+\n\x11\x65ncrypted_content\x18\x05 \x01(\tR\x10\x65ncryptedContent\x12\x35\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitationR\tcitations\"\xad\x02\n\x0eInlineCitation\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1f\n\x0bstart_index\x18\x02 \x01(\x05R\nstartIndex\x12\x1b\n\tend_index\x18\x06 \x01(\x05R\x08\x65ndIndex\x12\x39\n\x0cweb_citation\x18\x03 \x01(\x0b\x32\x14.xai_api.WebCitationH\x00R\x0bwebCitation\x12\x33\n\nx_citation\x18\x04 \x01(\x0b\x32\x12.xai_api.XCitationH\x00R\txCitation\x12Q\n\x14\x63ollections_citation\x18\x05 \x01(\x0b\x32\x1c.xai_api.CollectionsCitationH\x00R\x13\x63ollectionsCitationB\n\n\x08\x63itation\"\x1f\n\x0bWebCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\x1d\n\tXCitation\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xab\x01\n\x13\x43ollectionsCitation\x12\x17\n\x07\x66ile_id\x18\x01 \x01(\tR\x06\x66ileId\x12\x19\n\x08\x63hunk_id\x18\x02 \x01(\tR\x07\x63hunkId\x12#\n\rchunk_content\x18\x03 \x01(\tR\x0c\x63hunkContent\x12\x14\n\x05score\x18\x04 \x01(\x02R\x05score\x12%\n\x0e\x63ollection_ids\x18\x05 \x03(\tR\rcollectionIds\"6\n\x08LogProbs\x12*\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProbR\x07\x63ontent\"\x87\x01\n\x07LogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\x12\x36\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProbR\x0btopLogprobs\"R\n\nTopLogProb\x12\x14\n\x05token\x18\x01 \x01(\tR\x05token\x12\x18\n\x07logprob\x18\x02 \x01(\x02R\x07logprob\x12\x14\n\x05\x62ytes\x18\x03 \x01(\x0cR\x05\x62ytes\"\x8f\x01\n\x07\x43ontent\x12\x14\n\x04text\x18\x01 \x01(\tH\x00R\x04text\x12\x37\n\timage_url\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContentH\x00R\x08imageUrl\x12*\n\x04\x66ile\x18\x03 \x01(\x0b\x32\x14.xai_api.FileContentH\x00R\x04\x66ileB\t\n\x07\x63ontent\"\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*\x82\x03\n\rIncludeOption\x12\x1a\n\x16INCLUDE_OPTION_INVALID\x10\x00\x12)\n%INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT\x10\x01\x12\'\n#INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT\x10\x02\x12-\n)INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT\x10\x03\x12\x31\n-INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT\x10\x04\x12\x30\n,INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT\x10\x05\x12\"\n\x1eINCLUDE_OPTION_MCP_CALL_OUTPUT\x10\x06\x12#\n\x1fINCLUDE_OPTION_INLINE_CITATIONS\x10\x07\x12$\n INCLUDE_OPTION_VERBOSE_STREAMING\x10\x08*\x8d\x01\n\x0bMessageRole\x12\x10\n\x0cINVALID_ROLE\x10\x00\x12\r\n\tROLE_USER\x10\x01\x12\x12\n\x0eROLE_ASSISTANT\x10\x02\x12\x0f\n\x0bROLE_SYSTEM\x10\x03\x12\x15\n\rROLE_FUNCTION\x10\x04\x1a\x02\x08\x01\x12\r\n\tROLE_TOOL\x10\x05\x12\x12\n\x0eROLE_DEVELOPER\x10\x06*j\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*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\nchat.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0e\x64\x65\x66\x65rred.proto\x1a\x0csample.proto\x1a\x0busage.proto\x1a\x10\x63hat_types.proto\x1a\x12\x63hat_bidi_v2.proto\"\xd4\t\n\x15GetCompletionsRequest\x12\"\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.Message\x12\r\n\x05model\x18\x02 \x01(\t\x12\x0c\n\x04user\x18\x10 \x01(\t\x12\x0e\n\x01n\x18\x08 \x01(\x05H\x00\x88\x01\x01\x12\x17\n\nmax_tokens\x18\x07 \x01(\x05H\x01\x88\x01\x01\x12\x11\n\x04seed\x18\x0b \x01(\x05H\x02\x88\x01\x01\x12\x0c\n\x04stop\x18\x0c \x03(\t\x12\x18\n\x0btemperature\x18\x0e \x01(\x02H\x03\x88\x01\x01\x12\x12\n\x05top_p\x18\x0f \x01(\x02H\x04\x88\x01\x01\x12\x10\n\x08logprobs\x18\x05 \x01(\x08\x12\x19\n\x0ctop_logprobs\x18\x06 \x01(\x05H\x05\x88\x01\x01\x12\x1c\n\x05tools\x18\x11 \x03(\x0b\x32\r.xai_api.Tool\x12(\n\x0btool_choice\x18\x12 \x01(\x0b\x32\x13.xai_api.ToolChoice\x12\x30\n\x0fresponse_format\x18\n \x01(\x0b\x32\x17.xai_api.ResponseFormat\x12\x1e\n\x11\x66requency_penalty\x18\x03 \x01(\x02H\x06\x88\x01\x01\x12\x1d\n\x10presence_penalty\x18\t \x01(\x02H\x07\x88\x01\x01\x12\x37\n\x10reasoning_effort\x18\x13 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x08\x88\x01\x01\x12\x39\n\x11search_parameters\x18\x14 \x01(\x0b\x32\x19.xai_api.SearchParametersH\t\x88\x01\x01\x12 \n\x13parallel_tool_calls\x18\x15 \x01(\x08H\n\x88\x01\x01\x12!\n\x14previous_response_id\x18\x16 \x01(\tH\x0b\x88\x01\x01\x12\x16\n\x0estore_messages\x18\x17 \x01(\x08\x12\x1d\n\x15use_encrypted_content\x18\x18 \x01(\x08\x12\x16\n\tmax_turns\x18\x19 \x01(\x05H\x0c\x88\x01\x01\x12\'\n\x07include\x18\x1a \x03(\x0e\x32\x16.xai_api.IncludeOption\x12\x1b\n\x0e\x62ootstrap_host\x18\x1b \x01(\tH\r\x88\x01\x01\x12\x1b\n\x0e\x62ootstrap_room\x18\x1c \x01(\x04H\x0e\x88\x01\x01\x12-\n\x0b\x61gent_count\x18\x1d \x01(\x0e\x32\x13.xai_api.AgentCountH\x0f\x88\x01\x01\x12\x17\n\ncache_salt\x18\x1e \x01(\tH\x10\x88\x01\x01\x12/\n\x0cservice_tier\x18\x1f \x01(\x0e\x32\x14.xai_api.ServiceTierH\x11\x88\x01\x01\x42\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\x11\n\x0f_bootstrap_hostB\x11\n\x0f_bootstrap_roomB\x0e\n\x0c_agent_countB\r\n\x0b_cache_saltB\x0f\n\r_service_tierJ\x04\x08\x04\x10\x05\"\xbe\x03\n\x19GetChatCompletionResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12*\n\x07outputs\x18\x02 \x03(\x0b\x32\x19.xai_api.CompletionOutput\x12+\n\x07\x63reated\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05model\x18\x06 \x01(\t\x12\x1a\n\x12system_fingerprint\x18\x07 \x01(\t\x12%\n\x05usage\x18\t \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12\x11\n\tcitations\x18\n \x03(\t\x12*\n\x08settings\x18\x0b \x01(\x0b\x32\x18.xai_api.RequestSettings\x12*\n\x0c\x64\x65\x62ug_output\x18\x0c \x01(\x0b\x32\x14.xai_api.DebugOutput\x12)\n\x0coutput_files\x18\r \x03(\x0b\x32\x13.xai_api.OutputFile\x12(\n\x0einput_messages\x18\x0e \x03(\x0b\x32\x10.xai_api.Message\x12*\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTier\"\xea\x02\n\x16GetChatCompletionChunk\x12\n\n\x02id\x18\x01 \x01(\t\x12/\n\x07outputs\x18\x02 \x03(\x0b\x32\x1e.xai_api.CompletionOutputChunk\x12+\n\x07\x63reated\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\r\n\x05model\x18\x04 \x01(\t\x12\x1a\n\x12system_fingerprint\x18\x05 \x01(\t\x12%\n\x05usage\x18\x06 \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12\x11\n\tcitations\x18\x07 \x03(\t\x12*\n\x0c\x64\x65\x62ug_output\x18\n \x01(\x0b\x32\x14.xai_api.DebugOutput\x12)\n\x0coutput_files\x18\x0b \x03(\x0b\x32\x13.xai_api.OutputFile\x12*\n\x0cservice_tier\x18\x0c \x01(\x0e\x32\x14.xai_api.ServiceTier\"\x90\x01\n\x1dGetDeferredCompletionResponse\x12\'\n\x06status\x18\x02 \x01(\x0e\x32\x17.xai_api.DeferredStatus\x12\x39\n\x08response\x18\x01 \x01(\x0b\x32\".xai_api.GetChatCompletionResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\"\xa1\x01\n\x10\x43ompletionOutput\x12,\n\rfinish_reason\x18\x01 \x01(\x0e\x32\x15.xai_api.FinishReason\x12\r\n\x05index\x18\x02 \x01(\x05\x12+\n\x07message\x18\x03 \x01(\x0b\x32\x1a.xai_api.CompletionMessage\x12#\n\x08logprobs\x18\x04 \x01(\x0b\x32\x11.xai_api.LogProbs\"\xfa\x01\n\x11\x43ompletionMessage\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x19\n\x11reasoning_content\x18\x04 \x01(\t\x12\"\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRole\x12%\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCall\x12\x19\n\x11\x65ncrypted_content\x18\x05 \x01(\t\x12*\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitation\x12\'\n\x1fis_reasoning_content_summarized\x18\x07 \x01(\x08\"\x98\x01\n\x15\x43ompletionOutputChunk\x12\x1d\n\x05\x64\x65lta\x18\x01 \x01(\x0b\x32\x0e.xai_api.Delta\x12#\n\x08logprobs\x18\x02 \x01(\x0b\x32\x11.xai_api.LogProbs\x12,\n\rfinish_reason\x18\x03 \x01(\x0e\x32\x15.xai_api.FinishReason\x12\r\n\x05index\x18\x04 \x01(\x05\"\xee\x01\n\x05\x44\x65lta\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\t\x12\x19\n\x11reasoning_content\x18\x04 \x01(\t\x12\"\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRole\x12%\n\ntool_calls\x18\x03 \x03(\x0b\x32\x11.xai_api.ToolCall\x12\x19\n\x11\x65ncrypted_content\x18\x05 \x01(\t\x12*\n\tcitations\x18\x06 \x03(\x0b\x32\x17.xai_api.InlineCitation\x12\'\n\x1fis_reasoning_content_summarized\x18\x07 \x01(\x08\"-\n\x08LogProbs\x12!\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.LogProb\"c\n\x07LogProb\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0f\n\x07logprob\x18\x02 \x01(\x02\x12\r\n\x05\x62ytes\x18\x03 \x01(\x0c\x12)\n\x0ctop_logprobs\x18\x04 \x03(\x0b\x32\x13.xai_api.TopLogProb\";\n\nTopLogProb\x12\r\n\x05token\x18\x01 \x01(\t\x12\x0f\n\x07logprob\x18\x02 \x01(\x02\x12\r\n\x05\x62ytes\x18\x03 \x01(\x0c\"\x82\x02\n\x07Message\x12!\n\x07\x63ontent\x18\x01 \x03(\x0b\x32\x10.xai_api.Content\x12\x1e\n\x11reasoning_content\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\"\n\x04role\x18\x02 \x01(\x0e\x32\x14.xai_api.MessageRole\x12\x0c\n\x04name\x18\x03 \x01(\t\x12%\n\ntool_calls\x18\x04 \x03(\x0b\x32\x11.xai_api.ToolCall\x12\x19\n\x11\x65ncrypted_content\x18\x06 \x01(\t\x12\x19\n\x0ctool_call_id\x18\x07 \x01(\tH\x01\x88\x01\x01\x42\x14\n\x12_reasoning_contentB\x0f\n\r_tool_call_id\"\x85\x02\n\x10SearchParameters\x12!\n\x04mode\x18\x01 \x01(\x0e\x32\x13.xai_api.SearchMode\x12 \n\x07sources\x18\t \x03(\x0b\x32\x0f.xai_api.Source\x12-\n\tfrom_date\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12+\n\x07to_date\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10return_citations\x18\x07 \x01(\x08\x12\x1f\n\x12max_search_results\x18\x08 \x01(\x05H\x00\x88\x01\x01\x42\x15\n\x13_max_search_results\"\xe1\x04\n\x0fRequestSettings\x12\x17\n\nmax_tokens\x18\x01 \x01(\x05H\x00\x88\x01\x01\x12\x1b\n\x13parallel_tool_calls\x18\x02 \x01(\x08\x12!\n\x14previous_response_id\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x37\n\x10reasoning_effort\x18\x04 \x01(\x0e\x32\x18.xai_api.ReasoningEffortH\x02\x88\x01\x01\x12\x18\n\x0btemperature\x18\x05 \x01(\x02H\x03\x88\x01\x01\x12\x30\n\x0fresponse_format\x18\x06 \x01(\x0b\x32\x17.xai_api.ResponseFormat\x12(\n\x0btool_choice\x18\x07 \x01(\x0b\x32\x13.xai_api.ToolChoice\x12\x1c\n\x05tools\x18\x08 \x03(\x0b\x32\r.xai_api.Tool\x12\x12\n\x05top_p\x18\t \x01(\x02H\x04\x88\x01\x01\x12\x0c\n\x04user\x18\n \x01(\t\x12\x39\n\x11search_parameters\x18\x0b \x01(\x0b\x32\x19.xai_api.SearchParametersH\x05\x88\x01\x01\x12\x16\n\x0estore_messages\x18\x0c \x01(\x08\x12\x1d\n\x15use_encrypted_content\x18\r \x01(\x08\x12\'\n\x07include\x18\x0e \x03(\x0e\x32\x16.xai_api.IncludeOptionB\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\"\x9d\x01\n\x0fResponseHistory\x12\"\n\x08messages\x18\x01 \x03(\x0b\x32\x10.xai_api.Message\x12\x34\n\x08response\x18\x02 \x01(\x0b\x32\".xai_api.GetChatCompletionResponse\x12\x1c\n\x0f\x63onversation_id\x18\x03 \x01(\tH\x00\x88\x01\x01\x42\x12\n\x10_conversation_id\"1\n\x1aGetStoredCompletionRequest\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\"4\n\x1d\x44\x65leteStoredCompletionRequest\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\"5\n\x1e\x44\x65leteStoredCompletionResponse\x12\x13\n\x0bresponse_id\x18\x01 \x01(\t\"\xbc\x02\n\x0b\x44\x65\x62ugOutput\x12\x10\n\x08\x61ttempts\x18\x01 \x01(\x05\x12\x0f\n\x07request\x18\x02 \x01(\t\x12\x0e\n\x06prompt\x18\x03 \x01(\t\x12\x16\n\x0e\x65ngine_request\x18\t \x01(\t\x12\x11\n\tresponses\x18\x04 \x03(\t\x12\x0e\n\x06\x63hunks\x18\x0c \x03(\t\x12\x18\n\x10\x63\x61\x63he_read_count\x18\x05 \x01(\r\x12\x1e\n\x16\x63\x61\x63he_read_input_bytes\x18\x06 \x01(\x04\x12\x19\n\x11\x63\x61\x63he_write_count\x18\x07 \x01(\r\x12\x1f\n\x17\x63\x61\x63he_write_input_bytes\x18\x08 \x01(\x04\x12\x12\n\nlb_address\x18\n \x01(\t\x12\x13\n\x0bsampler_tag\x18\x0b \x01(\t\x12 \n\x18sampler_checkpoint_mount\x18\r \x01(\t\"G\n\x15\x43ompactContextRequest\x12\r\n\x05model\x18\x01 \x01(\t\x12\x1f\n\x05input\x18\x02 \x03(\x0b\x32\x10.xai_api.Message\"\x85\x01\n\x16\x43ompactContextResponse\x12\n\n\x02id\x18\x01 \x01(\t\x12\x19\n\x11\x65ncrypted_content\x18\x02 \x01(\t\x12\x1d\n\x15\x64ropped_message_count\x18\x03 \x01(\r\x12%\n\x05usage\x18\x04 \x01(\x0b\x32\x16.xai_api.SamplingUsage*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\xe7\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\x12L\n\x18GetCompletionChunkBidiV2\x12\x14.xai_api.ClientEvent\x1a\x14.xai_api.ServerEvent\"\x00(\x01\x30\x01\x12S\n\x0e\x43ompactContext\x12\x1e.xai_api.CompactContextRequest\x1a\x1f.xai_api.CompactContextResponse\"\x00\x42\x1eZ\x1cproxy/gen/go/xai_api;xai_apiP\x04P\x05\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.chat_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'chat_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\tChatProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_MESSAGEROLE'].values_by_name["ROLE_FUNCTION"]._loaded_options = None - _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=10588 - _globals['_INCLUDEOPTION']._serialized_end=10974 - _globals['_MESSAGEROLE']._serialized_start=10977 - _globals['_MESSAGEROLE']._serialized_end=11118 - _globals['_REASONINGEFFORT']._serialized_start=11120 - _globals['_REASONINGEFFORT']._serialized_end=11226 - _globals['_AGENTCOUNT']._serialized_start=11228 - _globals['_AGENTCOUNT']._serialized_end=11308 - _globals['_TOOLMODE']._serialized_start=11310 - _globals['_TOOLMODE']._serialized_end=11407 - _globals['_FORMATTYPE']._serialized_start=11409 - _globals['_FORMATTYPE']._serialized_end=11526 - _globals['_TOOLCALLTYPE']._serialized_start=11529 - _globals['_TOOLCALLTYPE']._serialized_end=11834 - _globals['_TOOLCALLSTATUS']._serialized_start=11837 - _globals['_TOOLCALLSTATUS']._serialized_end=11981 - _globals['_SEARCHMODE']._serialized_start=11983 - _globals['_SEARCHMODE']._serialized_end=12083 - _globals['_GETCOMPLETIONSREQUEST']._serialized_start=196 - _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1532 - _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1535 - _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_end=1941 - _globals['_GETCHATCOMPLETIONCHUNK']._serialized_start=1944 - _globals['_GETCHATCOMPLETIONCHUNK']._serialized_end=2298 - _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_start=2301 - _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_end=2463 - _globals['_COMPLETIONOUTPUT']._serialized_start=2466 - _globals['_COMPLETIONOUTPUT']._serialized_end=2667 - _globals['_COMPLETIONMESSAGE']._serialized_start=2670 - _globals['_COMPLETIONMESSAGE']._serialized_end=2952 - _globals['_COMPLETIONOUTPUTCHUNK']._serialized_start=2955 - _globals['_COMPLETIONOUTPUTCHUNK']._serialized_end=3145 - _globals['_DELTA']._serialized_start=3148 - _globals['_DELTA']._serialized_end=3418 - _globals['_INLINECITATION']._serialized_start=3421 - _globals['_INLINECITATION']._serialized_end=3722 - _globals['_WEBCITATION']._serialized_start=3724 - _globals['_WEBCITATION']._serialized_end=3755 - _globals['_XCITATION']._serialized_start=3757 - _globals['_XCITATION']._serialized_end=3786 - _globals['_COLLECTIONSCITATION']._serialized_start=3789 - _globals['_COLLECTIONSCITATION']._serialized_end=3960 - _globals['_LOGPROBS']._serialized_start=3962 - _globals['_LOGPROBS']._serialized_end=4016 - _globals['_LOGPROB']._serialized_start=4019 - _globals['_LOGPROB']._serialized_end=4154 - _globals['_TOPLOGPROB']._serialized_start=4156 - _globals['_TOPLOGPROB']._serialized_end=4238 - _globals['_CONTENT']._serialized_start=4241 - _globals['_CONTENT']._serialized_end=4384 - _globals['_FILECONTENT']._serialized_start=4387 - _globals['_FILECONTENT']._serialized_end=4520 - _globals['_MESSAGE']._serialized_start=4523 - _globals['_MESSAGE']._serialized_end=4861 - _globals['_TOOLCHOICE']._serialized_start=4863 - _globals['_TOOLCHOICE']._serialized_end=4970 - _globals['_TOOL']._serialized_start=4973 - _globals['_TOOL']._serialized_end=5386 - _globals['_MCP']._serialized_start=5389 - _globals['_MCP']._serialized_end=5748 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_start=5667 - _globals['_MCP_EXTRAHEADERSENTRY']._serialized_end=5730 - _globals['_WEBSEARCH']._serialized_start=5751 - _globals['_WEBSEARCH']._serialized_end=6113 - _globals['_WEBSEARCHUSERLOCATION']._serialized_start=6116 - _globals['_WEBSEARCHUSERLOCATION']._serialized_end=6302 - _globals['_XSEARCH']._serialized_start=6305 - _globals['_XSEARCH']._serialized_end=6746 - _globals['_CODEEXECUTION']._serialized_start=6748 - _globals['_CODEEXECUTION']._serialized_end=6763 - _globals['_COLLECTIONSSEARCH']._serialized_start=6766 - _globals['_COLLECTIONSSEARCH']._serialized_end=7159 - _globals['_ATTACHMENTSEARCH']._serialized_start=7161 - _globals['_ATTACHMENTSEARCH']._serialized_end=7216 - _globals['_FUNCTION']._serialized_start=7218 - _globals['_FUNCTION']._serialized_end=7338 - _globals['_TOOLCALL']._serialized_start=7341 - _globals['_TOOLCALL']._serialized_end=7580 - _globals['_FUNCTIONCALL']._serialized_start=7582 - _globals['_FUNCTIONCALL']._serialized_end=7646 - _globals['_RESPONSEFORMAT']._serialized_start=7648 - _globals['_RESPONSEFORMAT']._serialized_end=7758 - _globals['_SEARCHPARAMETERS']._serialized_start=7761 - _globals['_SEARCHPARAMETERS']._serialized_end=8090 - _globals['_SOURCE']._serialized_start=8093 - _globals['_SOURCE']._serialized_end=8268 - _globals['_WEBSOURCE']._serialized_start=8271 - _globals['_WEBSOURCE']._serialized_end=8446 - _globals['_NEWSSOURCE']._serialized_start=8449 - _globals['_NEWSSOURCE']._serialized_end=8582 - _globals['_XSOURCE']._serialized_start=8585 - _globals['_XSOURCE']._serialized_end=8834 - _globals['_RSSSOURCE']._serialized_start=8836 - _globals['_RSSSOURCE']._serialized_end=8869 - _globals['_REQUESTSETTINGS']._serialized_start=8872 - _globals['_REQUESTSETTINGS']._serialized_end=9671 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=9673 - _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=9734 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=9736 - _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=9800 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=9802 - _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=9867 - _globals['_DEBUGOUTPUT']._serialized_start=9870 - _globals['_DEBUGOUTPUT']._serialized_end=10312 - _globals['_COMPACTCONTEXTREQUEST']._serialized_start=10314 - _globals['_COMPACTCONTEXTREQUEST']._serialized_end=10399 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=10402 - _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=10585 - _globals['_CHAT']._serialized_start=12086 - _globals['_CHAT']._serialized_end=12751 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_SEARCHMODE']._serialized_start=5344 + _globals['_SEARCHMODE']._serialized_end=5444 + _globals['_GETCOMPLETIONSREQUEST']._serialized_start=138 + _globals['_GETCOMPLETIONSREQUEST']._serialized_end=1374 + _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_start=1377 + _globals['_GETCHATCOMPLETIONRESPONSE']._serialized_end=1823 + _globals['_GETCHATCOMPLETIONCHUNK']._serialized_start=1826 + _globals['_GETCHATCOMPLETIONCHUNK']._serialized_end=2188 + _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_start=2191 + _globals['_GETDEFERREDCOMPLETIONRESPONSE']._serialized_end=2335 + _globals['_COMPLETIONOUTPUT']._serialized_start=2338 + _globals['_COMPLETIONOUTPUT']._serialized_end=2499 + _globals['_COMPLETIONMESSAGE']._serialized_start=2502 + _globals['_COMPLETIONMESSAGE']._serialized_end=2752 + _globals['_COMPLETIONOUTPUTCHUNK']._serialized_start=2755 + _globals['_COMPLETIONOUTPUTCHUNK']._serialized_end=2907 + _globals['_DELTA']._serialized_start=2910 + _globals['_DELTA']._serialized_end=3148 + _globals['_LOGPROBS']._serialized_start=3150 + _globals['_LOGPROBS']._serialized_end=3195 + _globals['_LOGPROB']._serialized_start=3197 + _globals['_LOGPROB']._serialized_end=3296 + _globals['_TOPLOGPROB']._serialized_start=3298 + _globals['_TOPLOGPROB']._serialized_end=3357 + _globals['_MESSAGE']._serialized_start=3360 + _globals['_MESSAGE']._serialized_end=3618 + _globals['_SEARCHPARAMETERS']._serialized_start=3621 + _globals['_SEARCHPARAMETERS']._serialized_end=3882 + _globals['_REQUESTSETTINGS']._serialized_start=3885 + _globals['_REQUESTSETTINGS']._serialized_end=4494 + _globals['_RESPONSEHISTORY']._serialized_start=4497 + _globals['_RESPONSEHISTORY']._serialized_end=4654 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_start=4656 + _globals['_GETSTOREDCOMPLETIONREQUEST']._serialized_end=4705 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_start=4707 + _globals['_DELETESTOREDCOMPLETIONREQUEST']._serialized_end=4759 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_start=4761 + _globals['_DELETESTOREDCOMPLETIONRESPONSE']._serialized_end=4814 + _globals['_DEBUGOUTPUT']._serialized_start=4817 + _globals['_DEBUGOUTPUT']._serialized_end=5133 + _globals['_COMPACTCONTEXTREQUEST']._serialized_start=5135 + _globals['_COMPACTCONTEXTREQUEST']._serialized_end=5206 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_start=5209 + _globals['_COMPACTCONTEXTRESPONSE']._serialized_end=5342 + _globals['_CHAT']._serialized_start=5447 + _globals['_CHAT']._serialized_end=6190 # @@protoc_insertion_point(module_scope) + +from .chat_types_pb2 import * # re-export split types + +from .chat_bidi_v2_pb2 import * # re-export split types diff --git a/src/xai_sdk/proto/v6/chat_pb2.pyi b/src/xai_sdk/proto/v6/chat_pb2.pyi index 140be01..9879e46 100644 --- a/src/xai_sdk/proto/v6/chat_pb2.pyi +++ b/src/xai_sdk/proto/v6/chat_pb2.pyi @@ -1,85 +1,138 @@ +import datetime + from google.protobuf import timestamp_pb2 as _timestamp_pb2 from . import deferred_pb2 as _deferred_pb2 -from . import documents_pb2 as _documents_pb2 -from . import image_pb2 as _image_pb2 from . import sample_pb2 as _sample_pb2 from . import usage_pb2 as _usage_pb2 +from . import chat_types_pb2 as _chat_types_pb2 +from . import chat_bidi_v2_pb2 as _chat_bidi_v2_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from collections.abc import Iterable as _Iterable, Mapping as _Mapping from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union +from chat_types_pb2 import Content as Content +from chat_types_pb2 import FileContent as FileContent +from chat_types_pb2 import ToolChoice as ToolChoice +from chat_types_pb2 import Tool as Tool +from chat_types_pb2 import MCP as MCP +from chat_types_pb2 import WebSearch as WebSearch +from chat_types_pb2 import WebSearchUserLocation as WebSearchUserLocation +from chat_types_pb2 import XSearch as XSearch +from chat_types_pb2 import CodeExecution as CodeExecution +from chat_types_pb2 import CollectionsSearch as CollectionsSearch +from chat_types_pb2 import AttachmentSearch as AttachmentSearch +from chat_types_pb2 import LocationsSearch as LocationsSearch +from chat_types_pb2 import Function as Function +from chat_types_pb2 import LiveSearch as LiveSearch +from chat_types_pb2 import ToolCall as ToolCall +from chat_types_pb2 import FunctionCall as FunctionCall +from chat_types_pb2 import ResponseFormat as ResponseFormat +from chat_types_pb2 import InlineCitation as InlineCitation +from chat_types_pb2 import WebCitation as WebCitation +from chat_types_pb2 import XCitation as XCitation +from chat_types_pb2 import CollectionsCitation as CollectionsCitation +from chat_types_pb2 import OutputFile as OutputFile +from chat_types_pb2 import Source as Source +from chat_types_pb2 import WebSource as WebSource +from chat_types_pb2 import NewsSource as NewsSource +from chat_types_pb2 import XSource as XSource +from chat_types_pb2 import RssSource as RssSource +from chat_types_pb2 import MessageRole as MessageRole +from chat_types_pb2 import ReasoningEffort as ReasoningEffort +from chat_types_pb2 import AgentCount as AgentCount +from chat_types_pb2 import IncludeOption as IncludeOption +from chat_types_pb2 import ToolMode as ToolMode +from chat_types_pb2 import FormatType as FormatType +from chat_types_pb2 import ToolCallType as ToolCallType +from chat_types_pb2 import ToolCallStatus as ToolCallStatus +from chat_bidi_v2_pb2 import ServerEvent as ServerEvent +from chat_bidi_v2_pb2 import ResponseCreatedEvent as ResponseCreatedEvent +from chat_bidi_v2_pb2 import ResponseCompletedEvent as ResponseCompletedEvent +from chat_bidi_v2_pb2 import ResponseFailedEvent as ResponseFailedEvent +from chat_bidi_v2_pb2 import ResponseIncompleteEvent as ResponseIncompleteEvent +from chat_bidi_v2_pb2 import AgentInfo as AgentInfo +from chat_bidi_v2_pb2 import OutputItem as OutputItem +from chat_bidi_v2_pb2 import OutputMessageContent as OutputMessageContent +from chat_bidi_v2_pb2 import OutputTextAnnotation as OutputTextAnnotation +from chat_bidi_v2_pb2 import ToolCallInfo as ToolCallInfo +from chat_bidi_v2_pb2 import ContentPart as ContentPart +from chat_bidi_v2_pb2 import OutputItemAddedEvent as OutputItemAddedEvent +from chat_bidi_v2_pb2 import OutputItemDoneEvent as OutputItemDoneEvent +from chat_bidi_v2_pb2 import OutputTextDeltaEvent as OutputTextDeltaEvent +from chat_bidi_v2_pb2 import OutputTextDoneEvent as OutputTextDoneEvent +from chat_bidi_v2_pb2 import OutputTextAnnotationAddedEvent as OutputTextAnnotationAddedEvent +from chat_bidi_v2_pb2 import ReasoningTextDeltaEvent as ReasoningTextDeltaEvent +from chat_bidi_v2_pb2 import ReasoningTextDoneEvent as ReasoningTextDoneEvent +from chat_bidi_v2_pb2 import ToolCallArgumentsDeltaEvent as ToolCallArgumentsDeltaEvent +from chat_bidi_v2_pb2 import ToolCallArgumentsDoneEvent as ToolCallArgumentsDoneEvent +from chat_bidi_v2_pb2 import ToolCallInProgressEvent as ToolCallInProgressEvent +from chat_bidi_v2_pb2 import ToolCallCompletedEvent as ToolCallCompletedEvent +from chat_bidi_v2_pb2 import ToolCallFailedEvent as ToolCallFailedEvent +from chat_bidi_v2_pb2 import ErrorEvent as ErrorEvent +from chat_bidi_v2_pb2 import StreamError as StreamError +from chat_bidi_v2_pb2 import ClientEvent as ClientEvent +from chat_bidi_v2_pb2 import ToolResultEvent as ToolResultEvent +from chat_bidi_v2_pb2 import CancelResponseEvent as CancelResponseEvent +from chat_bidi_v2_pb2 import ConversationRequest as ConversationRequest +from chat_bidi_v2_pb2 import InputItem as InputItem +from chat_bidi_v2_pb2 import InputMessage as InputMessage +from chat_bidi_v2_pb2 import FunctionCallOutput as FunctionCallOutput +from chat_bidi_v2_pb2 import AgentRole as AgentRole DESCRIPTOR: _descriptor.FileDescriptor - -class IncludeOption(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INCLUDE_OPTION_INVALID: _ClassVar[IncludeOption] - INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_MCP_CALL_OUTPUT: _ClassVar[IncludeOption] - INCLUDE_OPTION_INLINE_CITATIONS: _ClassVar[IncludeOption] - INCLUDE_OPTION_VERBOSE_STREAMING: _ClassVar[IncludeOption] - -class MessageRole(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INVALID_ROLE: _ClassVar[MessageRole] - ROLE_USER: _ClassVar[MessageRole] - ROLE_ASSISTANT: _ClassVar[MessageRole] - ROLE_SYSTEM: _ClassVar[MessageRole] - ROLE_FUNCTION: _ClassVar[MessageRole] - ROLE_TOOL: _ClassVar[MessageRole] - ROLE_DEVELOPER: _ClassVar[MessageRole] - -class ReasoningEffort(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - INVALID_EFFORT: _ClassVar[ReasoningEffort] - EFFORT_LOW: _ClassVar[ReasoningEffort] - EFFORT_MEDIUM: _ClassVar[ReasoningEffort] - EFFORT_HIGH: _ClassVar[ReasoningEffort] - EFFORT_NONE: _ClassVar[ReasoningEffort] - -class AgentCount(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - AGENT_COUNT_UNSPECIFIED: _ClassVar[AgentCount] - AGENT_COUNT_4: _ClassVar[AgentCount] - AGENT_COUNT_16: _ClassVar[AgentCount] - -class ToolMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOOL_MODE_INVALID: _ClassVar[ToolMode] - TOOL_MODE_AUTO: _ClassVar[ToolMode] - TOOL_MODE_NONE: _ClassVar[ToolMode] - TOOL_MODE_REQUIRED: _ClassVar[ToolMode] - -class FormatType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - FORMAT_TYPE_INVALID: _ClassVar[FormatType] - FORMAT_TYPE_TEXT: _ClassVar[FormatType] - FORMAT_TYPE_JSON_OBJECT: _ClassVar[FormatType] - FORMAT_TYPE_JSON_SCHEMA: _ClassVar[FormatType] - -class ToolCallType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOOL_CALL_TYPE_INVALID: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_CLIENT_SIDE_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_WEB_SEARCH_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_X_SEARCH_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_CODE_EXECUTION_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_MCP_TOOL: _ClassVar[ToolCallType] - TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: _ClassVar[ToolCallType] - -class ToolCallStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): - __slots__ = () - TOOL_CALL_STATUS_IN_PROGRESS: _ClassVar[ToolCallStatus] - TOOL_CALL_STATUS_COMPLETED: _ClassVar[ToolCallStatus] - TOOL_CALL_STATUS_INCOMPLETE: _ClassVar[ToolCallStatus] - TOOL_CALL_STATUS_FAILED: _ClassVar[ToolCallStatus] +INVALID_ROLE: _chat_types_pb2.MessageRole +ROLE_USER: _chat_types_pb2.MessageRole +ROLE_ASSISTANT: _chat_types_pb2.MessageRole +ROLE_SYSTEM: _chat_types_pb2.MessageRole +ROLE_FUNCTION: _chat_types_pb2.MessageRole +ROLE_TOOL: _chat_types_pb2.MessageRole +ROLE_DEVELOPER: _chat_types_pb2.MessageRole +INVALID_EFFORT: _chat_types_pb2.ReasoningEffort +EFFORT_LOW: _chat_types_pb2.ReasoningEffort +EFFORT_MEDIUM: _chat_types_pb2.ReasoningEffort +EFFORT_HIGH: _chat_types_pb2.ReasoningEffort +EFFORT_NONE: _chat_types_pb2.ReasoningEffort +AGENT_COUNT_UNSPECIFIED: _chat_types_pb2.AgentCount +AGENT_COUNT_4: _chat_types_pb2.AgentCount +AGENT_COUNT_16: _chat_types_pb2.AgentCount +INCLUDE_OPTION_INVALID: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_MCP_CALL_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_INLINE_CITATIONS: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_VERBOSE_STREAMING: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_CODE_EXECUTION_FILES_OUTPUT: _chat_types_pb2.IncludeOption +INCLUDE_OPTION_TOOL_CALL_STREAMING: _chat_types_pb2.IncludeOption +TOOL_MODE_INVALID: _chat_types_pb2.ToolMode +TOOL_MODE_AUTO: _chat_types_pb2.ToolMode +TOOL_MODE_NONE: _chat_types_pb2.ToolMode +TOOL_MODE_REQUIRED: _chat_types_pb2.ToolMode +FORMAT_TYPE_INVALID: _chat_types_pb2.FormatType +FORMAT_TYPE_TEXT: _chat_types_pb2.FormatType +FORMAT_TYPE_JSON_OBJECT: _chat_types_pb2.FormatType +FORMAT_TYPE_JSON_SCHEMA: _chat_types_pb2.FormatType +TOOL_CALL_TYPE_INVALID: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_CLIENT_SIDE_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_WEB_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_X_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_CODE_EXECUTION_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_COLLECTIONS_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_MCP_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_ATTACHMENT_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_CONNECTOR_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_TYPE_LOCATIONS_SEARCH_TOOL: _chat_types_pb2.ToolCallType +TOOL_CALL_STATUS_IN_PROGRESS: _chat_types_pb2.ToolCallStatus +TOOL_CALL_STATUS_COMPLETED: _chat_types_pb2.ToolCallStatus +TOOL_CALL_STATUS_INCOMPLETE: _chat_types_pb2.ToolCallStatus +TOOL_CALL_STATUS_FAILED: _chat_types_pb2.ToolCallStatus +AGENT_ROLE_UNSPECIFIED: _chat_bidi_v2_pb2.AgentRole +AGENT_ROLE_LEADER: _chat_bidi_v2_pb2.AgentRole +AGENT_ROLE_MEMBER: _chat_bidi_v2_pb2.AgentRole class SearchMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () @@ -87,57 +140,13 @@ class SearchMode(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): OFF_SEARCH_MODE: _ClassVar[SearchMode] ON_SEARCH_MODE: _ClassVar[SearchMode] AUTO_SEARCH_MODE: _ClassVar[SearchMode] -INCLUDE_OPTION_INVALID: IncludeOption -INCLUDE_OPTION_WEB_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_X_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_CODE_EXECUTION_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_COLLECTIONS_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_ATTACHMENT_SEARCH_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_MCP_CALL_OUTPUT: IncludeOption -INCLUDE_OPTION_INLINE_CITATIONS: IncludeOption -INCLUDE_OPTION_VERBOSE_STREAMING: IncludeOption -INVALID_ROLE: MessageRole -ROLE_USER: MessageRole -ROLE_ASSISTANT: MessageRole -ROLE_SYSTEM: MessageRole -ROLE_FUNCTION: MessageRole -ROLE_TOOL: MessageRole -ROLE_DEVELOPER: MessageRole -INVALID_EFFORT: ReasoningEffort -EFFORT_LOW: ReasoningEffort -EFFORT_MEDIUM: ReasoningEffort -EFFORT_HIGH: ReasoningEffort -EFFORT_NONE: ReasoningEffort -AGENT_COUNT_UNSPECIFIED: AgentCount -AGENT_COUNT_4: AgentCount -AGENT_COUNT_16: AgentCount -TOOL_MODE_INVALID: ToolMode -TOOL_MODE_AUTO: ToolMode -TOOL_MODE_NONE: ToolMode -TOOL_MODE_REQUIRED: ToolMode -FORMAT_TYPE_INVALID: FormatType -FORMAT_TYPE_TEXT: FormatType -FORMAT_TYPE_JSON_OBJECT: FormatType -FORMAT_TYPE_JSON_SCHEMA: FormatType -TOOL_CALL_TYPE_INVALID: ToolCallType -TOOL_CALL_TYPE_CLIENT_SIDE_TOOL: ToolCallType -TOOL_CALL_TYPE_WEB_SEARCH_TOOL: ToolCallType -TOOL_CALL_TYPE_X_SEARCH_TOOL: ToolCallType -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_STATUS_IN_PROGRESS: ToolCallStatus -TOOL_CALL_STATUS_COMPLETED: ToolCallStatus -TOOL_CALL_STATUS_INCOMPLETE: ToolCallStatus -TOOL_CALL_STATUS_FAILED: ToolCallStatus INVALID_SEARCH_MODE: SearchMode OFF_SEARCH_MODE: SearchMode ON_SEARCH_MODE: SearchMode AUTO_SEARCH_MODE: SearchMode class GetCompletionsRequest(_message.Message): - __slots__ = ("messages", "model", "user", "n", "max_tokens", "seed", "stop", "temperature", "top_p", "logprobs", "top_logprobs", "tools", "tool_choice", "response_format", "frequency_penalty", "presence_penalty", "reasoning_effort", "search_parameters", "parallel_tool_calls", "previous_response_id", "store_messages", "use_encrypted_content", "max_turns", "include", "agent_count") + __slots__ = ("messages", "model", "user", "n", "max_tokens", "seed", "stop", "temperature", "top_p", "logprobs", "top_logprobs", "tools", "tool_choice", "response_format", "frequency_penalty", "presence_penalty", "reasoning_effort", "search_parameters", "parallel_tool_calls", "previous_response_id", "store_messages", "use_encrypted_content", "max_turns", "include", "bootstrap_host", "bootstrap_room", "agent_count", "cache_salt", "service_tier") MESSAGES_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] USER_FIELD_NUMBER: _ClassVar[int] @@ -162,7 +171,11 @@ class GetCompletionsRequest(_message.Message): USE_ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] MAX_TURNS_FIELD_NUMBER: _ClassVar[int] INCLUDE_FIELD_NUMBER: _ClassVar[int] + BOOTSTRAP_HOST_FIELD_NUMBER: _ClassVar[int] + BOOTSTRAP_ROOM_FIELD_NUMBER: _ClassVar[int] AGENT_COUNT_FIELD_NUMBER: _ClassVar[int] + CACHE_SALT_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] messages: _containers.RepeatedCompositeFieldContainer[Message] model: str user: str @@ -174,24 +187,28 @@ class GetCompletionsRequest(_message.Message): top_p: float logprobs: bool top_logprobs: int - tools: _containers.RepeatedCompositeFieldContainer[Tool] - tool_choice: ToolChoice - response_format: ResponseFormat + tools: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Tool] + tool_choice: _chat_types_pb2.ToolChoice + response_format: _chat_types_pb2.ResponseFormat frequency_penalty: float presence_penalty: float - reasoning_effort: ReasoningEffort + reasoning_effort: _chat_types_pb2.ReasoningEffort search_parameters: SearchParameters parallel_tool_calls: bool previous_response_id: str store_messages: bool use_encrypted_content: bool max_turns: int - include: _containers.RepeatedScalarFieldContainer[IncludeOption] - agent_count: AgentCount - def __init__(self, messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., model: _Optional[str] = ..., user: _Optional[str] = ..., n: _Optional[int] = ..., max_tokens: _Optional[int] = ..., seed: _Optional[int] = ..., stop: _Optional[_Iterable[str]] = ..., temperature: _Optional[float] = ..., top_p: _Optional[float] = ..., logprobs: bool = ..., top_logprobs: _Optional[int] = ..., tools: _Optional[_Iterable[_Union[Tool, _Mapping]]] = ..., tool_choice: _Optional[_Union[ToolChoice, _Mapping]] = ..., response_format: _Optional[_Union[ResponseFormat, _Mapping]] = ..., frequency_penalty: _Optional[float] = ..., presence_penalty: _Optional[float] = ..., reasoning_effort: _Optional[_Union[ReasoningEffort, str]] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., parallel_tool_calls: bool = ..., previous_response_id: _Optional[str] = ..., store_messages: bool = ..., use_encrypted_content: bool = ..., max_turns: _Optional[int] = ..., include: _Optional[_Iterable[_Union[IncludeOption, str]]] = ..., agent_count: _Optional[_Union[AgentCount, str]] = ...) -> None: ... + include: _containers.RepeatedScalarFieldContainer[_chat_types_pb2.IncludeOption] + bootstrap_host: str + bootstrap_room: int + agent_count: _chat_types_pb2.AgentCount + cache_salt: str + service_tier: _usage_pb2.ServiceTier + def __init__(self, messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., model: _Optional[str] = ..., user: _Optional[str] = ..., n: _Optional[int] = ..., max_tokens: _Optional[int] = ..., seed: _Optional[int] = ..., stop: _Optional[_Iterable[str]] = ..., temperature: _Optional[float] = ..., top_p: _Optional[float] = ..., logprobs: _Optional[bool] = ..., top_logprobs: _Optional[int] = ..., tools: _Optional[_Iterable[_Union[_chat_types_pb2.Tool, _Mapping]]] = ..., tool_choice: _Optional[_Union[_chat_types_pb2.ToolChoice, _Mapping]] = ..., response_format: _Optional[_Union[_chat_types_pb2.ResponseFormat, _Mapping]] = ..., frequency_penalty: _Optional[float] = ..., presence_penalty: _Optional[float] = ..., reasoning_effort: _Optional[_Union[_chat_types_pb2.ReasoningEffort, str]] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., parallel_tool_calls: _Optional[bool] = ..., previous_response_id: _Optional[str] = ..., store_messages: _Optional[bool] = ..., use_encrypted_content: _Optional[bool] = ..., max_turns: _Optional[int] = ..., include: _Optional[_Iterable[_Union[_chat_types_pb2.IncludeOption, str]]] = ..., bootstrap_host: _Optional[str] = ..., bootstrap_room: _Optional[int] = ..., agent_count: _Optional[_Union[_chat_types_pb2.AgentCount, str]] = ..., cache_salt: _Optional[str] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetChatCompletionResponse(_message.Message): - __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "settings", "debug_output") + __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "settings", "debug_output", "output_files", "input_messages", "service_tier") ID_FIELD_NUMBER: _ClassVar[int] OUTPUTS_FIELD_NUMBER: _ClassVar[int] CREATED_FIELD_NUMBER: _ClassVar[int] @@ -201,6 +218,9 @@ class GetChatCompletionResponse(_message.Message): CITATIONS_FIELD_NUMBER: _ClassVar[int] SETTINGS_FIELD_NUMBER: _ClassVar[int] DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FILES_FIELD_NUMBER: _ClassVar[int] + INPUT_MESSAGES_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] id: str outputs: _containers.RepeatedCompositeFieldContainer[CompletionOutput] created: _timestamp_pb2.Timestamp @@ -210,10 +230,13 @@ class GetChatCompletionResponse(_message.Message): citations: _containers.RepeatedScalarFieldContainer[str] settings: RequestSettings debug_output: DebugOutput - def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutput, _Mapping]]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., settings: _Optional[_Union[RequestSettings, _Mapping]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ...) -> None: ... + output_files: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.OutputFile] + input_messages: _containers.RepeatedCompositeFieldContainer[Message] + service_tier: _usage_pb2.ServiceTier + def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutput, _Mapping]]] = ..., created: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., settings: _Optional[_Union[RequestSettings, _Mapping]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ..., output_files: _Optional[_Iterable[_Union[_chat_types_pb2.OutputFile, _Mapping]]] = ..., input_messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetChatCompletionChunk(_message.Message): - __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "debug_output") + __slots__ = ("id", "outputs", "created", "model", "system_fingerprint", "usage", "citations", "debug_output", "output_files", "service_tier") ID_FIELD_NUMBER: _ClassVar[int] OUTPUTS_FIELD_NUMBER: _ClassVar[int] CREATED_FIELD_NUMBER: _ClassVar[int] @@ -222,6 +245,8 @@ class GetChatCompletionChunk(_message.Message): USAGE_FIELD_NUMBER: _ClassVar[int] CITATIONS_FIELD_NUMBER: _ClassVar[int] DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FILES_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] id: str outputs: _containers.RepeatedCompositeFieldContainer[CompletionOutputChunk] created: _timestamp_pb2.Timestamp @@ -230,7 +255,9 @@ class GetChatCompletionChunk(_message.Message): usage: _usage_pb2.SamplingUsage citations: _containers.RepeatedScalarFieldContainer[str] debug_output: DebugOutput - def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutputChunk, _Mapping]]] = ..., created: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ...) -> None: ... + output_files: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.OutputFile] + service_tier: _usage_pb2.ServiceTier + def __init__(self, id: _Optional[str] = ..., outputs: _Optional[_Iterable[_Union[CompletionOutputChunk, _Mapping]]] = ..., created: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., model: _Optional[str] = ..., system_fingerprint: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., citations: _Optional[_Iterable[str]] = ..., debug_output: _Optional[_Union[DebugOutput, _Mapping]] = ..., output_files: _Optional[_Iterable[_Union[_chat_types_pb2.OutputFile, _Mapping]]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetDeferredCompletionResponse(_message.Message): __slots__ = ("status", "response") @@ -253,20 +280,22 @@ class CompletionOutput(_message.Message): def __init__(self, finish_reason: _Optional[_Union[_sample_pb2.FinishReason, str]] = ..., index: _Optional[int] = ..., message: _Optional[_Union[CompletionMessage, _Mapping]] = ..., logprobs: _Optional[_Union[LogProbs, _Mapping]] = ...) -> None: ... class CompletionMessage(_message.Message): - __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations") + __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations", "is_reasoning_content_summarized") CONTENT_FIELD_NUMBER: _ClassVar[int] REASONING_CONTENT_FIELD_NUMBER: _ClassVar[int] ROLE_FIELD_NUMBER: _ClassVar[int] TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] CITATIONS_FIELD_NUMBER: _ClassVar[int] + IS_REASONING_CONTENT_SUMMARIZED_FIELD_NUMBER: _ClassVar[int] content: str reasoning_content: str - role: MessageRole - tool_calls: _containers.RepeatedCompositeFieldContainer[ToolCall] + role: _chat_types_pb2.MessageRole + tool_calls: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.ToolCall] encrypted_content: str - citations: _containers.RepeatedCompositeFieldContainer[InlineCitation] - def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[InlineCitation, _Mapping]]] = ...) -> None: ... + citations: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.InlineCitation] + is_reasoning_content_summarized: bool + def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[_chat_types_pb2.MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[_chat_types_pb2.ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[_chat_types_pb2.InlineCitation, _Mapping]]] = ..., is_reasoning_content_summarized: _Optional[bool] = ...) -> None: ... class CompletionOutputChunk(_message.Message): __slots__ = ("delta", "logprobs", "finish_reason", "index") @@ -281,62 +310,22 @@ class CompletionOutputChunk(_message.Message): def __init__(self, delta: _Optional[_Union[Delta, _Mapping]] = ..., logprobs: _Optional[_Union[LogProbs, _Mapping]] = ..., finish_reason: _Optional[_Union[_sample_pb2.FinishReason, str]] = ..., index: _Optional[int] = ...) -> None: ... class Delta(_message.Message): - __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations") + __slots__ = ("content", "reasoning_content", "role", "tool_calls", "encrypted_content", "citations", "is_reasoning_content_summarized") CONTENT_FIELD_NUMBER: _ClassVar[int] REASONING_CONTENT_FIELD_NUMBER: _ClassVar[int] ROLE_FIELD_NUMBER: _ClassVar[int] TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] CITATIONS_FIELD_NUMBER: _ClassVar[int] + IS_REASONING_CONTENT_SUMMARIZED_FIELD_NUMBER: _ClassVar[int] content: str reasoning_content: str - role: MessageRole - tool_calls: _containers.RepeatedCompositeFieldContainer[ToolCall] + role: _chat_types_pb2.MessageRole + tool_calls: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.ToolCall] encrypted_content: str - citations: _containers.RepeatedCompositeFieldContainer[InlineCitation] - def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[InlineCitation, _Mapping]]] = ...) -> None: ... - -class InlineCitation(_message.Message): - __slots__ = ("id", "start_index", "end_index", "web_citation", "x_citation", "collections_citation") - ID_FIELD_NUMBER: _ClassVar[int] - START_INDEX_FIELD_NUMBER: _ClassVar[int] - END_INDEX_FIELD_NUMBER: _ClassVar[int] - WEB_CITATION_FIELD_NUMBER: _ClassVar[int] - X_CITATION_FIELD_NUMBER: _ClassVar[int] - COLLECTIONS_CITATION_FIELD_NUMBER: _ClassVar[int] - id: str - start_index: int - end_index: int - web_citation: WebCitation - x_citation: XCitation - collections_citation: CollectionsCitation - def __init__(self, id: _Optional[str] = ..., start_index: _Optional[int] = ..., end_index: _Optional[int] = ..., web_citation: _Optional[_Union[WebCitation, _Mapping]] = ..., x_citation: _Optional[_Union[XCitation, _Mapping]] = ..., collections_citation: _Optional[_Union[CollectionsCitation, _Mapping]] = ...) -> None: ... - -class WebCitation(_message.Message): - __slots__ = ("url",) - URL_FIELD_NUMBER: _ClassVar[int] - url: str - def __init__(self, url: _Optional[str] = ...) -> None: ... - -class XCitation(_message.Message): - __slots__ = ("url",) - URL_FIELD_NUMBER: _ClassVar[int] - url: str - def __init__(self, url: _Optional[str] = ...) -> None: ... - -class CollectionsCitation(_message.Message): - __slots__ = ("file_id", "chunk_id", "chunk_content", "score", "collection_ids") - FILE_ID_FIELD_NUMBER: _ClassVar[int] - CHUNK_ID_FIELD_NUMBER: _ClassVar[int] - CHUNK_CONTENT_FIELD_NUMBER: _ClassVar[int] - SCORE_FIELD_NUMBER: _ClassVar[int] - COLLECTION_IDS_FIELD_NUMBER: _ClassVar[int] - file_id: str - chunk_id: str - chunk_content: str - score: float - collection_ids: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, file_id: _Optional[str] = ..., chunk_id: _Optional[str] = ..., chunk_content: _Optional[str] = ..., score: _Optional[float] = ..., collection_ids: _Optional[_Iterable[str]] = ...) -> None: ... + citations: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.InlineCitation] + is_reasoning_content_summarized: bool + def __init__(self, content: _Optional[str] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[_chat_types_pb2.MessageRole, str]] = ..., tool_calls: _Optional[_Iterable[_Union[_chat_types_pb2.ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., citations: _Optional[_Iterable[_Union[_chat_types_pb2.InlineCitation, _Mapping]]] = ..., is_reasoning_content_summarized: _Optional[bool] = ...) -> None: ... class LogProbs(_message.Message): __slots__ = ("content",) @@ -366,30 +355,6 @@ class TopLogProb(_message.Message): bytes: bytes def __init__(self, token: _Optional[str] = ..., logprob: _Optional[float] = ..., bytes: _Optional[bytes] = ...) -> None: ... -class Content(_message.Message): - __slots__ = ("text", "image_url", "file") - TEXT_FIELD_NUMBER: _ClassVar[int] - IMAGE_URL_FIELD_NUMBER: _ClassVar[int] - FILE_FIELD_NUMBER: _ClassVar[int] - text: str - image_url: _image_pb2.ImageUrlContent - file: FileContent - def __init__(self, text: _Optional[str] = ..., image_url: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., file: _Optional[_Union[FileContent, _Mapping]] = ...) -> None: ... - -class FileContent(_message.Message): - __slots__ = ("file_id", "data", "filename", "mime_type", "url") - FILE_ID_FIELD_NUMBER: _ClassVar[int] - DATA_FIELD_NUMBER: _ClassVar[int] - FILENAME_FIELD_NUMBER: _ClassVar[int] - MIME_TYPE_FIELD_NUMBER: _ClassVar[int] - URL_FIELD_NUMBER: _ClassVar[int] - file_id: str - data: bytes - filename: str - mime_type: str - url: str - def __init__(self, file_id: _Optional[str] = ..., data: _Optional[bytes] = ..., filename: _Optional[str] = ..., mime_type: _Optional[str] = ..., url: _Optional[str] = ...) -> None: ... - class Message(_message.Message): __slots__ = ("content", "reasoning_content", "role", "name", "tool_calls", "encrypted_content", "tool_call_id") CONTENT_FIELD_NUMBER: _ClassVar[int] @@ -399,173 +364,14 @@ class Message(_message.Message): TOOL_CALLS_FIELD_NUMBER: _ClassVar[int] ENCRYPTED_CONTENT_FIELD_NUMBER: _ClassVar[int] TOOL_CALL_ID_FIELD_NUMBER: _ClassVar[int] - content: _containers.RepeatedCompositeFieldContainer[Content] + content: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Content] reasoning_content: str - role: MessageRole + role: _chat_types_pb2.MessageRole name: str - tool_calls: _containers.RepeatedCompositeFieldContainer[ToolCall] + tool_calls: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.ToolCall] encrypted_content: str tool_call_id: str - def __init__(self, content: _Optional[_Iterable[_Union[Content, _Mapping]]] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[MessageRole, str]] = ..., name: _Optional[str] = ..., tool_calls: _Optional[_Iterable[_Union[ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., tool_call_id: _Optional[str] = ...) -> None: ... - -class ToolChoice(_message.Message): - __slots__ = ("mode", "function_name") - MODE_FIELD_NUMBER: _ClassVar[int] - FUNCTION_NAME_FIELD_NUMBER: _ClassVar[int] - mode: ToolMode - function_name: str - 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") - FUNCTION_FIELD_NUMBER: _ClassVar[int] - WEB_SEARCH_FIELD_NUMBER: _ClassVar[int] - X_SEARCH_FIELD_NUMBER: _ClassVar[int] - CODE_EXECUTION_FIELD_NUMBER: _ClassVar[int] - COLLECTIONS_SEARCH_FIELD_NUMBER: _ClassVar[int] - MCP_FIELD_NUMBER: _ClassVar[int] - ATTACHMENT_SEARCH_FIELD_NUMBER: _ClassVar[int] - function: Function - web_search: WebSearch - x_search: XSearch - code_execution: CodeExecution - 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: ... - -class MCP(_message.Message): - __slots__ = ("server_label", "server_description", "server_url", "allowed_tool_names", "authorization", "extra_headers") - class ExtraHeadersEntry(_message.Message): - __slots__ = ("key", "value") - KEY_FIELD_NUMBER: _ClassVar[int] - VALUE_FIELD_NUMBER: _ClassVar[int] - key: str - value: str - def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ... - SERVER_LABEL_FIELD_NUMBER: _ClassVar[int] - SERVER_DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - SERVER_URL_FIELD_NUMBER: _ClassVar[int] - ALLOWED_TOOL_NAMES_FIELD_NUMBER: _ClassVar[int] - AUTHORIZATION_FIELD_NUMBER: _ClassVar[int] - EXTRA_HEADERS_FIELD_NUMBER: _ClassVar[int] - server_label: str - server_description: str - server_url: str - allowed_tool_names: _containers.RepeatedScalarFieldContainer[str] - authorization: str - extra_headers: _containers.ScalarMap[str, str] - def __init__(self, server_label: _Optional[str] = ..., server_description: _Optional[str] = ..., server_url: _Optional[str] = ..., allowed_tool_names: _Optional[_Iterable[str]] = ..., authorization: _Optional[str] = ..., extra_headers: _Optional[_Mapping[str, str]] = ...) -> None: ... - -class WebSearch(_message.Message): - __slots__ = ("excluded_domains", "allowed_domains", "enable_image_understanding", "user_location", "enable_image_search") - EXCLUDED_DOMAINS_FIELD_NUMBER: _ClassVar[int] - ALLOWED_DOMAINS_FIELD_NUMBER: _ClassVar[int] - ENABLE_IMAGE_UNDERSTANDING_FIELD_NUMBER: _ClassVar[int] - USER_LOCATION_FIELD_NUMBER: _ClassVar[int] - ENABLE_IMAGE_SEARCH_FIELD_NUMBER: _ClassVar[int] - excluded_domains: _containers.RepeatedScalarFieldContainer[str] - allowed_domains: _containers.RepeatedScalarFieldContainer[str] - enable_image_understanding: bool - user_location: WebSearchUserLocation - enable_image_search: bool - def __init__(self, excluded_domains: _Optional[_Iterable[str]] = ..., allowed_domains: _Optional[_Iterable[str]] = ..., enable_image_understanding: bool = ..., user_location: _Optional[_Union[WebSearchUserLocation, _Mapping]] = ..., enable_image_search: bool = ...) -> None: ... - -class WebSearchUserLocation(_message.Message): - __slots__ = ("country", "city", "region", "timezone") - COUNTRY_FIELD_NUMBER: _ClassVar[int] - CITY_FIELD_NUMBER: _ClassVar[int] - REGION_FIELD_NUMBER: _ClassVar[int] - TIMEZONE_FIELD_NUMBER: _ClassVar[int] - country: str - city: str - region: str - timezone: str - def __init__(self, country: _Optional[str] = ..., city: _Optional[str] = ..., region: _Optional[str] = ..., timezone: _Optional[str] = ...) -> None: ... - -class XSearch(_message.Message): - __slots__ = ("from_date", "to_date", "allowed_x_handles", "excluded_x_handles", "enable_image_understanding", "enable_video_understanding") - FROM_DATE_FIELD_NUMBER: _ClassVar[int] - TO_DATE_FIELD_NUMBER: _ClassVar[int] - ALLOWED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - EXCLUDED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - ENABLE_IMAGE_UNDERSTANDING_FIELD_NUMBER: _ClassVar[int] - ENABLE_VIDEO_UNDERSTANDING_FIELD_NUMBER: _ClassVar[int] - from_date: _timestamp_pb2.Timestamp - to_date: _timestamp_pb2.Timestamp - allowed_x_handles: _containers.RepeatedScalarFieldContainer[str] - excluded_x_handles: _containers.RepeatedScalarFieldContainer[str] - enable_image_understanding: bool - enable_video_understanding: bool - def __init__(self, from_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., to_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., allowed_x_handles: _Optional[_Iterable[str]] = ..., excluded_x_handles: _Optional[_Iterable[str]] = ..., enable_image_understanding: bool = ..., enable_video_understanding: bool = ...) -> None: ... - -class CodeExecution(_message.Message): - __slots__ = () - def __init__(self) -> None: ... - -class CollectionsSearch(_message.Message): - __slots__ = ("collection_ids", "limit", "instructions", "hybrid_retrieval", "semantic_retrieval", "keyword_retrieval") - COLLECTION_IDS_FIELD_NUMBER: _ClassVar[int] - LIMIT_FIELD_NUMBER: _ClassVar[int] - INSTRUCTIONS_FIELD_NUMBER: _ClassVar[int] - HYBRID_RETRIEVAL_FIELD_NUMBER: _ClassVar[int] - SEMANTIC_RETRIEVAL_FIELD_NUMBER: _ClassVar[int] - KEYWORD_RETRIEVAL_FIELD_NUMBER: _ClassVar[int] - collection_ids: _containers.RepeatedScalarFieldContainer[str] - limit: int - instructions: str - hybrid_retrieval: _documents_pb2.HybridRetrieval - semantic_retrieval: _documents_pb2.SemanticRetrieval - keyword_retrieval: _documents_pb2.KeywordRetrieval - def __init__(self, collection_ids: _Optional[_Iterable[str]] = ..., limit: _Optional[int] = ..., instructions: _Optional[str] = ..., hybrid_retrieval: _Optional[_Union[_documents_pb2.HybridRetrieval, _Mapping]] = ..., semantic_retrieval: _Optional[_Union[_documents_pb2.SemanticRetrieval, _Mapping]] = ..., keyword_retrieval: _Optional[_Union[_documents_pb2.KeywordRetrieval, _Mapping]] = ...) -> None: ... - -class AttachmentSearch(_message.Message): - __slots__ = ("limit",) - LIMIT_FIELD_NUMBER: _ClassVar[int] - limit: int - def __init__(self, limit: _Optional[int] = ...) -> None: ... - -class Function(_message.Message): - __slots__ = ("name", "description", "strict", "parameters") - NAME_FIELD_NUMBER: _ClassVar[int] - DESCRIPTION_FIELD_NUMBER: _ClassVar[int] - STRICT_FIELD_NUMBER: _ClassVar[int] - PARAMETERS_FIELD_NUMBER: _ClassVar[int] - name: str - description: str - strict: bool - parameters: str - def __init__(self, name: _Optional[str] = ..., description: _Optional[str] = ..., strict: bool = ..., parameters: _Optional[str] = ...) -> None: ... - -class ToolCall(_message.Message): - __slots__ = ("id", "type", "status", "error_message", "function") - ID_FIELD_NUMBER: _ClassVar[int] - TYPE_FIELD_NUMBER: _ClassVar[int] - STATUS_FIELD_NUMBER: _ClassVar[int] - ERROR_MESSAGE_FIELD_NUMBER: _ClassVar[int] - FUNCTION_FIELD_NUMBER: _ClassVar[int] - id: str - type: ToolCallType - status: ToolCallStatus - error_message: str - function: FunctionCall - def __init__(self, id: _Optional[str] = ..., type: _Optional[_Union[ToolCallType, str]] = ..., status: _Optional[_Union[ToolCallStatus, str]] = ..., error_message: _Optional[str] = ..., function: _Optional[_Union[FunctionCall, _Mapping]] = ...) -> None: ... - -class FunctionCall(_message.Message): - __slots__ = ("name", "arguments") - NAME_FIELD_NUMBER: _ClassVar[int] - ARGUMENTS_FIELD_NUMBER: _ClassVar[int] - name: str - arguments: str - def __init__(self, name: _Optional[str] = ..., arguments: _Optional[str] = ...) -> None: ... - -class ResponseFormat(_message.Message): - __slots__ = ("format_type", "schema") - FORMAT_TYPE_FIELD_NUMBER: _ClassVar[int] - SCHEMA_FIELD_NUMBER: _ClassVar[int] - format_type: FormatType - schema: str - def __init__(self, format_type: _Optional[_Union[FormatType, str]] = ..., schema: _Optional[str] = ...) -> None: ... + def __init__(self, content: _Optional[_Iterable[_Union[_chat_types_pb2.Content, _Mapping]]] = ..., reasoning_content: _Optional[str] = ..., role: _Optional[_Union[_chat_types_pb2.MessageRole, str]] = ..., name: _Optional[str] = ..., tool_calls: _Optional[_Iterable[_Union[_chat_types_pb2.ToolCall, _Mapping]]] = ..., encrypted_content: _Optional[str] = ..., tool_call_id: _Optional[str] = ...) -> None: ... class SearchParameters(_message.Message): __slots__ = ("mode", "sources", "from_date", "to_date", "return_citations", "max_search_results") @@ -576,64 +382,12 @@ class SearchParameters(_message.Message): RETURN_CITATIONS_FIELD_NUMBER: _ClassVar[int] MAX_SEARCH_RESULTS_FIELD_NUMBER: _ClassVar[int] mode: SearchMode - sources: _containers.RepeatedCompositeFieldContainer[Source] + sources: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Source] from_date: _timestamp_pb2.Timestamp to_date: _timestamp_pb2.Timestamp return_citations: bool max_search_results: int - def __init__(self, mode: _Optional[_Union[SearchMode, str]] = ..., sources: _Optional[_Iterable[_Union[Source, _Mapping]]] = ..., from_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., to_date: _Optional[_Union[_timestamp_pb2.Timestamp, _Mapping]] = ..., return_citations: bool = ..., max_search_results: _Optional[int] = ...) -> None: ... - -class Source(_message.Message): - __slots__ = ("web", "news", "x", "rss") - WEB_FIELD_NUMBER: _ClassVar[int] - NEWS_FIELD_NUMBER: _ClassVar[int] - X_FIELD_NUMBER: _ClassVar[int] - RSS_FIELD_NUMBER: _ClassVar[int] - web: WebSource - news: NewsSource - x: XSource - rss: RssSource - def __init__(self, web: _Optional[_Union[WebSource, _Mapping]] = ..., news: _Optional[_Union[NewsSource, _Mapping]] = ..., x: _Optional[_Union[XSource, _Mapping]] = ..., rss: _Optional[_Union[RssSource, _Mapping]] = ...) -> None: ... - -class WebSource(_message.Message): - __slots__ = ("excluded_websites", "allowed_websites", "country", "safe_search") - EXCLUDED_WEBSITES_FIELD_NUMBER: _ClassVar[int] - ALLOWED_WEBSITES_FIELD_NUMBER: _ClassVar[int] - COUNTRY_FIELD_NUMBER: _ClassVar[int] - SAFE_SEARCH_FIELD_NUMBER: _ClassVar[int] - excluded_websites: _containers.RepeatedScalarFieldContainer[str] - allowed_websites: _containers.RepeatedScalarFieldContainer[str] - country: str - safe_search: bool - def __init__(self, excluded_websites: _Optional[_Iterable[str]] = ..., allowed_websites: _Optional[_Iterable[str]] = ..., country: _Optional[str] = ..., safe_search: bool = ...) -> None: ... - -class NewsSource(_message.Message): - __slots__ = ("excluded_websites", "country", "safe_search") - EXCLUDED_WEBSITES_FIELD_NUMBER: _ClassVar[int] - COUNTRY_FIELD_NUMBER: _ClassVar[int] - SAFE_SEARCH_FIELD_NUMBER: _ClassVar[int] - excluded_websites: _containers.RepeatedScalarFieldContainer[str] - country: str - safe_search: bool - def __init__(self, excluded_websites: _Optional[_Iterable[str]] = ..., country: _Optional[str] = ..., safe_search: bool = ...) -> None: ... - -class XSource(_message.Message): - __slots__ = ("included_x_handles", "excluded_x_handles", "post_favorite_count", "post_view_count") - INCLUDED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - EXCLUDED_X_HANDLES_FIELD_NUMBER: _ClassVar[int] - POST_FAVORITE_COUNT_FIELD_NUMBER: _ClassVar[int] - POST_VIEW_COUNT_FIELD_NUMBER: _ClassVar[int] - included_x_handles: _containers.RepeatedScalarFieldContainer[str] - excluded_x_handles: _containers.RepeatedScalarFieldContainer[str] - post_favorite_count: int - post_view_count: int - def __init__(self, included_x_handles: _Optional[_Iterable[str]] = ..., excluded_x_handles: _Optional[_Iterable[str]] = ..., post_favorite_count: _Optional[int] = ..., post_view_count: _Optional[int] = ...) -> None: ... - -class RssSource(_message.Message): - __slots__ = ("links",) - LINKS_FIELD_NUMBER: _ClassVar[int] - links: _containers.RepeatedScalarFieldContainer[str] - def __init__(self, links: _Optional[_Iterable[str]] = ...) -> None: ... + def __init__(self, mode: _Optional[_Union[SearchMode, str]] = ..., sources: _Optional[_Iterable[_Union[_chat_types_pb2.Source, _Mapping]]] = ..., from_date: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., to_date: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., return_citations: _Optional[bool] = ..., max_search_results: _Optional[int] = ...) -> None: ... class RequestSettings(_message.Message): __slots__ = ("max_tokens", "parallel_tool_calls", "previous_response_id", "reasoning_effort", "temperature", "response_format", "tool_choice", "tools", "top_p", "user", "search_parameters", "store_messages", "use_encrypted_content", "include") @@ -654,18 +408,28 @@ class RequestSettings(_message.Message): max_tokens: int parallel_tool_calls: bool previous_response_id: str - reasoning_effort: ReasoningEffort + reasoning_effort: _chat_types_pb2.ReasoningEffort temperature: float - response_format: ResponseFormat - tool_choice: ToolChoice - tools: _containers.RepeatedCompositeFieldContainer[Tool] + response_format: _chat_types_pb2.ResponseFormat + tool_choice: _chat_types_pb2.ToolChoice + tools: _containers.RepeatedCompositeFieldContainer[_chat_types_pb2.Tool] top_p: float user: str search_parameters: SearchParameters store_messages: bool use_encrypted_content: bool - include: _containers.RepeatedScalarFieldContainer[IncludeOption] - def __init__(self, max_tokens: _Optional[int] = ..., parallel_tool_calls: bool = ..., previous_response_id: _Optional[str] = ..., reasoning_effort: _Optional[_Union[ReasoningEffort, str]] = ..., temperature: _Optional[float] = ..., response_format: _Optional[_Union[ResponseFormat, _Mapping]] = ..., tool_choice: _Optional[_Union[ToolChoice, _Mapping]] = ..., tools: _Optional[_Iterable[_Union[Tool, _Mapping]]] = ..., top_p: _Optional[float] = ..., user: _Optional[str] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., store_messages: bool = ..., use_encrypted_content: bool = ..., include: _Optional[_Iterable[_Union[IncludeOption, str]]] = ...) -> None: ... + include: _containers.RepeatedScalarFieldContainer[_chat_types_pb2.IncludeOption] + def __init__(self, max_tokens: _Optional[int] = ..., parallel_tool_calls: _Optional[bool] = ..., previous_response_id: _Optional[str] = ..., reasoning_effort: _Optional[_Union[_chat_types_pb2.ReasoningEffort, str]] = ..., temperature: _Optional[float] = ..., response_format: _Optional[_Union[_chat_types_pb2.ResponseFormat, _Mapping]] = ..., tool_choice: _Optional[_Union[_chat_types_pb2.ToolChoice, _Mapping]] = ..., tools: _Optional[_Iterable[_Union[_chat_types_pb2.Tool, _Mapping]]] = ..., top_p: _Optional[float] = ..., user: _Optional[str] = ..., search_parameters: _Optional[_Union[SearchParameters, _Mapping]] = ..., store_messages: _Optional[bool] = ..., use_encrypted_content: _Optional[bool] = ..., include: _Optional[_Iterable[_Union[_chat_types_pb2.IncludeOption, str]]] = ...) -> None: ... + +class ResponseHistory(_message.Message): + __slots__ = ("messages", "response", "conversation_id") + MESSAGES_FIELD_NUMBER: _ClassVar[int] + RESPONSE_FIELD_NUMBER: _ClassVar[int] + CONVERSATION_ID_FIELD_NUMBER: _ClassVar[int] + messages: _containers.RepeatedCompositeFieldContainer[Message] + response: GetChatCompletionResponse + conversation_id: str + def __init__(self, messages: _Optional[_Iterable[_Union[Message, _Mapping]]] = ..., response: _Optional[_Union[GetChatCompletionResponse, _Mapping]] = ..., conversation_id: _Optional[str] = ...) -> None: ... class GetStoredCompletionRequest(_message.Message): __slots__ = ("response_id",) @@ -686,7 +450,7 @@ class DeleteStoredCompletionResponse(_message.Message): def __init__(self, response_id: _Optional[str] = ...) -> None: ... class DebugOutput(_message.Message): - __slots__ = ("attempts", "request", "prompt", "engine_request", "responses", "chunks", "cache_read_count", "cache_read_input_bytes", "cache_write_count", "cache_write_input_bytes", "lb_address", "sampler_tag") + __slots__ = ("attempts", "request", "prompt", "engine_request", "responses", "chunks", "cache_read_count", "cache_read_input_bytes", "cache_write_count", "cache_write_input_bytes", "lb_address", "sampler_tag", "sampler_checkpoint_mount") ATTEMPTS_FIELD_NUMBER: _ClassVar[int] REQUEST_FIELD_NUMBER: _ClassVar[int] PROMPT_FIELD_NUMBER: _ClassVar[int] @@ -699,6 +463,7 @@ class DebugOutput(_message.Message): CACHE_WRITE_INPUT_BYTES_FIELD_NUMBER: _ClassVar[int] LB_ADDRESS_FIELD_NUMBER: _ClassVar[int] SAMPLER_TAG_FIELD_NUMBER: _ClassVar[int] + SAMPLER_CHECKPOINT_MOUNT_FIELD_NUMBER: _ClassVar[int] attempts: int request: str prompt: str @@ -711,7 +476,8 @@ class DebugOutput(_message.Message): cache_write_input_bytes: int lb_address: str sampler_tag: str - def __init__(self, attempts: _Optional[int] = ..., request: _Optional[str] = ..., prompt: _Optional[str] = ..., engine_request: _Optional[str] = ..., responses: _Optional[_Iterable[str]] = ..., chunks: _Optional[_Iterable[str]] = ..., cache_read_count: _Optional[int] = ..., cache_read_input_bytes: _Optional[int] = ..., cache_write_count: _Optional[int] = ..., cache_write_input_bytes: _Optional[int] = ..., lb_address: _Optional[str] = ..., sampler_tag: _Optional[str] = ...) -> None: ... + sampler_checkpoint_mount: str + def __init__(self, attempts: _Optional[int] = ..., request: _Optional[str] = ..., prompt: _Optional[str] = ..., engine_request: _Optional[str] = ..., responses: _Optional[_Iterable[str]] = ..., chunks: _Optional[_Iterable[str]] = ..., cache_read_count: _Optional[int] = ..., cache_read_input_bytes: _Optional[int] = ..., cache_write_count: _Optional[int] = ..., cache_write_input_bytes: _Optional[int] = ..., lb_address: _Optional[str] = ..., sampler_tag: _Optional[str] = ..., sampler_checkpoint_mount: _Optional[str] = ...) -> None: ... class CompactContextRequest(_message.Message): __slots__ = ("model", "input") diff --git a/src/xai_sdk/proto/v6/image_pb2.py b/src/xai_sdk/proto/v6/image_pb2.py index 3853afc..859486d 100644 --- a/src/xai_sdk/proto/v6/image_pb2.py +++ b/src/xai_sdk/proto/v6/image_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/image.proto -# Protobuf Python Version: 6.30.0 +# source: image.proto +# Protobuf Python Version: 6.33.5 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,46 +11,65 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 6, - 30, - 0, + 6, 0, 0, '', - 'xai/api/v1/image.proto' + 'image.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 +from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 +from . import usage_pb2 as usage__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16xai/api/v1/image.proto\x12\x07xai_api\x1a\x16xai/api/v1/usage.proto\"\xa9\x03\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\x06imagesB\x04\n\x02_nB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionJ\x04\x08\r\x10\x0e\"\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\"|\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\x11respectModerationB\x07\n\x05imageJ\x04\x08\x02\x10\x03\"\\\n\x0fImageUrlContent\x12\x1b\n\timage_url\x18\x01 \x01(\tR\x08imageUrl\x12,\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailR\x06\x64\x65tail*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\x0bimage.proto\x12\x07xai_api\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x0busage.proto\"\x9a\x05\n\x14GenerateImageRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\'\n\x05image\x18\x05 \x01(\x0b\x32\x18.xai_api.ImageUrlContent\x12\r\n\x05model\x18\x02 \x01(\t\x12\x0e\n\x01n\x18\x03 \x01(\x05H\x00\x88\x01\x01\x12\x0c\n\x04user\x18\x04 \x01(\t\x12$\n\x06\x66ormat\x18\x0b \x01(\x0e\x32\x14.xai_api.ImageFormat\x12+\n\x07quality\x18\x0c \x01(\x0e\x32\x15.xai_api.ImageQualityH\x01\x88\x01\x01\x12\x34\n\x0c\x61spect_ratio\x18\x0e \x01(\x0e\x32\x19.xai_api.ImageAspectRatioH\x02\x88\x01\x01\x12\x31\n\nresolution\x18\x0f \x01(\x0e\x32\x18.xai_api.ImageResolutionH\x03\x88\x01\x01\x12\x31\n\nmoderation\x18\x10 \x01(\x0e\x32\x18.xai_api.ModerationLevelH\x04\x88\x01\x01\x12(\n\x06images\x18\x11 \x03(\x0b\x32\x18.xai_api.ImageUrlContent\x12/\n\x0fsafety_settings\x18\x12 \x03(\x0b\x32\x16.xai_api.SafetySetting\x12\x35\n\x0fstorage_options\x18\x13 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x05\x88\x01\x01\x12/\n\x0cservice_tier\x18\x14 \x01(\x0e\x32\x14.xai_api.ServiceTierH\x06\x88\x01\x01\x42\x04\n\x02_nB\n\n\x08_qualityB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\r\n\x0b_moderationB\x12\n\x10_storage_optionsB\x0f\n\r_service_tierJ\x04\x08\r\x10\x0e\"\xa5\x01\n\x0eStorageOptions\x12\x15\n\x08\x66ilename\x18\x01 \x01(\tH\x00\x88\x01\x01\x12\x1a\n\rexpires_after\x18\x02 \x01(\x03H\x01\x88\x01\x01\x12\x32\n\npublic_url\x18\x03 \x01(\x0b\x32\x19.xai_api.PublicUrlOptionsH\x02\x88\x01\x01\x42\x0b\n\t_filenameB\x10\n\x0e_expires_afterB\r\n\x0b_public_url\"@\n\x10PublicUrlOptions\x12\x1a\n\rexpires_after\x18\x01 \x01(\x03H\x00\x88\x01\x01\x42\x10\n\x0e_expires_after\"\xaf\x02\n\nFileOutput\x12\x0f\n\x07\x66ile_id\x18\x01 \x01(\t\x12\x10\n\x08\x66ilename\x18\x02 \x01(\t\x12\x17\n\npublic_url\x18\x04 \x01(\tH\x00\x88\x01\x01\x12>\n\x15public_url_expires_at\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x01\x88\x01\x01\x12\x33\n\nexpires_at\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x02\x88\x01\x01\x12\x1d\n\x10public_url_error\x18\x07 \x01(\tH\x03\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\"\x9a\x01\n\rImageResponse\x12\'\n\x06images\x18\x01 \x03(\x0b\x32\x17.xai_api.GeneratedImage\x12\r\n\x05model\x18\x02 \x01(\t\x12%\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12\x19\n\x0c\x62lock_reason\x18\x04 \x01(\tH\x00\x88\x01\x01\x42\x0f\n\r_block_reason\"\x82\x03\n\x0eGeneratedImage\x12\x10\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00\x12\r\n\x03url\x18\x03 \x01(\tH\x00\x12\x19\n\x11up_sampled_prompt\x18\x02 \x01(\t\x12\x1a\n\x12respect_moderation\x18\x04 \x01(\x08\x12=\n\x0c\x64\x65\x62ug_output\x18\x05 \x01(\x0b\x32\".xai_api.GeneratedImageDebugOutputH\x01\x88\x01\x01\x12?\n\x15moderation_categories\x18\x06 \x03(\x0b\x32 .xai_api.ModerationCategoryScore\x12\x11\n\tmime_type\x18\x07 \x01(\t\x12-\n\x0b\x66ile_output\x18\x08 \x01(\x0b\x32\x13.xai_api.FileOutputH\x02\x88\x01\x01\x12\x1a\n\rstorage_error\x18\t \x01(\tH\x03\x88\x01\x01\x42\x07\n\x05imageB\x0f\n\r_debug_outputB\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"I\n\x17ModerationCategoryScore\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x01\x12\x11\n\tthreshold\x18\x03 \x01(\x01\"U\n\x0e\x43\x61ndidateImage\x12\x10\n\x06\x62\x61se64\x18\x01 \x01(\tH\x00\x12\r\n\x03url\x18\x02 \x01(\tH\x00\x12\x19\n\x11up_sampled_prompt\x18\x03 \x01(\tB\x07\n\x05image\"\x93\x01\n\x19GeneratedImageDebugOutput\x12\x31\n\x10\x63\x61ndidate_images\x18\x01 \x03(\x0b\x32\x17.xai_api.CandidateImage\x12\x16\n\x0egrading_scores\x18\x02 \x03(\x05\x12\x16\n\x0e\x62\x65st_local_idx\x18\x03 \x01(\x05\x12\x13\n\x0braw_grading\x18\x04 \x01(\t\"i\n\x0fImageUrlContent\x12\x13\n\timage_url\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x66ile_id\x18\x03 \x01(\tH\x00\x12$\n\x06\x64\x65tail\x18\x02 \x01(\x0e\x32\x14.xai_api.ImageDetailB\x08\n\x06source\"g\n\rSafetySetting\x12)\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32\x17.xai_api.SafetyCategory\x12+\n\tthreshold\x18\x02 \x01(\x0e\x32\x18.xai_api.SafetyThreshold*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*\x7f\n\x0fModerationLevel\x12\x1c\n\x18MODERATION_LEVEL_INVALID\x10\x00\x12\x18\n\x14MODERATION_LEVEL_LOW\x10\x01\x12\x19\n\x15MODERATION_LEVEL_AUTO\x10\x02\x12\x19\n\x15MODERATION_LEVEL_HIGH\x10\x03*\x7f\n\x0eSafetyCategory\x12\x1f\n\x1bSAFETY_CATEGORY_UNSPECIFIED\x10\x00\x12%\n!SAFETY_CATEGORY_SEXUALLY_EXPLICIT\x10\x01\x12%\n!SAFETY_CATEGORY_DANGEROUS_CONTENT\x10\x02*U\n\x0fSafetyThreshold\x12\x0f\n\x0b\x42LOCK_UNSET\x10\x00\x12\x17\n\x13\x42LOCK_LOW_THRESHOLD\x10\x01\x12\x18\n\x14\x42LOCK_HIGH_THRESHOLD\x10\x02\x32Q\n\x05Image\x12H\n\rGenerateImage\x12\x1d.xai_api.GenerateImageRequest\x1a\x16.xai_api.ImageResponse\"\x00\x42\x1eZ\x1cproxy/gen/go/xai_api;xai_apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.image_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'image_pb2', _globals) 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=842 - _globals['_IMAGEDETAIL']._serialized_end=925 - _globals['_IMAGEFORMAT']._serialized_start=927 - _globals['_IMAGEFORMAT']._serialized_end=1007 - _globals['_IMAGEQUALITY']._serialized_start=1009 - _globals['_IMAGEQUALITY']._serialized_end=1115 - _globals['_IMAGEASPECTRATIO']._serialized_start=1118 - _globals['_IMAGEASPECTRATIO']._serialized_end=1541 - _globals['_IMAGERESOLUTION']._serialized_start=1543 - _globals['_IMAGERESOLUTION']._serialized_end=1634 - _globals['_GENERATEIMAGEREQUEST']._serialized_start=60 - _globals['_GENERATEIMAGEREQUEST']._serialized_end=485 - _globals['_IMAGERESPONSE']._serialized_start=488 - _globals['_IMAGERESPONSE']._serialized_end=620 - _globals['_GENERATEDIMAGE']._serialized_start=622 - _globals['_GENERATEDIMAGE']._serialized_end=746 - _globals['_IMAGEURLCONTENT']._serialized_start=748 - _globals['_IMAGEURLCONTENT']._serialized_end=840 - _globals['_IMAGE']._serialized_start=1636 - _globals['_IMAGE']._serialized_end=1717 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_IMAGEDETAIL']._serialized_start=2349 + _globals['_IMAGEDETAIL']._serialized_end=2432 + _globals['_IMAGEFORMAT']._serialized_start=2434 + _globals['_IMAGEFORMAT']._serialized_end=2514 + _globals['_IMAGEQUALITY']._serialized_start=2516 + _globals['_IMAGEQUALITY']._serialized_end=2622 + _globals['_IMAGEASPECTRATIO']._serialized_start=2625 + _globals['_IMAGEASPECTRATIO']._serialized_end=3048 + _globals['_IMAGERESOLUTION']._serialized_start=3050 + _globals['_IMAGERESOLUTION']._serialized_end=3141 + _globals['_MODERATIONLEVEL']._serialized_start=3143 + _globals['_MODERATIONLEVEL']._serialized_end=3270 + _globals['_SAFETYCATEGORY']._serialized_start=3272 + _globals['_SAFETYCATEGORY']._serialized_end=3399 + _globals['_SAFETYTHRESHOLD']._serialized_start=3401 + _globals['_SAFETYTHRESHOLD']._serialized_end=3486 + _globals['_GENERATEIMAGEREQUEST']._serialized_start=71 + _globals['_GENERATEIMAGEREQUEST']._serialized_end=737 + _globals['_STORAGEOPTIONS']._serialized_start=740 + _globals['_STORAGEOPTIONS']._serialized_end=905 + _globals['_PUBLICURLOPTIONS']._serialized_start=907 + _globals['_PUBLICURLOPTIONS']._serialized_end=971 + _globals['_FILEOUTPUT']._serialized_start=974 + _globals['_FILEOUTPUT']._serialized_end=1277 + _globals['_IMAGERESPONSE']._serialized_start=1280 + _globals['_IMAGERESPONSE']._serialized_end=1434 + _globals['_GENERATEDIMAGE']._serialized_start=1437 + _globals['_GENERATEDIMAGE']._serialized_end=1823 + _globals['_MODERATIONCATEGORYSCORE']._serialized_start=1825 + _globals['_MODERATIONCATEGORYSCORE']._serialized_end=1898 + _globals['_CANDIDATEIMAGE']._serialized_start=1900 + _globals['_CANDIDATEIMAGE']._serialized_end=1985 + _globals['_GENERATEDIMAGEDEBUGOUTPUT']._serialized_start=1988 + _globals['_GENERATEDIMAGEDEBUGOUTPUT']._serialized_end=2135 + _globals['_IMAGEURLCONTENT']._serialized_start=2137 + _globals['_IMAGEURLCONTENT']._serialized_end=2242 + _globals['_SAFETYSETTING']._serialized_start=2244 + _globals['_SAFETYSETTING']._serialized_end=2347 + _globals['_IMAGE']._serialized_start=3488 + _globals['_IMAGE']._serialized_end=3569 # @@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 3a37c55..7c2ddc8 100644 --- a/src/xai_sdk/proto/v6/image_pb2.pyi +++ b/src/xai_sdk/proto/v6/image_pb2.pyi @@ -1,3 +1,6 @@ +import datetime + +from google.protobuf import timestamp_pb2 as _timestamp_pb2 from . import usage_pb2 as _usage_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper @@ -51,6 +54,25 @@ class ImageResolution(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): IMG_RESOLUTION_INVALID: _ClassVar[ImageResolution] IMG_RESOLUTION_1K: _ClassVar[ImageResolution] IMG_RESOLUTION_2K: _ClassVar[ImageResolution] + +class ModerationLevel(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + MODERATION_LEVEL_INVALID: _ClassVar[ModerationLevel] + MODERATION_LEVEL_LOW: _ClassVar[ModerationLevel] + MODERATION_LEVEL_AUTO: _ClassVar[ModerationLevel] + MODERATION_LEVEL_HIGH: _ClassVar[ModerationLevel] + +class SafetyCategory(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SAFETY_CATEGORY_UNSPECIFIED: _ClassVar[SafetyCategory] + SAFETY_CATEGORY_SEXUALLY_EXPLICIT: _ClassVar[SafetyCategory] + SAFETY_CATEGORY_DANGEROUS_CONTENT: _ClassVar[SafetyCategory] + +class SafetyThreshold(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + BLOCK_UNSET: _ClassVar[SafetyThreshold] + BLOCK_LOW_THRESHOLD: _ClassVar[SafetyThreshold] + BLOCK_HIGH_THRESHOLD: _ClassVar[SafetyThreshold] DETAIL_INVALID: ImageDetail DETAIL_AUTO: ImageDetail DETAIL_LOW: ImageDetail @@ -80,53 +102,161 @@ IMG_ASPECT_RATIO_2_1: ImageAspectRatio IMG_RESOLUTION_INVALID: ImageResolution IMG_RESOLUTION_1K: ImageResolution IMG_RESOLUTION_2K: ImageResolution +MODERATION_LEVEL_INVALID: ModerationLevel +MODERATION_LEVEL_LOW: ModerationLevel +MODERATION_LEVEL_AUTO: ModerationLevel +MODERATION_LEVEL_HIGH: ModerationLevel +SAFETY_CATEGORY_UNSPECIFIED: SafetyCategory +SAFETY_CATEGORY_SEXUALLY_EXPLICIT: SafetyCategory +SAFETY_CATEGORY_DANGEROUS_CONTENT: SafetyCategory +BLOCK_UNSET: SafetyThreshold +BLOCK_LOW_THRESHOLD: SafetyThreshold +BLOCK_HIGH_THRESHOLD: SafetyThreshold class GenerateImageRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "n", "user", "format", "aspect_ratio", "resolution", "images") + __slots__ = ("prompt", "image", "model", "n", "user", "format", "quality", "aspect_ratio", "resolution", "moderation", "images", "safety_settings", "storage_options", "service_tier") 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] + MODERATION_FIELD_NUMBER: _ClassVar[int] IMAGES_FIELD_NUMBER: _ClassVar[int] + SAFETY_SETTINGS_FIELD_NUMBER: _ClassVar[int] + STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] prompt: str image: ImageUrlContent model: str n: int user: str format: ImageFormat + quality: ImageQuality aspect_ratio: ImageAspectRatio resolution: ImageResolution + moderation: ModerationLevel images: _containers.RepeatedCompositeFieldContainer[ImageUrlContent] - 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]]] = ...) -> None: ... + safety_settings: _containers.RepeatedCompositeFieldContainer[SafetySetting] + storage_options: StorageOptions + service_tier: _usage_pb2.ServiceTier + 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]] = ..., moderation: _Optional[_Union[ModerationLevel, str]] = ..., images: _Optional[_Iterable[_Union[ImageUrlContent, _Mapping]]] = ..., safety_settings: _Optional[_Iterable[_Union[SafetySetting, _Mapping]]] = ..., storage_options: _Optional[_Union[StorageOptions, _Mapping]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... + +class StorageOptions(_message.Message): + __slots__ = ("filename", "expires_after", "public_url") + FILENAME_FIELD_NUMBER: _ClassVar[int] + EXPIRES_AFTER_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_FIELD_NUMBER: _ClassVar[int] + filename: str + expires_after: int + public_url: PublicUrlOptions + def __init__(self, filename: _Optional[str] = ..., expires_after: _Optional[int] = ..., public_url: _Optional[_Union[PublicUrlOptions, _Mapping]] = ...) -> None: ... + +class PublicUrlOptions(_message.Message): + __slots__ = ("expires_after",) + EXPIRES_AFTER_FIELD_NUMBER: _ClassVar[int] + expires_after: int + def __init__(self, expires_after: _Optional[int] = ...) -> None: ... + +class FileOutput(_message.Message): + __slots__ = ("file_id", "filename", "public_url", "public_url_expires_at", "expires_at", "public_url_error") + FILE_ID_FIELD_NUMBER: _ClassVar[int] + FILENAME_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] + EXPIRES_AT_FIELD_NUMBER: _ClassVar[int] + PUBLIC_URL_ERROR_FIELD_NUMBER: _ClassVar[int] + file_id: str + filename: str + public_url: str + public_url_expires_at: _timestamp_pb2.Timestamp + expires_at: _timestamp_pb2.Timestamp + public_url_error: str + def __init__(self, file_id: _Optional[str] = ..., filename: _Optional[str] = ..., public_url: _Optional[str] = ..., public_url_expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., expires_at: _Optional[_Union[datetime.datetime, _timestamp_pb2.Timestamp, _Mapping]] = ..., public_url_error: _Optional[str] = ...) -> None: ... class ImageResponse(_message.Message): - __slots__ = ("images", "model", "usage") + __slots__ = ("images", "model", "usage", "block_reason") IMAGES_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] USAGE_FIELD_NUMBER: _ClassVar[int] + BLOCK_REASON_FIELD_NUMBER: _ClassVar[int] images: _containers.RepeatedCompositeFieldContainer[GeneratedImage] model: str usage: _usage_pb2.SamplingUsage - def __init__(self, images: _Optional[_Iterable[_Union[GeneratedImage, _Mapping]]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ...) -> None: ... + block_reason: str + def __init__(self, images: _Optional[_Iterable[_Union[GeneratedImage, _Mapping]]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., block_reason: _Optional[str] = ...) -> None: ... class GeneratedImage(_message.Message): - __slots__ = ("base64", "url", "respect_moderation") + __slots__ = ("base64", "url", "up_sampled_prompt", "respect_moderation", "debug_output", "moderation_categories", "mime_type", "file_output", "storage_error") BASE64_FIELD_NUMBER: _ClassVar[int] URL_FIELD_NUMBER: _ClassVar[int] + UP_SAMPLED_PROMPT_FIELD_NUMBER: _ClassVar[int] RESPECT_MODERATION_FIELD_NUMBER: _ClassVar[int] + DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + MODERATION_CATEGORIES_FIELD_NUMBER: _ClassVar[int] + MIME_TYPE_FIELD_NUMBER: _ClassVar[int] + FILE_OUTPUT_FIELD_NUMBER: _ClassVar[int] + STORAGE_ERROR_FIELD_NUMBER: _ClassVar[int] base64: str url: str + up_sampled_prompt: str respect_moderation: bool - def __init__(self, base64: _Optional[str] = ..., url: _Optional[str] = ..., respect_moderation: bool = ...) -> None: ... + debug_output: GeneratedImageDebugOutput + moderation_categories: _containers.RepeatedCompositeFieldContainer[ModerationCategoryScore] + mime_type: str + file_output: FileOutput + storage_error: str + def __init__(self, base64: _Optional[str] = ..., url: _Optional[str] = ..., up_sampled_prompt: _Optional[str] = ..., respect_moderation: _Optional[bool] = ..., debug_output: _Optional[_Union[GeneratedImageDebugOutput, _Mapping]] = ..., moderation_categories: _Optional[_Iterable[_Union[ModerationCategoryScore, _Mapping]]] = ..., mime_type: _Optional[str] = ..., file_output: _Optional[_Union[FileOutput, _Mapping]] = ..., storage_error: _Optional[str] = ...) -> None: ... + +class ModerationCategoryScore(_message.Message): + __slots__ = ("name", "score", "threshold") + NAME_FIELD_NUMBER: _ClassVar[int] + SCORE_FIELD_NUMBER: _ClassVar[int] + THRESHOLD_FIELD_NUMBER: _ClassVar[int] + name: str + score: float + threshold: float + def __init__(self, name: _Optional[str] = ..., score: _Optional[float] = ..., threshold: _Optional[float] = ...) -> None: ... + +class CandidateImage(_message.Message): + __slots__ = ("base64", "url", "up_sampled_prompt") + BASE64_FIELD_NUMBER: _ClassVar[int] + URL_FIELD_NUMBER: _ClassVar[int] + UP_SAMPLED_PROMPT_FIELD_NUMBER: _ClassVar[int] + base64: str + url: str + up_sampled_prompt: str + def __init__(self, base64: _Optional[str] = ..., url: _Optional[str] = ..., up_sampled_prompt: _Optional[str] = ...) -> None: ... + +class GeneratedImageDebugOutput(_message.Message): + __slots__ = ("candidate_images", "grading_scores", "best_local_idx", "raw_grading") + CANDIDATE_IMAGES_FIELD_NUMBER: _ClassVar[int] + GRADING_SCORES_FIELD_NUMBER: _ClassVar[int] + BEST_LOCAL_IDX_FIELD_NUMBER: _ClassVar[int] + RAW_GRADING_FIELD_NUMBER: _ClassVar[int] + candidate_images: _containers.RepeatedCompositeFieldContainer[CandidateImage] + grading_scores: _containers.RepeatedScalarFieldContainer[int] + best_local_idx: int + raw_grading: str + def __init__(self, candidate_images: _Optional[_Iterable[_Union[CandidateImage, _Mapping]]] = ..., grading_scores: _Optional[_Iterable[int]] = ..., best_local_idx: _Optional[int] = ..., raw_grading: _Optional[str] = ...) -> None: ... class ImageUrlContent(_message.Message): - __slots__ = ("image_url", "detail") + __slots__ = ("image_url", "file_id", "detail") IMAGE_URL_FIELD_NUMBER: _ClassVar[int] + FILE_ID_FIELD_NUMBER: _ClassVar[int] DETAIL_FIELD_NUMBER: _ClassVar[int] image_url: str + file_id: str detail: ImageDetail - def __init__(self, image_url: _Optional[str] = ..., detail: _Optional[_Union[ImageDetail, str]] = ...) -> None: ... + def __init__(self, image_url: _Optional[str] = ..., file_id: _Optional[str] = ..., detail: _Optional[_Union[ImageDetail, str]] = ...) -> None: ... + +class SafetySetting(_message.Message): + __slots__ = ("category", "threshold") + CATEGORY_FIELD_NUMBER: _ClassVar[int] + THRESHOLD_FIELD_NUMBER: _ClassVar[int] + category: SafetyCategory + threshold: SafetyThreshold + def __init__(self, category: _Optional[_Union[SafetyCategory, str]] = ..., threshold: _Optional[_Union[SafetyThreshold, str]] = ...) -> None: ... diff --git a/src/xai_sdk/proto/v6/usage_pb2.py b/src/xai_sdk/proto/v6/usage_pb2.py index 2e1d6bb..ff4367e 100644 --- a/src/xai_sdk/proto/v6/usage_pb2.py +++ b/src/xai_sdk/proto/v6/usage_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/usage.proto -# Protobuf Python Version: 6.30.0 +# source: usage.proto +# Protobuf Python Version: 6.33.5 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,11 +11,9 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 6, - 30, - 0, + 6, 0, 0, '', - 'xai/api/v1/usage.proto' + 'usage.proto' ) # @@protoc_insertion_point(imports) @@ -24,18 +22,20 @@ -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*\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\x0busage.proto\x12\x07xai_api\"\x80\x06\n\rSamplingUsage\x12\x19\n\x11\x63ompletion_tokens\x18\x01 \x01(\x05\x12\x18\n\x10reasoning_tokens\x18\x06 \x01(\x05\x12\x15\n\rprompt_tokens\x18\x02 \x01(\x05\x12\x14\n\x0ctotal_tokens\x18\x03 \x01(\x05\x12\x1a\n\x12prompt_text_tokens\x18\x04 \x01(\x05\x12!\n\x19\x63\x61\x63hed_prompt_text_tokens\x18\x07 \x01(\x05\x12\x1b\n\x13prompt_image_tokens\x18\x05 \x01(\x05\x12\x18\n\x10num_sources_used\x18\x08 \x01(\x05\x12\x37\n\x16server_side_tools_used\x18\t \x03(\x0e\x32\x17.xai_api.ServerSideTool\x12\x1d\n\x10\x63ost_in_nano_usd\x18\n \x01(\x03H\x00\x88\x01\x01\x12\x1e\n\x11\x63ost_in_usd_ticks\x18\x0b \x01(\x03H\x01\x88\x01\x01\x12\x1d\n\x10num_input_images\x18\r \x01(\x05H\x02\x88\x01\x01\x12!\n\x14num_generated_images\x18\x0e \x01(\x05H\x03\x88\x01\x01\x12!\n\x14input_video_duration\x18\x0f \x01(\x05H\x04\x88\x01\x01\x12%\n\x18generated_video_duration\x18\x10 \x01(\x05H\x05\x88\x01\x01\x12\'\n\x1agenerated_video_resolution\x18\x11 \x01(\x05H\x06\x88\x01\x01\x12\x1d\n\x15\x63ontext_prompt_tokens\x18\x12 \x01(\x05\x12\x1d\n\x15\x63ontext_output_tokens\x18\x13 \x01(\x05\x42\x13\n\x11_cost_in_nano_usdB\x14\n\x12_cost_in_usd_ticksB\x13\n\x11_num_input_imagesB\x17\n\x15_num_generated_imagesB\x17\n\x15_input_video_durationB\x1b\n\x19_generated_video_durationB\x1d\n\x1b_generated_video_resolution\"K\n\x0e\x45mbeddingUsage\x12\x1b\n\x13num_text_embeddings\x18\x01 \x01(\x05\x12\x1c\n\x14num_image_embeddings\x18\x02 \x01(\x05*`\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!SERVER_SIDE_TOOL_LOCATIONS_SEARCH\x10\t\x12!\n\x1dSERVER_SIDE_TOOL_IMAGE_SEARCH\x10\nB\x1eZ\x1cproxy/gen/go/xai_api;xai_apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.usage_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'usage_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'\n\013com.xai_apiB\nUsageProtoP\001\242\002\003XXX\252\002\006XaiApi\312\002\006XaiApi\342\002\022XaiApi\\GPBMetadata\352\002\006XaiApi' - _globals['_SERVERSIDETOOL']._serialized_start=673 - _globals['_SERVERSIDETOOL']._serialized_end=1030 - _globals['_SAMPLINGUSAGE']._serialized_start=36 - _globals['_SAMPLINGUSAGE']._serialized_end=554 - _globals['_EMBEDDINGUSAGE']._serialized_start=556 - _globals['_EMBEDDINGUSAGE']._serialized_end=670 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_SERVICETIER']._serialized_start=872 + _globals['_SERVICETIER']._serialized_end=968 + _globals['_SERVERSIDETOOL']._serialized_start=971 + _globals['_SERVERSIDETOOL']._serialized_end=1367 + _globals['_SAMPLINGUSAGE']._serialized_start=25 + _globals['_SAMPLINGUSAGE']._serialized_end=793 + _globals['_EMBEDDINGUSAGE']._serialized_start=795 + _globals['_EMBEDDINGUSAGE']._serialized_end=870 # @@protoc_insertion_point(module_scope) diff --git a/src/xai_sdk/proto/v6/usage_pb2.pyi b/src/xai_sdk/proto/v6/usage_pb2.pyi index 529bb1b..6fa9982 100644 --- a/src/xai_sdk/proto/v6/usage_pb2.pyi +++ b/src/xai_sdk/proto/v6/usage_pb2.pyi @@ -7,6 +7,12 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor +class ServiceTier(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + SERVICE_TIER_UNSPECIFIED: _ClassVar[ServiceTier] + SERVICE_TIER_DEFAULT: _ClassVar[ServiceTier] + SERVICE_TIER_PRIORITY: _ClassVar[ServiceTier] + class ServerSideTool(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () SERVER_SIDE_TOOL_INVALID: _ClassVar[ServerSideTool] @@ -18,7 +24,11 @@ class ServerSideTool(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): SERVER_SIDE_TOOL_COLLECTIONS_SEARCH: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_MCP: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: _ClassVar[ServerSideTool] + SERVER_SIDE_TOOL_LOCATIONS_SEARCH: _ClassVar[ServerSideTool] SERVER_SIDE_TOOL_IMAGE_SEARCH: _ClassVar[ServerSideTool] +SERVICE_TIER_UNSPECIFIED: ServiceTier +SERVICE_TIER_DEFAULT: ServiceTier +SERVICE_TIER_PRIORITY: ServiceTier SERVER_SIDE_TOOL_INVALID: ServerSideTool SERVER_SIDE_TOOL_WEB_SEARCH: ServerSideTool SERVER_SIDE_TOOL_X_SEARCH: ServerSideTool @@ -28,10 +38,11 @@ SERVER_SIDE_TOOL_VIEW_X_VIDEO: ServerSideTool SERVER_SIDE_TOOL_COLLECTIONS_SEARCH: ServerSideTool SERVER_SIDE_TOOL_MCP: ServerSideTool SERVER_SIDE_TOOL_ATTACHMENT_SEARCH: ServerSideTool +SERVER_SIDE_TOOL_LOCATIONS_SEARCH: ServerSideTool SERVER_SIDE_TOOL_IMAGE_SEARCH: 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") + __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_nano_usd", "cost_in_usd_ticks", "num_input_images", "num_generated_images", "input_video_duration", "generated_video_duration", "generated_video_resolution", "context_prompt_tokens", "context_output_tokens") COMPLETION_TOKENS_FIELD_NUMBER: _ClassVar[int] REASONING_TOKENS_FIELD_NUMBER: _ClassVar[int] PROMPT_TOKENS_FIELD_NUMBER: _ClassVar[int] @@ -41,7 +52,15 @@ class SamplingUsage(_message.Message): PROMPT_IMAGE_TOKENS_FIELD_NUMBER: _ClassVar[int] NUM_SOURCES_USED_FIELD_NUMBER: _ClassVar[int] SERVER_SIDE_TOOLS_USED_FIELD_NUMBER: _ClassVar[int] + COST_IN_NANO_USD_FIELD_NUMBER: _ClassVar[int] COST_IN_USD_TICKS_FIELD_NUMBER: _ClassVar[int] + NUM_INPUT_IMAGES_FIELD_NUMBER: _ClassVar[int] + NUM_GENERATED_IMAGES_FIELD_NUMBER: _ClassVar[int] + INPUT_VIDEO_DURATION_FIELD_NUMBER: _ClassVar[int] + GENERATED_VIDEO_DURATION_FIELD_NUMBER: _ClassVar[int] + GENERATED_VIDEO_RESOLUTION_FIELD_NUMBER: _ClassVar[int] + CONTEXT_PROMPT_TOKENS_FIELD_NUMBER: _ClassVar[int] + CONTEXT_OUTPUT_TOKENS_FIELD_NUMBER: _ClassVar[int] completion_tokens: int reasoning_tokens: int prompt_tokens: int @@ -51,8 +70,16 @@ class SamplingUsage(_message.Message): prompt_image_tokens: int num_sources_used: int server_side_tools_used: _containers.RepeatedScalarFieldContainer[ServerSideTool] + cost_in_nano_usd: int cost_in_usd_ticks: int - def __init__(self, completion_tokens: _Optional[int] = ..., reasoning_tokens: _Optional[int] = ..., prompt_tokens: _Optional[int] = ..., total_tokens: _Optional[int] = ..., prompt_text_tokens: _Optional[int] = ..., cached_prompt_text_tokens: _Optional[int] = ..., prompt_image_tokens: _Optional[int] = ..., num_sources_used: _Optional[int] = ..., server_side_tools_used: _Optional[_Iterable[_Union[ServerSideTool, str]]] = ..., cost_in_usd_ticks: _Optional[int] = ...) -> None: ... + num_input_images: int + num_generated_images: int + input_video_duration: int + generated_video_duration: int + generated_video_resolution: int + context_prompt_tokens: int + context_output_tokens: int + def __init__(self, completion_tokens: _Optional[int] = ..., reasoning_tokens: _Optional[int] = ..., prompt_tokens: _Optional[int] = ..., total_tokens: _Optional[int] = ..., prompt_text_tokens: _Optional[int] = ..., cached_prompt_text_tokens: _Optional[int] = ..., prompt_image_tokens: _Optional[int] = ..., num_sources_used: _Optional[int] = ..., server_side_tools_used: _Optional[_Iterable[_Union[ServerSideTool, str]]] = ..., cost_in_nano_usd: _Optional[int] = ..., cost_in_usd_ticks: _Optional[int] = ..., num_input_images: _Optional[int] = ..., num_generated_images: _Optional[int] = ..., input_video_duration: _Optional[int] = ..., generated_video_duration: _Optional[int] = ..., generated_video_resolution: _Optional[int] = ..., context_prompt_tokens: _Optional[int] = ..., context_output_tokens: _Optional[int] = ...) -> None: ... class EmbeddingUsage(_message.Message): __slots__ = ("num_text_embeddings", "num_image_embeddings") diff --git a/src/xai_sdk/proto/v6/video_pb2.py b/src/xai_sdk/proto/v6/video_pb2.py index 1c1a355..e215bf5 100644 --- a/src/xai_sdk/proto/v6/video_pb2.py +++ b/src/xai_sdk/proto/v6/video_pb2.py @@ -1,8 +1,8 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: xai/api/v1/video.proto -# Protobuf Python Version: 6.30.0 +# source: video.proto +# Protobuf Python Version: 6.33.5 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool @@ -11,50 +11,54 @@ from google.protobuf.internal import builder as _builder _runtime_version.ValidateProtobufRuntimeVersion( _runtime_version.Domain.PUBLIC, - 6, - 30, - 0, + 6, 0, 0, '', - 'xai/api/v1/video.proto' + 'video.proto' ) # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() -from . import deferred_pb2 as xai_dot_api_dot_v1_dot_deferred__pb2 -from . import image_pb2 as xai_dot_api_dot_v1_dot_image__pb2 -from . import usage_pb2 as xai_dot_api_dot_v1_dot_usage__pb2 +from . import image_pb2 as image__pb2 +from . import deferred_pb2 as deferred__pb2 +from . import usage_pb2 as 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\"#\n\x0fVideoUrlContent\x12\x10\n\x03url\x18\x01 \x01(\tR\x03url\"\xb9\x03\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\x0freferenceImagesB\x0b\n\t_durationB\x0f\n\r_aspect_ratioB\r\n\x0b_resolution\"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\"m\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\"\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\"\xa0\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\x42\x0b\n\t_duration*\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\x0bvideo.proto\x12\x07xai_api\x1a\x0bimage.proto\x1a\x0e\x64\x65\x66\x65rred.proto\x1a\x0busage.proto\"=\n\x0fVideoUrlContent\x12\r\n\x03url\x18\x01 \x01(\tH\x00\x12\x11\n\x07\x66ile_id\x18\x02 \x01(\tH\x00\x42\x08\n\x06source\"!\n\x0bVideoOutput\x12\x12\n\nupload_url\x18\x01 \x01(\t\"\xf8\x05\n\x14GenerateVideoRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\'\n\x05image\x18\x02 \x01(\x0b\x32\x18.xai_api.ImageUrlContent\x12\r\n\x05model\x18\x03 \x01(\t\x12\x15\n\x08\x64uration\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12%\n\x04size\x18\x05 \x01(\x0e\x32\x12.xai_api.VideoSizeH\x01\x88\x01\x01\x12\'\n\x05video\x18\x06 \x01(\x0b\x32\x18.xai_api.VideoUrlContent\x12\x34\n\x0c\x61spect_ratio\x18\x07 \x01(\x0e\x32\x19.xai_api.VideoAspectRatioH\x02\x88\x01\x01\x12\x31\n\nresolution\x18\x08 \x01(\x0e\x32\x18.xai_api.VideoResolutionH\x03\x88\x01\x01\x12\x31\n\nmoderation\x18\t \x01(\x0e\x32\x18.xai_api.ModerationLevelH\x04\x88\x01\x01\x12)\n\x06output\x18\n \x01(\x0b\x32\x14.xai_api.VideoOutputH\x05\x88\x01\x01\x12/\n\x0fsafety_settings\x18\x0b \x03(\x0b\x32\x16.xai_api.SafetySetting\x12(\n\x06images\x18\x0c \x03(\x0b\x32\x18.xai_api.ImageUrlContent\x12\x32\n\x10reference_images\x18\r \x03(\x0b\x32\x18.xai_api.ImageUrlContent\x12\x35\n\x0fstorage_options\x18\x0e \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x06\x88\x01\x01\x12/\n\x0cservice_tier\x18\x0f \x01(\x0e\x32\x14.xai_api.ServiceTierH\x07\x88\x01\x01\x42\x0b\n\t_durationB\x07\n\x05_sizeB\x0f\n\r_aspect_ratioB\r\n\x0b_resolutionB\r\n\x0b_moderationB\t\n\x07_outputB\x12\n\x10_storage_optionsB\x0f\n\r_service_tier\"-\n\x17GetDeferredVideoRequest\x12\x12\n\nrequest_id\x18\x01 \x01(\t\"\x8f\x02\n\rVideoResponse\x12&\n\x05video\x18\x01 \x01(\x0b\x32\x17.xai_api.GeneratedVideo\x12\r\n\x05model\x18\x02 \x01(\t\x12%\n\x05usage\x18\x03 \x01(\x0b\x32\x16.xai_api.SamplingUsage\x12/\n\x0c\x64\x65\x62ug_output\x18\x04 \x01(\x0b\x32\x19.xai_api.VideoDebugOutput\x12\x19\n\x0c\x62lock_reason\x18\x05 \x01(\tH\x00\x88\x01\x01\x12\'\n\x05\x65rror\x18\x06 \x01(\x0b\x32\x13.xai_api.VideoErrorH\x01\x88\x01\x01\x12\x10\n\x08progress\x18\x07 \x01(\x05\x42\x0f\n\r_block_reasonB\x08\n\x06_error\"\xb8\x01\n\x0eGeneratedVideo\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\x10\n\x08\x64uration\x18\x04 \x01(\x05\x12\x1a\n\x12respect_moderation\x18\x05 \x01(\x08\x12-\n\x0b\x66ile_output\x18\x06 \x01(\x0b\x32\x13.xai_api.FileOutputH\x00\x88\x01\x01\x12\x1a\n\rstorage_error\x18\x07 \x01(\tH\x01\x88\x01\x01\x42\x0e\n\x0c_file_outputB\x10\n\x0e_storage_error\"\x7f\n\x18GetDeferredVideoResponse\x12\'\n\x06status\x18\x01 \x01(\x0e\x32\x17.xai_api.DeferredStatus\x12-\n\x08response\x18\x02 \x01(\x0b\x32\x16.xai_api.VideoResponseH\x00\x88\x01\x01\x42\x0b\n\t_response\",\n\x10VideoDebugOutput\x12\x18\n\x10upsampled_prompt\x18\x01 \x01(\t\"+\n\nVideoError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\t\x12\x0f\n\x07message\x18\x02 \x01(\t\"\xc3\x02\n\x12\x45xtendVideoRequest\x12\x0e\n\x06prompt\x18\x01 \x01(\t\x12\'\n\x05video\x18\x02 \x01(\x0b\x32\x18.xai_api.VideoUrlContent\x12\r\n\x05model\x18\x03 \x01(\t\x12\x15\n\x08\x64uration\x18\x04 \x01(\x05H\x00\x88\x01\x01\x12)\n\x06output\x18\x05 \x01(\x0b\x32\x14.xai_api.VideoOutputH\x01\x88\x01\x01\x12\x35\n\x0fstorage_options\x18\x06 \x01(\x0b\x32\x17.xai_api.StorageOptionsH\x02\x88\x01\x01\x12/\n\x0cservice_tier\x18\x07 \x01(\x0e\x32\x14.xai_api.ServiceTierH\x03\x88\x01\x01\x42\x0b\n\t_durationB\t\n\x07_outputB\x12\n\x10_storage_optionsB\x0f\n\r_service_tier*\x8b\x01\n\tVideoSize\x12\x1a\n\x16VIDEO_SIZE_UNSPECIFIED\x10\x00\x12\x16\n\x12VIDEO_SIZE_848X480\x10\x01\x12\x17\n\x13VIDEO_SIZE_1696X960\x10\x02\x12\x17\n\x13VIDEO_SIZE_1280X720\x10\x03\x12\x18\n\x14VIDEO_SIZE_1920X1080\x10\x04*\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*\x85\x01\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\x12\x1a\n\x16VIDEO_RESOLUTION_1080P\x10\x03\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\x42\x1eZ\x1cproxy/gen/go/xai_api;xai_apib\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'xai.api.v1.video_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'video_pb2', _globals) 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=1351 - _globals['_VIDEOASPECTRATIO']._serialized_end=1603 - _globals['_VIDEORESOLUTION']._serialized_start=1605 - _globals['_VIDEORESOLUTION']._serialized_end=1710 - _globals['_VIDEOURLCONTENT']._serialized_start=110 - _globals['_VIDEOURLCONTENT']._serialized_end=145 - _globals['_GENERATEVIDEOREQUEST']._serialized_start=148 - _globals['_GENERATEVIDEOREQUEST']._serialized_end=589 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=591 - _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=647 - _globals['_VIDEORESPONSE']._serialized_start=650 - _globals['_VIDEORESPONSE']._serialized_end=866 - _globals['_GENERATEDVIDEO']._serialized_start=868 - _globals['_GENERATEDVIDEO']._serialized_end=977 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=980 - _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1125 - _globals['_VIDEOERROR']._serialized_start=1127 - _globals['_VIDEOERROR']._serialized_end=1185 - _globals['_EXTENDVIDEOREQUEST']._serialized_start=1188 - _globals['_EXTENDVIDEOREQUEST']._serialized_end=1348 - _globals['_VIDEO']._serialized_start=1713 - _globals['_VIDEO']._serialized_end=1971 + _globals['DESCRIPTOR']._serialized_options = b'Z\034proxy/gen/go/xai_api;xai_api' + _globals['_VIDEOSIZE']._serialized_start=1982 + _globals['_VIDEOSIZE']._serialized_end=2121 + _globals['_VIDEOASPECTRATIO']._serialized_start=2124 + _globals['_VIDEOASPECTRATIO']._serialized_end=2376 + _globals['_VIDEORESOLUTION']._serialized_start=2379 + _globals['_VIDEORESOLUTION']._serialized_end=2512 + _globals['_VIDEOURLCONTENT']._serialized_start=66 + _globals['_VIDEOURLCONTENT']._serialized_end=127 + _globals['_VIDEOOUTPUT']._serialized_start=129 + _globals['_VIDEOOUTPUT']._serialized_end=162 + _globals['_GENERATEVIDEOREQUEST']._serialized_start=165 + _globals['_GENERATEVIDEOREQUEST']._serialized_end=925 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_start=927 + _globals['_GETDEFERREDVIDEOREQUEST']._serialized_end=972 + _globals['_VIDEORESPONSE']._serialized_start=975 + _globals['_VIDEORESPONSE']._serialized_end=1246 + _globals['_GENERATEDVIDEO']._serialized_start=1249 + _globals['_GENERATEDVIDEO']._serialized_end=1433 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_start=1435 + _globals['_GETDEFERREDVIDEORESPONSE']._serialized_end=1562 + _globals['_VIDEODEBUGOUTPUT']._serialized_start=1564 + _globals['_VIDEODEBUGOUTPUT']._serialized_end=1608 + _globals['_VIDEOERROR']._serialized_start=1610 + _globals['_VIDEOERROR']._serialized_end=1653 + _globals['_EXTENDVIDEOREQUEST']._serialized_start=1656 + _globals['_EXTENDVIDEOREQUEST']._serialized_end=1979 + _globals['_VIDEO']._serialized_start=2515 + _globals['_VIDEO']._serialized_end=2773 # @@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 6e2cb73..cc90127 100644 --- a/src/xai_sdk/proto/v6/video_pb2.pyi +++ b/src/xai_sdk/proto/v6/video_pb2.pyi @@ -1,5 +1,5 @@ -from . import deferred_pb2 as _deferred_pb2 from . import image_pb2 as _image_pb2 +from . import deferred_pb2 as _deferred_pb2 from . import usage_pb2 as _usage_pb2 from google.protobuf.internal import containers as _containers from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper @@ -10,6 +10,14 @@ from typing import ClassVar as _ClassVar, Optional as _Optional, Union as _Union DESCRIPTOR: _descriptor.FileDescriptor +class VideoSize(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): + __slots__ = () + VIDEO_SIZE_UNSPECIFIED: _ClassVar[VideoSize] + VIDEO_SIZE_848X480: _ClassVar[VideoSize] + VIDEO_SIZE_1696X960: _ClassVar[VideoSize] + VIDEO_SIZE_1280X720: _ClassVar[VideoSize] + VIDEO_SIZE_1920X1080: _ClassVar[VideoSize] + class VideoAspectRatio(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): __slots__ = () VIDEO_ASPECT_RATIO_UNSPECIFIED: _ClassVar[VideoAspectRatio] @@ -26,6 +34,12 @@ class VideoResolution(int, metaclass=_enum_type_wrapper.EnumTypeWrapper): VIDEO_RESOLUTION_UNSPECIFIED: _ClassVar[VideoResolution] VIDEO_RESOLUTION_480P: _ClassVar[VideoResolution] VIDEO_RESOLUTION_720P: _ClassVar[VideoResolution] + VIDEO_RESOLUTION_1080P: _ClassVar[VideoResolution] +VIDEO_SIZE_UNSPECIFIED: VideoSize +VIDEO_SIZE_848X480: VideoSize +VIDEO_SIZE_1696X960: VideoSize +VIDEO_SIZE_1280X720: VideoSize +VIDEO_SIZE_1920X1080: VideoSize VIDEO_ASPECT_RATIO_UNSPECIFIED: VideoAspectRatio VIDEO_ASPECT_RATIO_1_1: VideoAspectRatio VIDEO_ASPECT_RATIO_16_9: VideoAspectRatio @@ -37,32 +51,55 @@ VIDEO_ASPECT_RATIO_2_3: VideoAspectRatio VIDEO_RESOLUTION_UNSPECIFIED: VideoResolution VIDEO_RESOLUTION_480P: VideoResolution VIDEO_RESOLUTION_720P: VideoResolution +VIDEO_RESOLUTION_1080P: VideoResolution class VideoUrlContent(_message.Message): - __slots__ = ("url",) + __slots__ = ("url", "file_id") URL_FIELD_NUMBER: _ClassVar[int] + FILE_ID_FIELD_NUMBER: _ClassVar[int] url: str - def __init__(self, url: _Optional[str] = ...) -> None: ... + file_id: str + def __init__(self, url: _Optional[str] = ..., file_id: _Optional[str] = ...) -> None: ... + +class VideoOutput(_message.Message): + __slots__ = ("upload_url",) + UPLOAD_URL_FIELD_NUMBER: _ClassVar[int] + upload_url: str + def __init__(self, upload_url: _Optional[str] = ...) -> None: ... class GenerateVideoRequest(_message.Message): - __slots__ = ("prompt", "image", "model", "duration", "video", "aspect_ratio", "resolution", "reference_images") + __slots__ = ("prompt", "image", "model", "duration", "size", "video", "aspect_ratio", "resolution", "moderation", "output", "safety_settings", "images", "reference_images", "storage_options", "service_tier") PROMPT_FIELD_NUMBER: _ClassVar[int] IMAGE_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] DURATION_FIELD_NUMBER: _ClassVar[int] + SIZE_FIELD_NUMBER: _ClassVar[int] VIDEO_FIELD_NUMBER: _ClassVar[int] ASPECT_RATIO_FIELD_NUMBER: _ClassVar[int] RESOLUTION_FIELD_NUMBER: _ClassVar[int] + MODERATION_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FIELD_NUMBER: _ClassVar[int] + SAFETY_SETTINGS_FIELD_NUMBER: _ClassVar[int] + IMAGES_FIELD_NUMBER: _ClassVar[int] REFERENCE_IMAGES_FIELD_NUMBER: _ClassVar[int] + STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] prompt: str image: _image_pb2.ImageUrlContent model: str duration: int + size: VideoSize video: VideoUrlContent aspect_ratio: VideoAspectRatio resolution: VideoResolution + moderation: _image_pb2.ModerationLevel + output: VideoOutput + safety_settings: _containers.RepeatedCompositeFieldContainer[_image_pb2.SafetySetting] + images: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUrlContent] reference_images: _containers.RepeatedCompositeFieldContainer[_image_pb2.ImageUrlContent] - 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]]] = ...) -> None: ... + storage_options: _image_pb2.StorageOptions + service_tier: _usage_pb2.ServiceTier + def __init__(self, prompt: _Optional[str] = ..., image: _Optional[_Union[_image_pb2.ImageUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., size: _Optional[_Union[VideoSize, str]] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., aspect_ratio: _Optional[_Union[VideoAspectRatio, str]] = ..., resolution: _Optional[_Union[VideoResolution, str]] = ..., moderation: _Optional[_Union[_image_pb2.ModerationLevel, str]] = ..., output: _Optional[_Union[VideoOutput, _Mapping]] = ..., safety_settings: _Optional[_Iterable[_Union[_image_pb2.SafetySetting, _Mapping]]] = ..., images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., reference_images: _Optional[_Iterable[_Union[_image_pb2.ImageUrlContent, _Mapping]]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... class GetDeferredVideoRequest(_message.Message): __slots__ = ("request_id",) @@ -71,28 +108,36 @@ class GetDeferredVideoRequest(_message.Message): def __init__(self, request_id: _Optional[str] = ...) -> None: ... class VideoResponse(_message.Message): - __slots__ = ("video", "model", "usage", "error", "progress") + __slots__ = ("video", "model", "usage", "debug_output", "block_reason", "error", "progress") VIDEO_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] USAGE_FIELD_NUMBER: _ClassVar[int] + DEBUG_OUTPUT_FIELD_NUMBER: _ClassVar[int] + BLOCK_REASON_FIELD_NUMBER: _ClassVar[int] ERROR_FIELD_NUMBER: _ClassVar[int] PROGRESS_FIELD_NUMBER: _ClassVar[int] video: GeneratedVideo model: str usage: _usage_pb2.SamplingUsage + debug_output: VideoDebugOutput + block_reason: str error: VideoError progress: int - def __init__(self, video: _Optional[_Union[GeneratedVideo, _Mapping]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., error: _Optional[_Union[VideoError, _Mapping]] = ..., progress: _Optional[int] = ...) -> None: ... + def __init__(self, video: _Optional[_Union[GeneratedVideo, _Mapping]] = ..., model: _Optional[str] = ..., usage: _Optional[_Union[_usage_pb2.SamplingUsage, _Mapping]] = ..., debug_output: _Optional[_Union[VideoDebugOutput, _Mapping]] = ..., block_reason: _Optional[str] = ..., error: _Optional[_Union[VideoError, _Mapping]] = ..., progress: _Optional[int] = ...) -> None: ... class GeneratedVideo(_message.Message): - __slots__ = ("url", "duration", "respect_moderation") + __slots__ = ("url", "duration", "respect_moderation", "file_output", "storage_error") URL_FIELD_NUMBER: _ClassVar[int] DURATION_FIELD_NUMBER: _ClassVar[int] RESPECT_MODERATION_FIELD_NUMBER: _ClassVar[int] + FILE_OUTPUT_FIELD_NUMBER: _ClassVar[int] + STORAGE_ERROR_FIELD_NUMBER: _ClassVar[int] url: str duration: int respect_moderation: bool - def __init__(self, url: _Optional[str] = ..., duration: _Optional[int] = ..., respect_moderation: bool = ...) -> None: ... + file_output: _image_pb2.FileOutput + storage_error: str + def __init__(self, url: _Optional[str] = ..., duration: _Optional[int] = ..., respect_moderation: _Optional[bool] = ..., file_output: _Optional[_Union[_image_pb2.FileOutput, _Mapping]] = ..., storage_error: _Optional[str] = ...) -> None: ... class GetDeferredVideoResponse(_message.Message): __slots__ = ("status", "response") @@ -102,6 +147,12 @@ class GetDeferredVideoResponse(_message.Message): response: VideoResponse def __init__(self, status: _Optional[_Union[_deferred_pb2.DeferredStatus, str]] = ..., response: _Optional[_Union[VideoResponse, _Mapping]] = ...) -> None: ... +class VideoDebugOutput(_message.Message): + __slots__ = ("upsampled_prompt",) + UPSAMPLED_PROMPT_FIELD_NUMBER: _ClassVar[int] + upsampled_prompt: str + def __init__(self, upsampled_prompt: _Optional[str] = ...) -> None: ... + class VideoError(_message.Message): __slots__ = ("code", "message") CODE_FIELD_NUMBER: _ClassVar[int] @@ -111,13 +162,19 @@ class VideoError(_message.Message): def __init__(self, code: _Optional[str] = ..., message: _Optional[str] = ...) -> None: ... class ExtendVideoRequest(_message.Message): - __slots__ = ("prompt", "video", "model", "duration") + __slots__ = ("prompt", "video", "model", "duration", "output", "storage_options", "service_tier") PROMPT_FIELD_NUMBER: _ClassVar[int] VIDEO_FIELD_NUMBER: _ClassVar[int] MODEL_FIELD_NUMBER: _ClassVar[int] DURATION_FIELD_NUMBER: _ClassVar[int] + OUTPUT_FIELD_NUMBER: _ClassVar[int] + STORAGE_OPTIONS_FIELD_NUMBER: _ClassVar[int] + SERVICE_TIER_FIELD_NUMBER: _ClassVar[int] prompt: str video: VideoUrlContent model: str duration: int - def __init__(self, prompt: _Optional[str] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ...) -> None: ... + output: VideoOutput + storage_options: _image_pb2.StorageOptions + service_tier: _usage_pb2.ServiceTier + def __init__(self, prompt: _Optional[str] = ..., video: _Optional[_Union[VideoUrlContent, _Mapping]] = ..., model: _Optional[str] = ..., duration: _Optional[int] = ..., output: _Optional[_Union[VideoOutput, _Mapping]] = ..., storage_options: _Optional[_Union[_image_pb2.StorageOptions, _Mapping]] = ..., service_tier: _Optional[_Union[_usage_pb2.ServiceTier, str]] = ...) -> None: ... diff --git a/src/xai_sdk/sync/image.py b/src/xai_sdk/sync/image.py index b6b402f..421527c 100644 --- a/src/xai_sdk/sync/image.py +++ b/src/xai_sdk/sync/image.py @@ -17,6 +17,7 @@ from ..proto import batch_pb2 from ..telemetry import get_tracer from ..types import ImageGenerationModel +from ..types.chat import ServiceTier tracer = get_tracer(__name__) @@ -36,6 +37,7 @@ def prepare( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + service_tier: Optional[ServiceTier] = None, ) -> batch_pb2.BatchRequest: """Prepares an image generation request for batch processing. @@ -96,6 +98,7 @@ def prepare( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + service_tier=service_tier, ) return batch_pb2.BatchRequest( image_request=request, @@ -113,6 +116,7 @@ def sample( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + service_tier: Optional[ServiceTier] = None, ) -> "ImageResponse": """Samples a single image based on the provided prompt. @@ -163,6 +167,7 @@ def sample( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + service_tier=service_tier, ) with tracer.start_as_current_span( name=f"image.sample {model}", @@ -186,6 +191,7 @@ def sample_batch( image_format: Optional[ImageFormat] = None, aspect_ratio: Optional[ImageAspectRatio] = None, resolution: Optional[ImageResolution] = None, + service_tier: Optional[ServiceTier] = None, ) -> Sequence["ImageResponse"]: """Samples a batch of images based on the provided prompt. @@ -238,6 +244,7 @@ def sample_batch( image_format=image_format, aspect_ratio=aspect_ratio, resolution=resolution, + service_tier=service_tier, ) with tracer.start_as_current_span( name=f"image.sample_batch {model}", diff --git a/src/xai_sdk/sync/video.py b/src/xai_sdk/sync/video.py index 9e3cbc6..f40d3c0 100644 --- a/src/xai_sdk/sync/video.py +++ b/src/xai_sdk/sync/video.py @@ -9,6 +9,7 @@ from ..proto import batch_pb2, deferred_pb2, video_pb2 from ..telemetry import get_tracer from ..types import VideoGenerationModel +from ..types.chat import ServiceTier from ..video import ( DEFAULT_VIDEO_POLL_INTERVAL, DEFAULT_VIDEO_TIMEOUT, @@ -43,6 +44,7 @@ def prepare( aspect_ratio: Optional[VideoAspectRatio] = None, resolution: Optional[VideoResolution] = None, reference_image_urls: Optional[Sequence[str]] = None, + service_tier: Optional[ServiceTier] = None, ) -> batch_pb2.BatchRequest: """Prepares a video generation request for batch processing. @@ -103,6 +105,7 @@ def prepare( aspect_ratio=aspect_ratio, resolution=resolution, reference_image_urls=reference_image_urls, + service_tier=service_tier, ) return batch_pb2.BatchRequest( @@ -118,6 +121,7 @@ def prepare_extension( *, batch_request_id: Optional[str] = None, duration: Optional[int] = None, + service_tier: Optional[ServiceTier] = None, ) -> batch_pb2.BatchRequest: """Prepares a video extension request for batch processing. @@ -141,6 +145,7 @@ def prepare_extension( model, video_url, duration=duration, + service_tier=service_tier, ) return batch_pb2.BatchRequest( @@ -159,6 +164,7 @@ def start( aspect_ratio: Optional[VideoAspectRatio] = None, resolution: Optional[VideoResolution] = None, reference_image_urls: Optional[Sequence[str]] = None, + service_tier: Optional[ServiceTier] = None, ) -> deferred_pb2.StartDeferredResponse: """Starts a video generation request and returns a request_id for polling.""" request = _make_generate_request( @@ -170,6 +176,7 @@ def start( aspect_ratio=aspect_ratio, resolution=resolution, reference_image_urls=reference_image_urls, + service_tier=service_tier, ) with tracer.start_as_current_span( @@ -195,6 +202,7 @@ def generate( aspect_ratio: Optional[VideoAspectRatio] = None, resolution: Optional[VideoResolution] = None, reference_image_urls: Optional[Sequence[str]] = None, + service_tier: Optional[ServiceTier] = None, timeout: Optional[datetime.timedelta] = None, interval: Optional[datetime.timedelta] = None, ) -> VideoResponse: @@ -295,6 +303,7 @@ def generate( aspect_ratio=aspect_ratio, resolution=resolution, reference_image_urls=reference_image_urls, + service_tier=service_tier, ) with tracer.start_as_current_span( @@ -339,6 +348,7 @@ def extend_start( video_url: str, *, duration: Optional[int] = None, + service_tier: Optional[ServiceTier] = None, ) -> deferred_pb2.StartDeferredResponse: """Starts a video extension request and returns a request_id for polling. @@ -358,6 +368,7 @@ def extend_start( model, video_url, duration=duration, + service_tier=service_tier, ) with tracer.start_as_current_span( @@ -374,6 +385,7 @@ def extend( video_url: str, *, duration: Optional[int] = None, + service_tier: Optional[ServiceTier] = None, timeout: Optional[datetime.timedelta] = None, interval: Optional[datetime.timedelta] = None, ) -> VideoResponse: @@ -441,6 +453,7 @@ def extend( model, video_url, duration=duration, + service_tier=service_tier, ) with tracer.start_as_current_span( diff --git a/src/xai_sdk/types/__init__.py b/src/xai_sdk/types/__init__.py index edd79f0..8e8c8ef 100644 --- a/src/xai_sdk/types/__init__.py +++ b/src/xai_sdk/types/__init__.py @@ -7,6 +7,7 @@ IncludeOptionMap, ReasoningEffort, ResponseFormat, + ServiceTier, ToolMode, ) from .image import ImageAspectRatio, ImageFormat, ImageResolution @@ -28,6 +29,7 @@ "IncludeOptionMap", "ReasoningEffort", "ResponseFormat", + "ServiceTier", "ToolMode", "VideoAspectRatio", "VideoGenerationModel", diff --git a/src/xai_sdk/types/chat.py b/src/xai_sdk/types/chat.py index 101d62f..9f56608 100644 --- a/src/xai_sdk/types/chat.py +++ b/src/xai_sdk/types/chat.py @@ -11,10 +11,12 @@ "IncludeOptionMap", "ReasoningEffort", "ResponseFormat", + "ServiceTier", "ToolMode", ] AgentCount: TypeAlias = Literal[4, 16] +ServiceTier: TypeAlias = Literal["auto", "default", "priority"] ReasoningEffort: TypeAlias = Literal["none", "low", "medium", "high"] ImageDetail: TypeAlias = Literal["auto", "low", "high"] Content: TypeAlias = Union[str, chat_pb2.Content] diff --git a/src/xai_sdk/video.py b/src/xai_sdk/video.py index 9006d7f..cf4eb48 100644 --- a/src/xai_sdk/video.py +++ b/src/xai_sdk/video.py @@ -8,6 +8,7 @@ from .proto import image_pb2, usage_pb2, video_pb2, video_pb2_grpc from .telemetry import should_disable_sensitive_attributes from .types import VideoGenerationModel +from .types.chat import ServiceTier from .types.video import VideoAspectRatio, VideoAspectRatioMap, VideoResolution, VideoResolutionMap DEFAULT_VIDEO_POLL_INTERVAL = datetime.timedelta(seconds=1) @@ -98,6 +99,7 @@ def _make_generate_request( aspect_ratio: Optional[VideoAspectRatio], resolution: Optional[VideoResolution], reference_image_urls: Optional[Sequence[str]], + service_tier: Optional[Union[ServiceTier, "usage_pb2.ServiceTier"]] = None, ) -> video_pb2.GenerateVideoRequest: request = video_pb2.GenerateVideoRequest(prompt=prompt, model=model) @@ -126,6 +128,10 @@ def _make_generate_request( for url in reference_image_urls ] ) + if service_tier is not None: + from .chat import _service_tier_to_proto + + request.service_tier = _service_tier_to_proto(service_tier) if isinstance(service_tier, str) else service_tier return request @@ -193,6 +199,7 @@ def _make_extend_request( video_url: str, *, duration: Optional[int], + service_tier: Optional[Union[ServiceTier, "usage_pb2.ServiceTier"]] = None, ) -> video_pb2.ExtendVideoRequest: request = video_pb2.ExtendVideoRequest( prompt=prompt, @@ -202,6 +209,10 @@ def _make_extend_request( if duration is not None: request.duration = duration + if service_tier is not None: + from .chat import _service_tier_to_proto + + request.service_tier = _service_tier_to_proto(service_tier) if isinstance(service_tier, str) else service_tier return request