@@ -75,6 +75,8 @@ import kotlinx.serialization.Serializable
75
75
* Refer to the
76
76
* [Control generated output](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/control-generated-output)
77
77
* guide for more details.
78
+ *
79
+ * @property responseModalities The format of data in which the model should respond with.
78
80
*/
79
81
public class GenerationConfig
80
82
private constructor (
@@ -88,6 +90,7 @@ private constructor(
88
90
internal val stopSequences: List <String >? ,
89
91
internal val responseMimeType: String? ,
90
92
internal val responseSchema: Schema ? ,
93
+ internal val responseModalities: List <ResponseModality >? ,
91
94
) {
92
95
93
96
/* *
@@ -115,6 +118,9 @@ private constructor(
115
118
* @property responseMimeType See [GenerationConfig.responseMimeType].
116
119
*
117
120
* @property responseSchema See [GenerationConfig.responseSchema].
121
+ *
122
+ * @property responseModalities See [GenerationConfig.responseModalities].
123
+ *
118
124
* @see [generationConfig]
119
125
*/
120
126
public class Builder {
@@ -128,6 +134,7 @@ private constructor(
128
134
@JvmField public var stopSequences: List <String >? = null
129
135
@JvmField public var responseMimeType: String? = null
130
136
@JvmField public var responseSchema: Schema ? = null
137
+ @JvmField public var responseModalities: List <ResponseModality >? = null
131
138
132
139
/* * Create a new [GenerationConfig] with the attached arguments. */
133
140
public fun build (): GenerationConfig =
@@ -142,6 +149,7 @@ private constructor(
142
149
frequencyPenalty = frequencyPenalty,
143
150
responseMimeType = responseMimeType,
144
151
responseSchema = responseSchema,
152
+ responseModalities = responseModalities
145
153
)
146
154
}
147
155
@@ -156,7 +164,8 @@ private constructor(
156
164
frequencyPenalty = frequencyPenalty,
157
165
presencePenalty = presencePenalty,
158
166
responseMimeType = responseMimeType,
159
- responseSchema = responseSchema?.toInternal()
167
+ responseSchema = responseSchema?.toInternal(),
168
+ responseModalities = responseModalities?.map { it.toInternal() }
160
169
)
161
170
162
171
@Serializable
@@ -171,6 +180,7 @@ private constructor(
171
180
@SerialName(" presence_penalty" ) val presencePenalty : Float? = null ,
172
181
@SerialName(" frequency_penalty" ) val frequencyPenalty : Float? = null ,
173
182
@SerialName(" response_schema" ) val responseSchema : Schema .Internal ? = null ,
183
+ @SerialName(" response_modalities" ) val responseModalities : List <String >? = null
174
184
)
175
185
176
186
public companion object {
0 commit comments