File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- // [START generativeaionvertexai_gemini_token_count]
1615const { GoogleGenAI} = require ( '@google/genai' ) ;
1716
1817/**
@@ -51,7 +50,6 @@ async function countTokens(
5150 const usageMetadata = result . usageMetadata ;
5251 console . log ( 'Response tokens count: ' , usageMetadata ) ;
5352}
54- // [END generativeaionvertexai_gemini_token_count]
5553
5654countTokens ( ...process . argv . slice ( 2 ) ) . catch ( err => {
5755 console . error ( err . message ) ;
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- // [START generativeaionvertexai_gemini_token_count_advanced]
1615const { GoogleGenAI} = require ( '@google/genai' ) ;
1716/**
1817 * TODO(developer): Update these variables before running the sample.
@@ -63,7 +62,6 @@ async function countTokens(
6362 console . log ( 'Candidates Token Count:' , usageMetadata . candidatesTokenCount ) ;
6463 console . log ( 'Total Token Count:' , usageMetadata . totalTokenCount ) ;
6564}
66- // [END generativeaionvertexai_gemini_token_count_advanced]
6765
6866countTokens ( ...process . argv . slice ( 2 ) ) . catch ( err => {
6967 console . error ( err . message ) ;
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- // [START generativeaionvertexai_grounding_private_data_basic]
1615const { GoogleGenAI} = require ( '@google/genai' ) ;
1716
1817/**
@@ -62,7 +61,6 @@ async function generateContentWithVertexAISearchGrounding(
6261 JSON . stringify ( result . candidates [ 0 ] . groundingMetadata )
6362 ) ;
6463}
65- // [END generativeaionvertexai_grounding_private_data_basic]
6664
6765generateContentWithVertexAISearchGrounding ( ...process . argv . slice ( 2 ) ) . catch (
6866 err => {
Original file line number Diff line number Diff line change 1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15- // [START generativeaionvertexai_grounding_public_data_basic]
1615const { GoogleGenAI} = require ( '@google/genai' ) ;
1716
1817/**
@@ -48,7 +47,6 @@ async function generateContentWithGoogleSearchGrounding(
4847 JSON . stringify ( result . candidates [ 0 ] . groundingMetadata )
4948 ) ;
5049}
51- // [END generativeaionvertexai_grounding_public_data_basic]
5250
5351generateContentWithGoogleSearchGrounding ( ...process . argv . slice ( 2 ) ) . catch (
5452 err => {
You can’t perform that action at this time.
0 commit comments