|
1 | 1 | syntax = "proto3"; |
2 | | -option csharp_namespace = "xAI.Protocol"; |
3 | 2 |
|
4 | 3 | package xai_api; |
5 | 4 |
|
6 | 5 | import "google/protobuf/empty.proto"; |
7 | 6 | import "google/protobuf/timestamp.proto"; |
8 | 7 | import "google/rpc/status.proto"; |
9 | | -import "chat.proto"; |
| 8 | +import "xai/api/v1/chat.proto"; |
| 9 | +import "xai/api/v1/image.proto"; |
| 10 | +import "xai/api/v1/video.proto"; |
10 | 11 |
|
11 | 12 | // An API service for processing batch requests asynchronously at lower priority than chat service. |
12 | 13 | service BatchMgmt { |
@@ -66,6 +67,10 @@ message Batch { |
66 | 67 |
|
67 | 68 | // Cost breakdown for processed requests. |
68 | 69 | BatchCostBreakdown cost_breakdown = 9; |
| 70 | + |
| 71 | + // File ID of the uploaded JSONL input file (from Files API). Only set |
| 72 | + // when the batch was created via file upload. |
| 73 | + optional string input_file_id = 10; |
69 | 74 | } |
70 | 75 |
|
71 | 76 | // Holds aggregate information about the current state of a batch process. |
@@ -121,15 +126,25 @@ message BatchRequest { |
121 | 126 | oneof request { |
122 | 127 | // A completion request to send for processing in the batch. |
123 | 128 | GetCompletionsRequest completion_request = 2; |
| 129 | + // An image generation or editing request to send for processing in the batch. |
| 130 | + GenerateImageRequest image_request = 3; |
| 131 | + // A video generation request to send for processing in the batch. |
| 132 | + GenerateVideoRequest video_request = 4; |
| 133 | + // A video extension request to send for processing in the batch. |
| 134 | + ExtendVideoRequest video_extension_request = 5; |
124 | 135 | } |
125 | 136 | } |
126 | 137 |
|
127 | | -// A container for the completion response that is returned in a `BatchResult`. |
| 138 | +// A container for the response that is returned in a `BatchResult`. |
128 | 139 | message BatchResultData { |
129 | 140 | // The response from the batch request. |
130 | 141 | oneof response { |
131 | 142 | // A completion response that has finished processing in the batch. |
132 | 143 | GetChatCompletionResponse completion_response = 2; |
| 144 | + // An image generation response that has finished processing in the batch. |
| 145 | + ImageResponse image_response = 3; |
| 146 | + // A video generation response that has finished processing in the batch. |
| 147 | + VideoResponse video_response = 4; |
133 | 148 | } |
134 | 149 | } |
135 | 150 |
|
@@ -183,6 +198,10 @@ message BatchRequestMetadata { |
183 | 198 | message CreateBatchRequest { |
184 | 199 | // The name of the batch to be created. |
185 | 200 | string name = 1; |
| 201 | + |
| 202 | + // Optional file ID of a JSONL input file (uploaded via the Files API). |
| 203 | + // When provided, the batch will be populated from the file's contents. |
| 204 | + string input_file_id = 2; |
186 | 205 | } |
187 | 206 |
|
188 | 207 | // ------------------------------------------------------------------------------------------------ |
@@ -249,6 +268,9 @@ message ListBatchRequestMetadataRequest { |
249 | 268 |
|
250 | 269 | // Optional pagination token to retrieve a specific page. Provided by `pagination_token` in `ListBatchRequestMetadataResponse`. |
251 | 270 | optional string pagination_token = 3; |
| 271 | + |
| 272 | + // Optional filter by request state. If empty, all states are returned. |
| 273 | + repeated BatchRequestMetadata.State status = 4; |
252 | 274 | } |
253 | 275 |
|
254 | 276 | // Response with the metadata of batch requests within a batch. |
|
0 commit comments