Skip to content

feat: add prepare_extension() for batch video extension#141

Open
double-di wants to merge 5 commits intomainfrom
lbi/batch-api-video-extension
Open

feat: add prepare_extension() for batch video extension#141
double-di wants to merge 5 commits intomainfrom
lbi/batch-api-video-extension

Conversation

@double-di
Copy link
Copy Markdown
Contributor

@double-di double-di commented May 8, 2026

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/extend requests for batch processing via:

  • client.video.prepare_extension() (async)
  • client.video.prepare_extension() (sync)

Changes

  • src/xai_sdk/aio/video.py: Added prepare_extension() to async video client
  • src/xai_sdk/sync/video.py: Added prepare_extension() to sync video client
  • src/xai_sdk/proto/v{5,6}/batch_pb2*: Regenerated batch proto with video_extension_request oneof field
  • CHANGELOG.md: Added entry under [Unreleased]

@double-di double-di requested a review from a team as a code owner May 8, 2026 08:12
@double-di double-di force-pushed the lbi/batch-api-video-extension branch from 71f8766 to bd254a7 Compare May 8, 2026 08:15
double-di added 2 commits May 8, 2026 23:28
Add prepare_extension() method to both async and sync video clients
for preparing video extension requests for the Batch API.

Also updates README and CHANGELOG with batch video extension docs.
…ADME

- Regenerate batch proto files to include video_extension_request
  field (oneof field 5) in BatchRequest message
- Add status filter to ListBatchRequestMetadataRequest
- Revert README batch video extension section (no other batch
  request types are documented in the README)
@double-di double-di force-pushed the lbi/batch-api-video-extension branch from 46a7274 to 274f3dd Compare May 8, 2026 14:28
double-di added 3 commits May 8, 2026 23:37
The regenerated batch_pb2.py used flat proto paths (batch.proto,
chat.proto) from the proxy proto structure, but the SDK expects
namespaced paths (xai/api/v1/batch.proto). This caused AttributeError
on import because batch_pb2 tried to access chat_types_pb2 and
chat_bidi_v2_pb2 from chat_pb2, which don't exist in the SDK.

Fixed by patching the serialized descriptor to use xai/api/v1/ paths
and removing the spurious chat_types/chat_bidi_v2 imports from both
batch_pb2.py and batch_pb2.pyi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants