feat: add prepare_extension() for batch video extension#141
Merged
Conversation
46a7274 to
274f3dd
Compare
bijoybangladeshmsd-cyber
approved these changes
May 8, 2026
a409cb3 to
693744c
Compare
double-di
added a commit
to xai-org/xai-proto
that referenced
this pull request
May 14, 2026
Add image, video, and video extension request/response types to the batch proto oneofs. **BatchRequest oneof:** - `image_request` (field 3) — `GenerateImageRequest` - `video_request` (field 4) — `GenerateVideoRequest` - `video_extension_request` (field 5) — `ExtendVideoRequest` (already defined in video.proto) **BatchResultData oneof:** - `image_response` (field 3) — `ImageResponse` - `video_response` (field 4) — `VideoResponse` Required by [xai-sdk-python#141](xai-org/xai-sdk-python#141) for batch video extension support.
This was referenced May 15, 2026
Omar-V2
approved these changes
May 16, 2026
double-di
added a commit
to xai-org/xai-proto
that referenced
this pull request
May 16, 2026
## Summary Adds three fields to `batch.proto` that ship in the published Python SDK but were never declared here. | Field | Where | Status before this PR | |---|---|---| | `Batch.input_file_id` (optional string, field 10) | `Batch` message | absent in xai-proto, present in SDK | | `CreateBatchRequest.input_file_id` (string, field 2) | `CreateBatchRequest` | same | | `ListBatchRequestMetadataRequest.status` (repeated `BatchRequestMetadata.State`, field 4) | filter param on metadata listing | same | ## Import order Keeps xai-proto's existing convention — alphabetical by full import path (`google.protobuf.*` → `google.rpc.*` → `xai/api/v1/*`). Matches every other file in `proto/xai/api/v1/` and keeps the `google.protobuf.*` imports adjacent in the generated Python. ## Wire compatibility - Existing fields and field numbers unchanged → all current clients keep working byte-for-byte - New fields are additive (proto3 default behavior: unknown fields are tolerated on decode, omitted fields encode as zero bytes) - gRPC method paths unchanged ## Effect on [xai-org/xai-sdk-python#141](xai-org/xai-sdk-python#141) After this lands, that PR can regen cleanly from xai-proto and the diff will collapse to just the actual feature additions (`video_extension_request` field + `prepare_extension()` method + tests + CHANGELOG).
- Add prepare_extension() to async and sync video clients - Update batch proto definitions - Add changelog entry
d96a11f to
7acf490
Compare
bijoybangladeshmsd-cyber
approved these changes
May 17, 2026
bijoybangladeshmsd-cyber
approved these changes
May 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
prepare_extension()method to both async and sync video clients for preparing video extension requests for the Batch API.This enables users to prepare
/video/extendrequests for batch processing via:client.video.prepare_extension()(async)client.video.prepare_extension()(sync)Changes
src/xai_sdk/aio/video.py: Addedprepare_extension()to async video clientsrc/xai_sdk/sync/video.py: Addedprepare_extension()to sync video clientsrc/xai_sdk/proto/v{5,6}/batch_pb2*: Regenerated batch proto withvideo_extension_requestoneof fieldCHANGELOG.md: Added entry under[Unreleased]