@@ -25,9 +25,11 @@ package com.google.firebase.vertexai.type
25
25
* @property candidateCount The max *unique* responses to return
26
26
* @property maxOutputTokens The max tokens to generate per response
27
27
* @property stopSequences A list of strings to stop generation on occurrence of
28
- * * @property responseMimeType Response type for generated candidate text. See the
28
+ * @property responseMimeType Response type for generated candidate text. See the
29
29
* [vertex docs](https://cloud.google.com/vertex-ai/docs/reference/rest/v1beta1/GenerationConfig)
30
30
* for a list of supported types.
31
+ * @property responseSchema A schema that the response must adhere to, used with the
32
+ * `application/json` mimeType.
31
33
*/
32
34
class GenerationConfig
33
35
private constructor (
@@ -37,7 +39,8 @@ private constructor(
37
39
val candidateCount: Int? ,
38
40
val maxOutputTokens: Int? ,
39
41
val stopSequences: List <String >? ,
40
- val responseMimeType: String?
42
+ val responseMimeType: String? ,
43
+ val responseSchema: Schema <* >? = null ,
41
44
) {
42
45
43
46
/* *
@@ -63,6 +66,7 @@ private constructor(
63
66
@JvmField var maxOutputTokens: Int? = null
64
67
@JvmField var stopSequences: List <String >? = null
65
68
@JvmField var responseMimeType: String? = null
69
+ @JvmField var responseSchema: Schema <* >? = null
66
70
67
71
/* * Create a new [GenerationConfig] with the attached arguments. */
68
72
fun build () =
@@ -73,7 +77,8 @@ private constructor(
73
77
candidateCount = candidateCount,
74
78
maxOutputTokens = maxOutputTokens,
75
79
stopSequences = stopSequences,
76
- responseMimeType = responseMimeType
80
+ responseMimeType = responseMimeType,
81
+ responseSchema = responseSchema
77
82
)
78
83
}
79
84
0 commit comments