Skip to content

Commit 7097cf5

Browse files
authored
Merge branch 'main' into fireperf-strictmode-diskread
2 parents 0b20bea + 9364dc3 commit 7097cf5

File tree

7 files changed

+52
-9
lines changed

7 files changed

+52
-9
lines changed

.github/workflows/dataconnect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ env:
3434
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
3535
FDC_ANDROID_EMULATOR_API_LEVEL: ${{ inputs.androidEmulatorApiLevel || '34' }}
3636
FDC_NODEJS_VERSION: ${{ inputs.nodeJsVersion || '20' }}
37-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.15.1' }}
37+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.0' }}
3838
FDC_FIREBASE_TOOLS_DIR: /tmp/firebase-tools
3939
FDC_FIREBASE_COMMAND: /tmp/firebase-tools/node_modules/.bin/firebase
4040
FDC_PYTHON_VERSION: ${{ inputs.pythonVersion || '3.13' }}

.github/workflows/dataconnect_demo_app.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818

1919
env:
2020
FDC_NODE_VERSION: ${{ inputs.nodeVersion || '20' }}
21-
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.15.1' }}
21+
FDC_FIREBASE_TOOLS_VERSION: ${{ inputs.firebaseToolsVersion || '14.16.0' }}
2222
FDC_JAVA_VERSION: ${{ inputs.javaVersion || '17' }}
2323
FDC_FIREBASE_TOOLS_DIR: ${{ github.workspace }}/firebase-tools
2424
FDC_FIREBASE_COMMAND: ${{ github.workspace }}/firebase-tools/node_modules/.bin/firebase

firebase-ai/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Unreleased
22

33
- [changed] **Breaking Change**: Removed the `candidateCount` option from `LiveGenerationConfig`
4+
(#7382)
5+
- [changed] Added better error messages to `ServiceConnectionHandshakeFailedException` (#7412)
46

57
# 17.3.0
68

firebase-ai/src/main/kotlin/com/google/firebase/ai/LiveGenerativeModel.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import com.google.firebase.ai.type.Tool
3232
import com.google.firebase.annotations.concurrent.Blocking
3333
import com.google.firebase.appcheck.interop.InteropAppCheckTokenProvider
3434
import com.google.firebase.auth.internal.InternalAuthProvider
35+
import io.ktor.client.plugins.websocket.DefaultClientWebSocketSession
3536
import io.ktor.websocket.Frame
3637
import io.ktor.websocket.close
3738
import io.ktor.websocket.readBytes
@@ -114,8 +115,9 @@ internal constructor(
114115
)
115116
.toInternal()
116117
val data: String = Json.encodeToString(clientMessage)
118+
var webSession: DefaultClientWebSocketSession? = null
117119
try {
118-
val webSession = controller.getWebSocketSession(location)
120+
webSession = controller.getWebSocketSession(location)
119121
webSession.send(Frame.Text(data))
120122
val receivedJsonStr = webSession.incoming.receive().readBytes().toString(Charsets.UTF_8)
121123
val receivedJson = JSON.parseToJsonElement(receivedJsonStr)
@@ -131,7 +133,10 @@ internal constructor(
131133
throw ServiceConnectionHandshakeFailedException("Unable to connect to the server")
132134
}
133135
} catch (e: ClosedReceiveChannelException) {
134-
throw ServiceConnectionHandshakeFailedException("Channel was closed by the server", e)
136+
val reason = webSession?.closeReason?.await()
137+
val message =
138+
"Channel was closed by the server.${if(reason!=null) " Details: ${reason.message}" else "" }"
139+
throw ServiceConnectionHandshakeFailedException(message, e)
135140
}
136141
}
137142

firebase-ai/src/main/kotlin/com/google/firebase/ai/common/APIController.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import io.ktor.client.engine.HttpClientEngine
3838
import io.ktor.client.engine.okhttp.OkHttp
3939
import io.ktor.client.plugins.HttpTimeout
4040
import io.ktor.client.plugins.contentnegotiation.ContentNegotiation
41-
import io.ktor.client.plugins.websocket.ClientWebSocketSession
41+
import io.ktor.client.plugins.websocket.DefaultClientWebSocketSession
4242
import io.ktor.client.plugins.websocket.WebSockets
4343
import io.ktor.client.plugins.websocket.webSocketSession
4444
import io.ktor.client.request.HttpRequestBuilder
@@ -174,7 +174,7 @@ internal constructor(
174174
"wss://firebasevertexai.googleapis.com/ws/google.firebase.vertexai.v1beta.GenerativeService/BidiGenerateContent?key=$key"
175175
}
176176

177-
suspend fun getWebSocketSession(location: String): ClientWebSocketSession =
177+
suspend fun getWebSocketSession(location: String): DefaultClientWebSocketSession =
178178
client.webSocketSession(getBidiEndpoint(location)) { applyCommonHeaders() }
179179

180180
fun generateContentStream(

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/LiveSession.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import com.google.firebase.ai.common.util.CancelledCoroutineScope
2929
import com.google.firebase.ai.common.util.accumulateUntil
3030
import com.google.firebase.ai.common.util.childJob
3131
import com.google.firebase.annotations.concurrent.Blocking
32-
import io.ktor.client.plugins.websocket.ClientWebSocketSession
32+
import io.ktor.client.plugins.websocket.DefaultClientWebSocketSession
3333
import io.ktor.websocket.Frame
3434
import io.ktor.websocket.close
3535
import io.ktor.websocket.readBytes
@@ -59,7 +59,7 @@ import kotlinx.serialization.json.Json
5959
@OptIn(ExperimentalSerializationApi::class)
6060
public class LiveSession
6161
internal constructor(
62-
private val session: ClientWebSocketSession,
62+
private val session: DefaultClientWebSocketSession,
6363
@Blocking private val blockingDispatcher: CoroutineContext,
6464
private var audioHelper: AudioHelper? = null,
6565
private val firebaseApp: FirebaseApp,

firebase-dataconnect/gradleplugin/plugin/src/main/resources/com/google/firebase/dataconnect/gradle/plugin/DataConnectExecutableVersions.json

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"defaultVersion": "2.12.0",
2+
"defaultVersion": "2.13.0",
33
"versions": [
44
{
55
"version": "1.3.4",
@@ -990,6 +990,42 @@
990990
"os": "linux",
991991
"size": 29372600,
992992
"sha512DigestHex": "caca15808010440226cb75853d1539291c69f0377f2973a03c53fbd9861142242842f954f60024c8db91c8221d66a7f824bd15c5b52a8a67c33a153ce8868808"
993+
},
994+
{
995+
"version": "2.12.1",
996+
"os": "windows",
997+
"size": 29965312,
998+
"sha512DigestHex": "34a0cbf93f3f0ae9d60a1bd56b8668b9585ae1371ce7cfd5c931a930b6a64b3621a6511e96b74ca8dc695171e2de779dcccfb70d1e3f29869d46c6d10de2f5fb"
999+
},
1000+
{
1001+
"version": "2.12.1",
1002+
"os": "macos",
1003+
"size": 29475680,
1004+
"sha512DigestHex": "164a4c524be810615e8c3e4c41d5fb1e5cb2bd25e6ecf1e48d0c0f7bec84c37ba67f8abb611d65f9e90b2b1acf40eeaec45114ea311863a1a178878d963b1b3b"
1005+
},
1006+
{
1007+
"version": "2.12.1",
1008+
"os": "linux",
1009+
"size": 29401272,
1010+
"sha512DigestHex": "4918eafe8fb23f357e38ddc4e391c93e58261123b97355de2a55bf4cffa358c1442d527b6a7647e0555c73aa91360ee94c1beac64afe0dbeec546d730f7fa201"
1011+
},
1012+
{
1013+
"version": "2.13.0",
1014+
"os": "windows",
1015+
"size": 29965312,
1016+
"sha512DigestHex": "34a0cbf93f3f0ae9d60a1bd56b8668b9585ae1371ce7cfd5c931a930b6a64b3621a6511e96b74ca8dc695171e2de779dcccfb70d1e3f29869d46c6d10de2f5fb"
1017+
},
1018+
{
1019+
"version": "2.13.0",
1020+
"os": "macos",
1021+
"size": 29475680,
1022+
"sha512DigestHex": "164a4c524be810615e8c3e4c41d5fb1e5cb2bd25e6ecf1e48d0c0f7bec84c37ba67f8abb611d65f9e90b2b1acf40eeaec45114ea311863a1a178878d963b1b3b"
1023+
},
1024+
{
1025+
"version": "2.13.0",
1026+
"os": "linux",
1027+
"size": 29401272,
1028+
"sha512DigestHex": "4918eafe8fb23f357e38ddc4e391c93e58261123b97355de2a55bf4cffa358c1442d527b6a7647e0555c73aa91360ee94c1beac64afe0dbeec546d730f7fa201"
9931029
}
9941030
]
9951031
}

0 commit comments

Comments
 (0)