Skip to content

Commit

Permalink
Use a consistent naming for apiClient
Browse files Browse the repository at this point in the history
  • Loading branch information
rlazo committed Apr 3, 2024
1 parent 6bc885f commit a31c443
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.channelFlow
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.flow.timeout
import kotlinx.coroutines.launch
import kotlinx.serialization.json.Json

Expand All @@ -59,23 +58,23 @@ val JSON = Json {
* Exposed primarily for DI in tests.
* @property key The API key used for authentication.
* @property model The model to use for generation.
* @property clientId The value to pass in the `x-goog-api-client` header.
* @property apiClient The value to pass in the `x-goog-api-client` header.
*/
class APIController
internal constructor(
private val key: String,
model: String,
private val requestOptions: RequestOptions,
httpEngine: HttpClientEngine,
private val clientId: String
private val apiClient: String
) {

constructor(
key: String,
model: String,
requestOptions: RequestOptions,
clientId: String
) : this(key, model, requestOptions, OkHttp.create(), clientId)
apiClient: String
) : this(key, model, requestOptions, OkHttp.create(), apiClient)

private val model = fullModelName(model)

Expand Down Expand Up @@ -130,7 +129,7 @@ internal constructor(
}
contentType(ContentType.Application.Json)
header("x-goog-api-key", key)
header("x-goog-api-client", clientId)
header("x-goog-api-client", apiClient)
}
}

Expand Down

0 comments on commit a31c443

Please sign in to comment.