@@ -75,6 +75,8 @@ import kotlinx.serialization.Serializable
7575 * Refer to the
7676 * [Control generated output](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output)
7777 * guide for more details.
78+ *
79+ * @property responseModalities The format of data in which the model should respond with.
7880 */
7981public class GenerationConfig
8082private constructor (
@@ -88,6 +90,7 @@ private constructor(
8890 internal val stopSequences: List <String >? ,
8991 internal val responseMimeType: String? ,
9092 internal val responseSchema: Schema ? ,
93+ internal val responseModalities: List <ResponseModality >? ,
9194) {
9295
9396 /* *
@@ -115,6 +118,9 @@ private constructor(
115118 * @property responseMimeType See [GenerationConfig.responseMimeType].
116119 *
117120 * @property responseSchema See [GenerationConfig.responseSchema].
121+ *
122+ * @property responseModalities See [GenerationConfig.responseModalities].
123+ *
118124 * @see [generationConfig]
119125 */
120126 public class Builder {
@@ -128,6 +134,7 @@ private constructor(
128134 @JvmField public var stopSequences: List <String >? = null
129135 @JvmField public var responseMimeType: String? = null
130136 @JvmField public var responseSchema: Schema ? = null
137+ @JvmField public var responseModalities: List <ResponseModality >? = null
131138
132139 /* * Create a new [GenerationConfig] with the attached arguments. */
133140 public fun build (): GenerationConfig =
@@ -142,6 +149,7 @@ private constructor(
142149 frequencyPenalty = frequencyPenalty,
143150 responseMimeType = responseMimeType,
144151 responseSchema = responseSchema,
152+ responseModalities = responseModalities
145153 )
146154 }
147155
@@ -156,7 +164,8 @@ private constructor(
156164 frequencyPenalty = frequencyPenalty,
157165 presencePenalty = presencePenalty,
158166 responseMimeType = responseMimeType,
159- responseSchema = responseSchema?.toInternal()
167+ responseSchema = responseSchema?.toInternal(),
168+ responseModalities = responseModalities?.map { it.toInternal() }
160169 )
161170
162171 @Serializable
@@ -171,6 +180,7 @@ private constructor(
171180 @SerialName(" presence_penalty" ) val presencePenalty : Float? = null ,
172181 @SerialName(" frequency_penalty" ) val frequencyPenalty : Float? = null ,
173182 @SerialName(" response_schema" ) val responseSchema : Schema .Internal ? = null ,
183+ @SerialName(" response_modalities" ) val responseModalities : List <String >? = null
174184 )
175185
176186 public companion object {
0 commit comments