Skip to content

Commit

Permalink
fix: GenAI - Fixed GenerativeModel.compute_tokens for v1 API
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 675711678
  • Loading branch information
Ark-kun authored and copybara-github committed Sep 17, 2024
1 parent f882657 commit 0de2987
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vertexai/generative_models/_generative_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2960,7 +2960,7 @@ def _gapic_compute_tokens(
prediction_resource_name: str,
contents: List[gapic_content_types.Content],
) -> gapic_prediction_service_types.CountTokensResponse:
request = gapic_llm_utility_service_types.ComputeTokensRequest(
request = types_v1.ComputeTokensRequest(
endpoint=prediction_resource_name,
model=prediction_resource_name,
contents=contents,
Expand All @@ -2972,7 +2972,7 @@ async def _gapic_compute_tokens_async(
prediction_resource_name: str,
contents: List[gapic_content_types.Content],
) -> gapic_prediction_service_types.CountTokensResponse:
request = gapic_llm_utility_service_types.ComputeTokensRequest(
request = types_v1.ComputeTokensRequest(
endpoint=prediction_resource_name,
model=prediction_resource_name,
contents=contents,
Expand Down

0 comments on commit 0de2987

Please sign in to comment.