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 Original file line number Diff line number Diff line change @@ -164,7 +164,7 @@ internal constructor(
164
164
" wss://firebasevertexai.googleapis.com/ws/google.firebase.vertexai.v1beta.LlmBidiService/BidiGenerateContent/locations/$location ?key=$key "
165
165
166
166
suspend fun getWebSocketSession (location : String ): ClientWebSocketSession =
167
- client.webSocketSession(getBidiEndpoint(location))
167
+ client.webSocketSession(getBidiEndpoint(location)) { applyCommonHeaders() }
168
168
169
169
fun generateContentStream (
170
170
request : GenerateContentRequest
@@ -197,6 +197,11 @@ internal constructor(
197
197
is CountTokensRequest -> setBody<CountTokensRequest >(request)
198
198
is GenerateImageRequest -> setBody<GenerateImageRequest >(request)
199
199
}
200
+
201
+ applyCommonHeaders()
202
+ }
203
+
204
+ private fun HttpRequestBuilder.applyCommonHeaders () {
200
205
contentType(ContentType .Application .Json )
201
206
header(" x-goog-api-key" , key)
202
207
header(" x-goog-api-client" , apiClient)
You can’t perform that action at this time.
0 commit comments