File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
firebase-vertexai/src/main/kotlin/com/google/firebase/vertexai/common Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff 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)
You can’t perform that action at this time.
0 commit comments