@@ -77,6 +77,7 @@ import kotlinx.serialization.Serializable
7777 * guide for more details.
7878 */
7979public class GenerationConfig
80+ @OptIn(PublicPreviewAPI ::class )
8081private constructor (
8182 internal val temperature: Float? ,
8283 internal val topK: Int? ,
@@ -88,6 +89,7 @@ private constructor(
8889 internal val stopSequences: List <String >? ,
8990 internal val responseMimeType: String? ,
9091 internal val responseSchema: Schema ? ,
92+ internal val responseModalities: List <ResponseModality >? ,
9193) {
9294
9395 /* *
@@ -128,6 +130,7 @@ private constructor(
128130 @JvmField public var stopSequences: List <String >? = null
129131 @JvmField public var responseMimeType: String? = null
130132 @JvmField public var responseSchema: Schema ? = null
133+ @JvmField public var responseModalities: List <ResponseModality >? = null
131134
132135 /* * Create a new [GenerationConfig] with the attached arguments. */
133136 public fun build (): GenerationConfig =
@@ -142,6 +145,7 @@ private constructor(
142145 frequencyPenalty = frequencyPenalty,
143146 responseMimeType = responseMimeType,
144147 responseSchema = responseSchema,
148+ responseModalities = responseModalities
145149 )
146150 }
147151
@@ -156,7 +160,8 @@ private constructor(
156160 frequencyPenalty = frequencyPenalty,
157161 presencePenalty = presencePenalty,
158162 responseMimeType = responseMimeType,
159- responseSchema = responseSchema?.toInternal()
163+ responseSchema = responseSchema?.toInternal(),
164+ responseModalities = responseModalities?.map { it.toInternal() }
160165 )
161166
162167 @Serializable
@@ -171,6 +176,7 @@ private constructor(
171176 @SerialName(" presence_penalty" ) val presencePenalty : Float? = null ,
172177 @SerialName(" frequency_penalty" ) val frequencyPenalty : Float? = null ,
173178 @SerialName(" response_schema" ) val responseSchema : Schema .Internal ? = null ,
179+ @SerialName(" response_modalities" ) val responseModalities : List <String >? = null
174180 )
175181
176182 public companion object {
0 commit comments