File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed
generative_ai/template_folder Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 1919#
2020#
2121# def advanced_example() -> GenerationResponse:
22- # # [START generativeaionvertexai_gemini_token_count_multimodal]
22+ # # TODO: <ADD-START-REGION-TAG-HERE>
2323# import vertexai
2424# from vertexai.generative_models import GenerativeModel, Part
2525#
5858# # Candidates Token Count: 71
5959# # Total Token Count: 16893
6060#
61- # # [END generativeaionvertexai_gemini_token_count_multimodal]
61+ # # TODO: <ADD-END-REGION-TAG-HERE>
6262# return response
6363#
6464#
Original file line number Diff line number Diff line change 1515#
1616# def simple_example() -> int:
1717# "Simple example for <template_folder> feature."
18- # # [START generativeaionvertexai_token_count_sample_with_local_sdk]
18+ # # TODO: <ADD-START-REGION-TAG-HERE>
1919# from vertexai.preview.tokenization import get_tokenizer_for_model
2020#
2121# # Using local tokenzier
3333# # Example response:
3434# # Prompt Token Count: 8
3535#
36- # # [END generativeaionvertexai_token_count_sample_with_local_sdk]
36+ # # TODO: <ADD-START-REGION-TAG-HERE>
3737# return response.total_tokens
3838#
3939#
Original file line number Diff line number Diff line change 1919#
2020#
2121# def advanced_example() -> GenerationResponse:
22- # # [START generativeaionvertexai_gemini_token_count_multimodal]
22+ # # TODO: <ADD-START-REGION-TAG-HERE>
2323# import vertexai
2424# from vertexai.generative_models import GenerativeModel, Part
2525#
5858# # Candidates Token Count: 71
5959# # Total Token Count: 16893
6060#
61- # # [END generativeaionvertexai_gemini_token_count_multimodal]
61+ # # TODO: <ADD-END-REGION-TAG-HERE>
6262# return response
6363#
6464#
Original file line number Diff line number Diff line change 1515#
1616# def simple_example() -> int:
1717# "Simple example for <template_folder> feature."
18- # # [START generativeaionvertexai_token_count_sample_with_local_sdk]
18+ # # TODO: <ADD-START-REGION-TAG-HERE>
1919# from vertexai.preview.tokenization import get_tokenizer_for_model
2020#
2121# # Using local tokenzier
3333# # Example response:
3434# # Prompt Token Count: 8
3535#
36- # # [END generativeaionvertexai_token_count_sample_with_local_sdk]
36+ # # TODO: <ADD-END-REGION-TAG-HERE>
3737# return response.total_tokens
3838#
3939#
You can’t perform that action at this time.
0 commit comments