diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/LiveGenerativeModel.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/LiveGenerativeModel.kt index 79868ab3f0c..8ee07ac3211 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/LiveGenerativeModel.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/LiveGenerativeModel.kt @@ -100,11 +100,7 @@ internal constructor( val receivedJson = webSession.incoming.receive().readBytes().toString(Charsets.UTF_8) // TODO: Try to decode the json instead of string matching. return if (receivedJson.contains("setupComplete")) { - LiveSession( - session = webSession, - backgroundDispatcher = backgroundDispatcher, - isRecording = false - ) + LiveSession(session = webSession, backgroundDispatcher = backgroundDispatcher) } else { webSession.close() throw GeminiConnectionHandshakeFailed() diff --git a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveSession.kt b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveSession.kt index 7690a1b5272..ef8c83e0970 100644 --- a/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveSession.kt +++ b/firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/type/LiveSession.kt @@ -44,7 +44,6 @@ public class LiveSession internal constructor( private val session: ClientWebSocketSession?, @Background private val backgroundDispatcher: CoroutineContext, - private var isRecording: Boolean, private var audioHelper: AudioHelper? = null ) { @@ -52,6 +51,7 @@ internal constructor( private val playBackQueue = ConcurrentLinkedQueue() private var startedReceiving = false private var receiveChannel: Channel = Channel() + private var isRecording: Boolean = false private companion object { val TAG = LiveSession::class.java.simpleName