Skip to content

Commit e337ba9

Browse files
cleop-googlecopybara-github
authored andcommitted
feat: Add output_info to BatchJob
PiperOrigin-RevId: 904943094
1 parent a09716e commit e337ba9

3 files changed

Lines changed: 176 additions & 0 deletions

File tree

src/main/java/com/google/genai/Batches.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,13 @@ ObjectNode batchJobFromVertex(JsonNode fromObject, ObjectNode parentObject) {
399399
Common.getValueByPath(fromObject, new String[] {"completionStats"}));
400400
}
401401

402+
if (Common.getValueByPath(fromObject, new String[] {"outputInfo"}) != null) {
403+
Common.setValueByPath(
404+
toObject,
405+
new String[] {"outputInfo"},
406+
Common.getValueByPath(fromObject, new String[] {"outputInfo"}));
407+
}
408+
402409
return toObject;
403410
}
404411

src/main/java/com/google/genai/types/BatchJob.java

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ public abstract class BatchJob extends JsonSerializable {
8787
@JsonProperty("completionStats")
8888
public abstract Optional<CompletionStats> completionStats();
8989

90+
/** Information further describing the output of this job. Output only. */
91+
@JsonProperty("outputInfo")
92+
public abstract Optional<BatchJobOutputInfo> outputInfo();
93+
9094
/** Instantiates a builder for BatchJob. */
9195
@ExcludeFromGeneratedCoverageReport
9296
public static Builder builder() {
@@ -389,6 +393,34 @@ public Builder clearCompletionStats() {
389393
return completionStats(Optional.empty());
390394
}
391395

396+
/**
397+
* Setter for outputInfo.
398+
*
399+
* <p>outputInfo: Information further describing the output of this job. Output only.
400+
*/
401+
@JsonProperty("outputInfo")
402+
public abstract Builder outputInfo(BatchJobOutputInfo outputInfo);
403+
404+
/**
405+
* Setter for outputInfo builder.
406+
*
407+
* <p>outputInfo: Information further describing the output of this job. Output only.
408+
*/
409+
@CanIgnoreReturnValue
410+
public Builder outputInfo(BatchJobOutputInfo.Builder outputInfoBuilder) {
411+
return outputInfo(outputInfoBuilder.build());
412+
}
413+
414+
@ExcludeFromGeneratedCoverageReport
415+
abstract Builder outputInfo(Optional<BatchJobOutputInfo> outputInfo);
416+
417+
/** Clears the value of outputInfo field. */
418+
@ExcludeFromGeneratedCoverageReport
419+
@CanIgnoreReturnValue
420+
public Builder clearOutputInfo() {
421+
return outputInfo(Optional.empty());
422+
}
423+
392424
public abstract BatchJob build();
393425
}
394426

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Auto-generated code. Do not edit.
18+
19+
package com.google.genai.types;
20+
21+
import com.fasterxml.jackson.annotation.JsonCreator;
22+
import com.fasterxml.jackson.annotation.JsonProperty;
23+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
24+
import com.google.auto.value.AutoValue;
25+
import com.google.errorprone.annotations.CanIgnoreReturnValue;
26+
import com.google.genai.JsonSerializable;
27+
import java.util.Optional;
28+
29+
/** Represents the `output_info` field in batch jobs. */
30+
@AutoValue
31+
@JsonDeserialize(builder = BatchJobOutputInfo.Builder.class)
32+
public abstract class BatchJobOutputInfo extends JsonSerializable {
33+
/**
34+
* This field is experimental and may change in future versions. The Vertex AI dataset name
35+
* containing the output data.
36+
*/
37+
@JsonProperty("vertexMultimodalDatasetName")
38+
public abstract Optional<String> vertexMultimodalDatasetName();
39+
40+
/**
41+
* The full path of the Cloud Storage directory created, into which the prediction output is
42+
* written.
43+
*/
44+
@JsonProperty("gcsOutputDirectory")
45+
public abstract Optional<String> gcsOutputDirectory();
46+
47+
/**
48+
* The name of the BigQuery table created, in `predictions_<timestamp>` format, into which the
49+
* prediction output is written.
50+
*/
51+
@JsonProperty("bigqueryOutputTable")
52+
public abstract Optional<String> bigqueryOutputTable();
53+
54+
/** Instantiates a builder for BatchJobOutputInfo. */
55+
@ExcludeFromGeneratedCoverageReport
56+
public static Builder builder() {
57+
return new AutoValue_BatchJobOutputInfo.Builder();
58+
}
59+
60+
/** Creates a builder with the same values as this instance. */
61+
public abstract Builder toBuilder();
62+
63+
/** Builder for BatchJobOutputInfo. */
64+
@AutoValue.Builder
65+
public abstract static class Builder {
66+
/** For internal usage. Please use `BatchJobOutputInfo.builder()` for instantiation. */
67+
@JsonCreator
68+
private static Builder create() {
69+
return new AutoValue_BatchJobOutputInfo.Builder();
70+
}
71+
72+
/**
73+
* Setter for vertexMultimodalDatasetName.
74+
*
75+
* <p>vertexMultimodalDatasetName: This field is experimental and may change in future versions.
76+
* The Vertex AI dataset name containing the output data.
77+
*/
78+
@JsonProperty("vertexMultimodalDatasetName")
79+
public abstract Builder vertexMultimodalDatasetName(String vertexMultimodalDatasetName);
80+
81+
@ExcludeFromGeneratedCoverageReport
82+
abstract Builder vertexMultimodalDatasetName(Optional<String> vertexMultimodalDatasetName);
83+
84+
/** Clears the value of vertexMultimodalDatasetName field. */
85+
@ExcludeFromGeneratedCoverageReport
86+
@CanIgnoreReturnValue
87+
public Builder clearVertexMultimodalDatasetName() {
88+
return vertexMultimodalDatasetName(Optional.empty());
89+
}
90+
91+
/**
92+
* Setter for gcsOutputDirectory.
93+
*
94+
* <p>gcsOutputDirectory: The full path of the Cloud Storage directory created, into which the
95+
* prediction output is written.
96+
*/
97+
@JsonProperty("gcsOutputDirectory")
98+
public abstract Builder gcsOutputDirectory(String gcsOutputDirectory);
99+
100+
@ExcludeFromGeneratedCoverageReport
101+
abstract Builder gcsOutputDirectory(Optional<String> gcsOutputDirectory);
102+
103+
/** Clears the value of gcsOutputDirectory field. */
104+
@ExcludeFromGeneratedCoverageReport
105+
@CanIgnoreReturnValue
106+
public Builder clearGcsOutputDirectory() {
107+
return gcsOutputDirectory(Optional.empty());
108+
}
109+
110+
/**
111+
* Setter for bigqueryOutputTable.
112+
*
113+
* <p>bigqueryOutputTable: The name of the BigQuery table created, in `predictions_<timestamp>`
114+
* format, into which the prediction output is written.
115+
*/
116+
@JsonProperty("bigqueryOutputTable")
117+
public abstract Builder bigqueryOutputTable(String bigqueryOutputTable);
118+
119+
@ExcludeFromGeneratedCoverageReport
120+
abstract Builder bigqueryOutputTable(Optional<String> bigqueryOutputTable);
121+
122+
/** Clears the value of bigqueryOutputTable field. */
123+
@ExcludeFromGeneratedCoverageReport
124+
@CanIgnoreReturnValue
125+
public Builder clearBigqueryOutputTable() {
126+
return bigqueryOutputTable(Optional.empty());
127+
}
128+
129+
public abstract BatchJobOutputInfo build();
130+
}
131+
132+
/** Deserializes a JSON string to a BatchJobOutputInfo object. */
133+
@ExcludeFromGeneratedCoverageReport
134+
public static BatchJobOutputInfo fromJson(String jsonString) {
135+
return JsonSerializable.fromJsonString(jsonString, BatchJobOutputInfo.class);
136+
}
137+
}

0 commit comments

Comments
 (0)