Skip to content

Commit a6d465d

Browse files
author
David Motsonashvili
committed
fixes for comments
1 parent 71d6f0a commit a6d465d

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/FirebaseGoogleAI.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ import com.google.firebase.vertexai.type.SafetySetting
2929
import com.google.firebase.vertexai.type.Tool
3030
import com.google.firebase.vertexai.type.ToolConfig
3131

32-
/** Entry point for all _Google AI in Vertex for Firebase_ functionality. */
32+
/** Entry point for all _Google AI_ functionality. */
3333
public class FirebaseGoogleAI internal constructor(private val proxy: FirebaseVertexAI) {
3434

3535
/**
3636
* Instantiates a new [GenerativeModel] given the provided parameters.
3737
*
38-
* @param modelName The name of the model to use, for example `"gemini-1.5-pro"`.
38+
* @param modelName The name of the model to use, for example `"gemini-2.0-pro"`.
3939
* @param generationConfig The configuration parameters to use for content generation.
4040
* @param safetySettings The safety bounds the model will abide to during content generation.
4141
* @param tools A list of [Tool]s the model may use to generate content.
@@ -93,7 +93,7 @@ public class FirebaseGoogleAI internal constructor(private val proxy: FirebaseVe
9393
@JvmStatic
9494
public fun getInstance(app: FirebaseApp = Firebase.app): FirebaseGoogleAI {
9595
val multiResourceComponent = app[FirebaseVertexAIMultiResourceComponent::class.java]
96-
return multiResourceComponent.getGoogle()
96+
return multiResourceComponent.getGoogleAI()
9797
}
9898
}
9999
}

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/FirebaseVertexAI.kt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ internal constructor(
8888
"""Unsupported Gemini model "${modelName}"; see
8989
https://firebase.google.com/docs/vertex-ai/models for a list supported Gemini model names.
9090
"""
91-
.trimIndent()
91+
.trimIndent(),
9292
)
9393
}
9494
return GenerativeModel(
@@ -133,7 +133,7 @@ internal constructor(
133133
"""Unsupported Gemini model "$modelName"; see
134134
https://firebase.google.com/docs/vertex-ai/models for a list supported Gemini model names.
135135
"""
136-
.trimIndent()
136+
.trimIndent(),
137137
)
138138
}
139139
if (location.trim().isEmpty() || location.contains("/")) {
@@ -187,7 +187,7 @@ internal constructor(
187187
"""Unsupported Imagen model "${modelName}"; see
188188
https://firebase.google.com/docs/vertex-ai/models for a list supported Imagen model names.
189189
"""
190-
.trimIndent()
190+
.trimIndent(),
191191
)
192192
}
193193
return ImagenModel(
@@ -219,9 +219,12 @@ internal constructor(
219219
@JvmOverloads
220220
public fun getInstance(app: FirebaseApp = Firebase.app, location: String): FirebaseVertexAI {
221221
val multiResourceComponent = app[FirebaseVertexAIMultiResourceComponent::class.java]
222-
return multiResourceComponent.getVertex(location)
222+
return multiResourceComponent.getVertexAI(location)
223223
}
224224

225+
/** Returns the [FirebaseVertexAI] instance for the provided [FirebaseApp] */
226+
@JvmStatic public fun getInstance(app: FirebaseApp): FirebaseVertexAI = getInstance(app)
227+
225228
private const val GEMINI_MODEL_NAME_PREFIX = "gemini-"
226229

227230
private const val IMAGEN_MODEL_NAME_PREFIX = "imagen-"

firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/FirebaseVertexAIMultiResourceComponent.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ internal class FirebaseVertexAIMultiResourceComponent(
4242

4343
@GuardedBy("this") private val googleInstance: MutableList<FirebaseGoogleAI> = mutableListOf()
4444

45-
fun getVertex(location: String): FirebaseVertexAI =
45+
fun getVertexAI(location: String): FirebaseVertexAI =
4646
synchronized(this) {
4747
vertexInstances[location]
4848
?: FirebaseVertexAI(
@@ -56,7 +56,7 @@ internal class FirebaseVertexAIMultiResourceComponent(
5656
.also { vertexInstances[location] = it }
5757
}
5858

59-
fun getGoogle(): FirebaseGoogleAI =
59+
fun getGoogleAI(): FirebaseGoogleAI =
6060
synchronized(this) {
6161
googleInstance.getOrNull(0)
6262
?: FirebaseGoogleAI(

0 commit comments

Comments
 (0)