Skip to content

Commit 3f285b8

Browse files
andrewhearddaymxn
authored andcommitted
Add liveModel static method to construct LiveGenerativeModel
1 parent 60003c1 commit 3f285b8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

FirebaseAI/Sources/FirebaseAI.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,18 @@ public final class FirebaseAI: Sendable {
141141
)
142142
}
143143

144+
public func liveModel(modelName: String,
145+
generationConfig: LiveGenerationConfig? = nil,
146+
requestOptions: RequestOptions = RequestOptions()) -> LiveGenerativeModel {
147+
return LiveGenerativeModel(
148+
modelResourceName: modelResourceName(modelName: modelName),
149+
firebaseInfo: firebaseInfo,
150+
apiConfig: apiConfig,
151+
generationConfig: generationConfig,
152+
requestOptions: requestOptions
153+
)
154+
}
155+
144156
/// Class to enable FirebaseAI to register via the Objective-C based Firebase component system
145157
/// to include FirebaseAI in the userAgent.
146158
@objc(FIRVertexAIComponent) class FirebaseVertexAIComponent: NSObject {}

0 commit comments

Comments
 (0)