Skip to content

Commit f2465a6

Browse files
authored
refactor(genai): migrate region tags from generative-ai to genai folder (Batch 1) (GoogleCloudPlatform#4335)
1 parent 3bb2fcd commit f2465a6

29 files changed

Lines changed: 20 additions & 996 deletions

genai/count-tokens/counttoken-resp-with-txt.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
'use strict';
16-
16+
// [START generativeaionvertexai_gemini_token_count]
1717
// [START googlegenaisdk_counttoken_resp_with_txt]
1818
const {GoogleGenAI} = require('@google/genai');
1919

@@ -41,6 +41,7 @@ async function countTokens(
4141
return response.usageMetadata;
4242
}
4343
// [END googlegenaisdk_counttoken_resp_with_txt]
44+
// [END generativeaionvertexai_gemini_token_count]
4445

4546
module.exports = {
4647
countTokens,

genai/count-tokens/counttoken-with-txt-vid.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
'use strict';
1616

17+
// [START generativeaionvertexai_gemini_token_count_advanced]
1718
// [START googlegenaisdk_counttoken_with_txt_vid]
1819
const {GoogleGenAI} = require('@google/genai');
1920

@@ -47,6 +48,7 @@ async function countTokens(
4748
return response.totalTokens;
4849
}
4950
// [END googlegenaisdk_counttoken_with_txt_vid]
51+
// [END generativeaionvertexai_gemini_token_count_advanced]
5052

5153
module.exports = {
5254
countTokens,

genai/text-generation/textgen-sys-instr-with-txt.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
'use strict';
1616

17+
// [START generativeaionvertexai_gemini_translate]
18+
// [START generativeaionvertexai_gemini_system_instruction]
1719
// [START googlegenaisdk_textgen_sys_instr_with_txt]
1820
const {GoogleGenAI} = require('@google/genai');
1921

@@ -51,6 +53,8 @@ async function generateContent(
5153
return response.text;
5254
}
5355
// [END googlegenaisdk_textgen_sys_instr_with_txt]
56+
// [END generativeaionvertexai_gemini_system_instruction]
57+
// [END generativeaionvertexai_gemini_translate]
5458

5559
module.exports = {
5660
generateContent,

genai/text-generation/textgen-transcript-with-gcs-audio.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
'use strict';
16-
16+
// [START generativeaionvertexai_gemini_audio_transcription]
1717
// [START googlegenaisdk_textgen_transcript_with_gcs_audio]
1818
const {GoogleGenAI} = require('@google/genai');
1919

@@ -63,6 +63,7 @@ async function generateText(
6363
}
6464

6565
// [END googlegenaisdk_textgen_transcript_with_gcs_audio]
66+
// [END generativeaionvertexai_gemini_audio_transcription]
6667

6768
module.exports = {
6869
generateText,

genai/text-generation/textgen-with-gcs-audio.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
'use strict';
16-
16+
// [START generativeaionvertexai_gemini_audio_summarization]
1717
// [START googlegenaisdk_textgen_with_gcs_audio]
1818
const {GoogleGenAI} = require('@google/genai');
1919

@@ -55,6 +55,7 @@ async function generateText(
5555
return response.text;
5656
}
5757
// [END googlegenaisdk_textgen_with_gcs_audio]
58+
// [END generativeaionvertexai_gemini_audio_summarization]
5859

5960
module.exports = {
6061
generateText,

genai/text-generation/textgen-with-pdf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
'use strict';
16-
16+
// [START generativeaionvertexai_gemini_pdf]
1717
// [START googlegenaisdk_textgen_with_pdf]
1818
const {GoogleGenAI} = require('@google/genai');
1919

@@ -59,6 +59,7 @@ async function generateText(
5959
}
6060

6161
// [END googlegenaisdk_textgen_with_pdf]
62+
// [END generativeaionvertexai_gemini_pdf]
6263

6364
module.exports = {
6465
generateText,

genai/text-generation/textgen-with-txt-stream.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
'use strict';
16-
16+
// [START generativeaionvertexai_stream_text_basic]
1717
// [START googlegenaisdk_textgen_with_txt_stream]
1818
const {GoogleGenAI} = require('@google/genai');
1919

@@ -43,6 +43,7 @@ async function generateContent(
4343
return response_text;
4444
}
4545
// [END googlegenaisdk_textgen_with_txt_stream]
46+
// [END generativeaionvertexai_stream_text_basic]
4647

4748
module.exports = {
4849
generateContent,

genai/text-generation/textgen-with-txt.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414

1515
'use strict';
16-
16+
// [START generativeaionvertexai_gemini_generate_from_text_input]
1717
// [START googlegenaisdk_textgen_with_txt]
1818
const {GoogleGenAI} = require('@google/genai');
1919

@@ -40,6 +40,7 @@ async function generateContent(
4040
return response.text;
4141
}
4242
// [END googlegenaisdk_textgen_with_txt]
43+
// [END generativeaionvertexai_gemini_generate_from_text_input]
4344

4445
module.exports = {
4546
generateContent,

genai/tools/tools-func-desc-with-txt.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
'use strict';
1616

17+
// [START generativeaionvertexai_function_calling_advanced]
1718
// [START googlegenaisdk_tools_func_desc_with_txt]
1819
const {GoogleGenAI, Type} = require('@google/genai');
1920

@@ -99,6 +100,7 @@ async function generateFunctionDesc(
99100
}
100101

101102
// [END googlegenaisdk_tools_func_desc_with_txt]
103+
// [END generativeaionvertexai_function_calling_advanced]
102104

103105
module.exports = {
104106
generateFunctionDesc,

generative-ai/snippets/count-tokens/countTokens.js

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)