Skip to content

Commit 2ccd928

Browse files
committed
Add #6939
1 parent 5e32a37 commit 2ccd928

File tree

1 file changed

+6
-1
lines changed
  • firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ internal constructor(
164164
"wss://firebasevertexai.googleapis.com/ws/google.firebase.vertexai.v1beta.LlmBidiService/BidiGenerateContent/locations/$location?key=$key"
165165

166166
suspend fun getWebSocketSession(location: String): ClientWebSocketSession =
167-
client.webSocketSession(getBidiEndpoint(location))
167+
client.webSocketSession(getBidiEndpoint(location)) { applyCommonHeaders() }
168168

169169
fun generateContentStream(
170170
request: GenerateContentRequest
@@ -197,6 +197,11 @@ internal constructor(
197197
is CountTokensRequest -> setBody<CountTokensRequest>(request)
198198
is GenerateImageRequest -> setBody<GenerateImageRequest>(request)
199199
}
200+
201+
applyCommonHeaders()
202+
}
203+
204+
private fun HttpRequestBuilder.applyCommonHeaders() {
200205
contentType(ContentType.Application.Json)
201206
header("x-goog-api-key", key)
202207
header("x-goog-api-client", apiClient)

0 commit comments

Comments
 (0)