Skip to content

Commit f8b1d12

Browse files
committed
live config builders
1 parent 329937c commit f8b1d12

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

firebase-vertexai/api.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,15 @@ package com.google.firebase.vertexai.type {
594594
public static final class LiveGenerationConfig.Builder {
595595
ctor public LiveGenerationConfig.Builder();
596596
method public com.google.firebase.vertexai.type.LiveGenerationConfig build();
597+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setCandidateCount(Integer? candidateCount);
598+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setFrequencyPenalty(Float? frequencyPenalty);
599+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setMaxOutputTokens(Integer? maxOutputTokens);
600+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setPresencePenalty(Float? presencePenalty);
601+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setResponseModalities(java.util.List<com.google.firebase.vertexai.type.ContentModality>? responseModalities);
602+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setSpeechConfig(com.google.firebase.vertexai.type.SpeechConfig? speechConfig);
603+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setTemperature(Float? temperature);
604+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setTopK(Integer? topK);
605+
method public com.google.firebase.vertexai.type.LiveGenerationConfig.Builder setTopP(Float? topP);
597606
field public Integer? candidateCount;
598607
field public Float? frequencyPenalty;
599608
field public Integer? maxOutputTokens;

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveGenerationConfig.kt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,30 @@ private constructor(
112112
@JvmField public var responseModalities: List<ContentModality>? = null
113113
@JvmField public var speechConfig: SpeechConfig? = null
114114

115+
public fun setTemperature(temperature: Float?): Builder = apply {
116+
this.temperature = temperature
117+
}
118+
public fun setTopK(topK: Int?): Builder = apply { this.topK = topK }
119+
public fun setTopP(topP: Float?): Builder = apply { this.topP = topP }
120+
public fun setCandidateCount(candidateCount: Int?): Builder = apply {
121+
this.candidateCount = candidateCount
122+
}
123+
public fun setMaxOutputTokens(maxOutputTokens: Int?): Builder = apply {
124+
this.maxOutputTokens = maxOutputTokens
125+
}
126+
public fun setPresencePenalty(presencePenalty: Float?): Builder = apply {
127+
this.presencePenalty = presencePenalty
128+
}
129+
public fun setFrequencyPenalty(frequencyPenalty: Float?): Builder = apply {
130+
this.frequencyPenalty = frequencyPenalty
131+
}
132+
public fun setResponseModalities(responseModalities: List<ContentModality>?): Builder = apply {
133+
this.responseModalities = responseModalities
134+
}
135+
public fun setSpeechConfig(speechConfig: SpeechConfig?): Builder = apply {
136+
this.speechConfig = speechConfig
137+
}
138+
115139
/** Create a new [LiveGenerationConfig] with the attached arguments. */
116140
public fun build(): LiveGenerationConfig =
117141
LiveGenerationConfig(

0 commit comments

Comments
 (0)