Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/main/java/com/google/genai/Batches.java
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,13 @@ ObjectNode generateContentConfigToMldev(
toObject));
}

if (Common.getValueByPath(fromObject, new String[] {"enableEnhancedCivicAnswers"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"enableEnhancedCivicAnswers"},
Common.getValueByPath(fromObject, new String[] {"enableEnhancedCivicAnswers"}));
}

return toObject;
}

Expand Down
13 changes: 13 additions & 0 deletions src/main/java/com/google/genai/Models.java
Original file line number Diff line number Diff line change
Expand Up @@ -1372,6 +1372,13 @@ ObjectNode generateContentConfigToMldev(
toObject));
}

if (Common.getValueByPath(fromObject, new String[] {"enableEnhancedCivicAnswers"}) != null) {
Common.setValueByPath(
toObject,
new String[] {"enableEnhancedCivicAnswers"},
Common.getValueByPath(fromObject, new String[] {"enableEnhancedCivicAnswers"}));
}

return toObject;
}

Expand Down Expand Up @@ -1591,6 +1598,12 @@ ObjectNode generateContentConfigToVertex(
toObject));
}

if (!Common.isZero(
Common.getValueByPath(fromObject, new String[] {"enableEnhancedCivicAnswers"}))) {
throw new IllegalArgumentException(
"enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");
}

return toObject;
}

Expand Down
26 changes: 26 additions & 0 deletions src/main/java/com/google/genai/types/GenerateContentConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,13 @@ public abstract class GenerateContentConfig extends JsonSerializable {
@JsonProperty("imageConfig")
public abstract Optional<ImageConfig> imageConfig();

/**
* Enables enhanced civic answers. It may not be available for all models. This field is not
* supported in Vertex AI.
*/
@JsonProperty("enableEnhancedCivicAnswers")
public abstract Optional<Boolean> enableEnhancedCivicAnswers();

/** Instantiates a builder for GenerateContentConfig. */
@ExcludeFromGeneratedCoverageReport
public static Builder builder() {
Expand Down Expand Up @@ -1032,6 +1039,25 @@ public Builder clearImageConfig() {
return imageConfig(Optional.empty());
}

/**
* Setter for enableEnhancedCivicAnswers.
*
* <p>enableEnhancedCivicAnswers: Enables enhanced civic answers. It may not be available for
* all models. This field is not supported in Vertex AI.
*/
@JsonProperty("enableEnhancedCivicAnswers")
public abstract Builder enableEnhancedCivicAnswers(boolean enableEnhancedCivicAnswers);

@ExcludeFromGeneratedCoverageReport
abstract Builder enableEnhancedCivicAnswers(Optional<Boolean> enableEnhancedCivicAnswers);

/** Clears the value of enableEnhancedCivicAnswers field. */
@ExcludeFromGeneratedCoverageReport
@CanIgnoreReturnValue
public Builder clearEnableEnhancedCivicAnswers() {
return enableEnhancedCivicAnswers(Optional.empty());
}

public abstract GenerateContentConfig build();
}

Expand Down