diff --git a/common/src/main/kotlin/com/google/ai/client/generativeai/common/APIController.kt b/common/src/main/kotlin/com/google/ai/client/generativeai/common/APIController.kt index ad24f98e..ebac13fd 100644 --- a/common/src/main/kotlin/com/google/ai/client/generativeai/common/APIController.kt +++ b/common/src/main/kotlin/com/google/ai/client/generativeai/common/APIController.kt @@ -131,24 +131,10 @@ internal constructor( throw GoogleGenerativeAIException.from(e) } - suspend fun vertexCountTokens(request: VertexCountTokensRequest): CountTokensResponse = - try { - client - .post("${requestOptions.endpoint}/${requestOptions.apiVersion}/$model:countTokens") { - applyCommonConfiguration(request) - applyHeaderProvider() - } - .also { validateResponse(it) } - .body() - } catch (e: Throwable) { - throw GoogleGenerativeAIException.from(e) - } - private fun HttpRequestBuilder.applyCommonConfiguration(request: Request) { when (request) { is GenerateContentRequest -> setBody(request) is CountTokensRequest -> setBody(request) - is VertexCountTokensRequest -> setBody(request) } contentType(ContentType.Application.Json) header("x-goog-api-key", key)