Skip to content

Commit 16cf086

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent eaa09e7 commit 16cf086

5 files changed

Lines changed: 26 additions & 19 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,14 @@ async function generateContent(
4141

4242
console.log(response.text);
4343

44+
// Example response:
45+
// (Verse 1)
46+
// Sammy the nugget, a furry little friend
47+
// Had a knack for adventure, beyond all comprehend
48+
4449
return response.text;
4550
}
46-
// Example response:
47-
// (Verse 1)
48-
// Sammy the nugget, a furry little friend
49-
// Had a knack for adventure, beyond all comprehend
51+
5052
// [END googlegenaisdk_textgen_async_with_txt]
5153

5254
module.exports = {

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ async function generateContent(
3939
})) {
4040
console.log(chunk.text);
4141
}
42-
42+
// Example response:
43+
// The
44+
// sky appears blue due to a phenomenon called **Rayleigh scattering**. Here's
45+
// a breakdown of why:
46+
// ...
4347
return true;
4448
}
45-
// Example response:
46-
// The
47-
// sky appears blue due to a phenomenon called **Rayleigh scattering**. Here's
48-
// a breakdown of why:
49-
// ...
49+
5050
// [END googlegenaisdk_textgen_chat_stream_with_txt]
5151

5252
module.exports = {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ async function generateContent(
4747
const response = await chatSession.sendMessage({message: 'Tell me a story.'});
4848
console.log(response.text);
4949

50+
// Example response:
51+
// Okay, here's a story for you:
52+
// ...
53+
5054
return response.text;
5155
}
52-
// Example response:
53-
// Okay, here's a story for you:
54-
// ...
56+
5557
// [END googlegenaisdk_textgen_chat_with_txt]
5658

5759
module.exports = {

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,14 @@ async function generateContent(
5151

5252
console.log(response.text);
5353

54+
// Example response:
55+
// {
56+
// "explanation": "The sky appears blue due to a phenomenon called Rayleigh scattering. When ...
57+
// }
58+
5459
return response.text;
5560
}
56-
// Example response:
57-
// {
58-
// "explanation": "The sky appears blue due to a phenomenon called Rayleigh scattering. When ...
59-
// }
61+
6062
// [END googlegenaisdk_textgen_config_with_txt]
6163

6264
module.exports = {

genai/text-generation/textgen-with-mute-video.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,11 @@ async function generateContent(
5353

5454
console.log(response.text);
5555

56+
// Example response:
57+
// The video shows several people surfing in an ocean with a coastline in the background. The camera ...
58+
5659
return response.text;
5760
}
58-
// Example response:
59-
// The video shows several people surfing in an ocean with a coastline in the background. The camera ...
6061
// [END googlegenaisdk_textgen_with_mute_video]
6162

6263
module.exports = {

0 commit comments

Comments
 (0)