@@ -825,7 +825,7 @@ async def count_tokens_async( |
825 | 825 | def compute_tokens( |
826 | 826 | self, contents: ContentsType |
827 | 827 | ) -> gapic_llm_utility_service_types.ComputeTokensResponse: |
828 | | - """Counts tokens. |
| 828 | + """Computes tokens. |
829 | 829 |
|
830 | 830 | Args: |
831 | 831 | contents: Contents to send to the model. |
@@ -837,9 +837,13 @@ def compute_tokens( |
837 | 837 | * List[Content] |
838 | 838 |
|
839 | 839 | Returns: |
840 | | - A CountTokensResponse object that has the following attributes: |
841 | | - total_tokens: The total number of tokens counted across all instances from the request. |
842 | | - total_billable_characters: The total number of billable characters counted across all instances from the request. |
| 840 | + A ComputeTokensResponse object that has the following attributes: |
| 841 | + tokens_info: Lists of tokens_info from the input. |
| 842 | + The input `contents: ContentsType` could have |
| 843 | + multiple string instances and each tokens_info |
| 844 | + item represents each string instance. Each token |
| 845 | + info consists tokens list, token_ids list and |
| 846 | + a role. |
843 | 847 | """ |
844 | 848 | return self._llm_utility_client.compute_tokens( |
845 | 849 | request=gapic_llm_utility_service_types.ComputeTokensRequest( |
@@ -852,7 +856,7 @@ def compute_tokens( |
852 | 856 | async def compute_tokens_async( |
853 | 857 | self, contents: ContentsType |
854 | 858 | ) -> gapic_llm_utility_service_types.ComputeTokensResponse: |
855 | | - """Counts tokens asynchronously. |
| 859 | + """Computes tokens asynchronously. |
856 | 860 |
|
857 | 861 | Args: |
858 | 862 | contents: Contents to send to the model. |
@@ -864,9 +868,13 @@ async def compute_tokens_async( |
864 | 868 | * List[Content] |
865 | 869 |
|
866 | 870 | Returns: |
867 | | - And awaitable for a CountTokensResponse object that has the following attributes: |
868 | | - total_tokens: The total number of tokens counted across all instances from the request. |
869 | | - total_billable_characters: The total number of billable characters counted across all instances from the request. |
| 871 | + And awaitable for a ComputeTokensResponse object that has the following attributes: |
| 872 | + tokens_info: Lists of tokens_info from the input. |
| 873 | + The input `contents: ContentsType` could have |
| 874 | + multiple string instances and each tokens_info |
| 875 | + item represents each string instance. Each token |
| 876 | + info consists tokens list, token_ids list and |
| 877 | + a role. |
870 | 878 | """ |
871 | 879 | return await self._llm_utility_async_client.compute_tokens( |
872 | 880 | request=gapic_llm_utility_service_types.ComputeTokensRequest( |
|