Skip to content

Commit 3263514

Browse files
yyyu-googlecopybara-github
authored andcommitted
feat: add complete stats to BatchJob
PiperOrigin-RevId: 828312096
1 parent cecebcf commit 3263514

File tree

5 files changed

+51
-2
lines changed

5 files changed

+51
-2
lines changed

api-report/genai-node.api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export class Batches extends BaseModule {
172172

173173
// @public
174174
export interface BatchJob {
175+
completionStats?: CompletionStats;
175176
createTime?: string;
176177
dest?: BatchJobDestination;
177178
displayName?: string;
@@ -363,6 +364,14 @@ export interface CodeExecutionResult {
363364
output?: string;
364365
}
365366

367+
// @public
368+
export interface CompletionStats {
369+
failedCount?: string;
370+
incompleteCount?: string;
371+
successfulCount?: string;
372+
successfulForecastPointCount?: string;
373+
}
374+
366375
// @public
367376
export interface ComputerUse {
368377
environment?: Environment;

api-report/genai-web.api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export class Batches extends BaseModule {
172172

173173
// @public
174174
export interface BatchJob {
175+
completionStats?: CompletionStats;
175176
createTime?: string;
176177
dest?: BatchJobDestination;
177178
displayName?: string;
@@ -363,6 +364,14 @@ export interface CodeExecutionResult {
363364
output?: string;
364365
}
365366

367+
// @public
368+
export interface CompletionStats {
369+
failedCount?: string;
370+
incompleteCount?: string;
371+
successfulCount?: string;
372+
successfulForecastPointCount?: string;
373+
}
374+
366375
// @public
367376
export interface ComputerUse {
368377
environment?: Environment;

api-report/genai.api.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ export class Batches extends BaseModule {
172172

173173
// @public
174174
export interface BatchJob {
175+
completionStats?: CompletionStats;
175176
createTime?: string;
176177
dest?: BatchJobDestination;
177178
displayName?: string;
@@ -363,6 +364,14 @@ export interface CodeExecutionResult {
363364
output?: string;
364365
}
365366

367+
// @public
368+
export interface CompletionStats {
369+
failedCount?: string;
370+
incompleteCount?: string;
371+
successfulCount?: string;
372+
successfulForecastPointCount?: string;
373+
}
374+
366375
// @public
367376
export interface ComputerUse {
368377
environment?: Environment;

src/converters/_batches_converters.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,13 @@ export function batchJobFromVertex(
263263
);
264264
}
265265

266+
const fromCompletionStats = common.getValueByPath(fromObject, [
267+
'completionStats',
268+
]);
269+
if (fromCompletionStats != null) {
270+
common.setValueByPath(toObject, ['completionStats'], fromCompletionStats);
271+
}
272+
266273
return toObject;
267274
}
268275

src/types.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4822,6 +4822,18 @@ export declare interface CreateBatchJobParameters {
48224822
config?: CreateBatchJobConfig;
48234823
}
48244824

4825+
/** Success and error statistics of processing multiple entities (for example, DataItems or structured data rows) in batch. This data type is not supported in Gemini API. */
4826+
export declare interface CompletionStats {
4827+
/** Output only. The number of entities for which any error was encountered. */
4828+
failedCount?: string;
4829+
/** Output only. In cases when enough errors are encountered a job, pipeline, or operation may be failed as a whole. Below is the number of entities for which the processing had not been finished (either in successful or failed state). Set to -1 if the number is unknown (for example, the operation failed before the total entity number could be collected). */
4830+
incompleteCount?: string;
4831+
/** Output only. The number of entities that had been processed successfully. */
4832+
successfulCount?: string;
4833+
/** Output only. The number of the successful forecast points that are generated by the forecasting model. This is ONLY used by the forecasting batch prediction. */
4834+
successfulForecastPointCount?: string;
4835+
}
4836+
48254837
/** Config for batches.create return value. */
48264838
export declare interface BatchJob {
48274839
/** The resource name of the BatchJob. Output only.".
@@ -4840,7 +4852,7 @@ export declare interface BatchJob {
48404852
createTime?: string;
48414853
/** Output only. Time when the Job for the first time entered the `JOB_STATE_RUNNING` state. */
48424854
startTime?: string;
4843-
/** The time when the BatchJob was completed.
4855+
/** The time when the BatchJob was completed. This field is for Vertex AI only.
48444856
*/
48454857
endTime?: string;
48464858
/** The time when the BatchJob was last updated.
@@ -4849,12 +4861,15 @@ export declare interface BatchJob {
48494861
/** The name of the model that produces the predictions via the BatchJob.
48504862
*/
48514863
model?: string;
4852-
/** Configuration for the input data.
4864+
/** Configuration for the input data. This field is for Vertex AI only.
48534865
*/
48544866
src?: BatchJobSource;
48554867
/** Configuration for the output data.
48564868
*/
48574869
dest?: BatchJobDestination;
4870+
/** Statistics on completed and failed prediction instances. This field is for Vertex AI only.
4871+
*/
4872+
completionStats?: CompletionStats;
48584873
}
48594874

48604875
/** Parameters for the embed_content method. */

0 commit comments

Comments
 (0)