Skip to content

Commit a3d808b

Browse files
author
Guiners
committed
adding samples, test, lints
1 parent b659f40 commit a3d808b

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

genai/live/live-audio-with-txt.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ async function generateContent(
104104
console.log('Received audio answer (saved to response.raw)');
105105
}
106106

107+
// Example output:
108+
//> Hello? Gemini, are you there?
109+
// Received audio answer (saved to response.raw)
110+
107111
return audioChunks;
108112
}
109-
// Example output:
110-
//> Hello? Gemini, are you there?
111-
// Received audio answer (saved to response.raw)
113+
112114
// [END googlegenaisdk_live_audio_with_txt]
113115

114116
module.exports = {

genai/live/live-ground-ragengine-with-txt.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,16 @@ async function generateContent(
108108
}
109109

110110
console.log(response.join(''));
111+
112+
// Example output:
113+
// > What year did Mariusz Pudzianowski win World's Strongest Man?
114+
// Mariusz Pudzianowski won World's Strongest Man in 2002, 2003, 2005, 2007, and 2008.
115+
111116
session.close();
112117

113118
return response;
114119
}
115-
// Example output:
116-
// > What year did Mariusz Pudzianowski win World's Strongest Man?
117-
// Mariusz Pudzianowski won World's Strongest Man in 2002, 2003, 2005, 2007, and 2008.
120+
118121
// [END googlegenaisdk_live_audio_with_txt]
119122

120123
module.exports = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//todo
1+
//todo

genai/live/live-transcribe-with-audio.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,14 @@ async function generateContent(
9292

9393
const turns = await handleTurn(session);
9494

95+
// Example output:
96+
//> Hello? Gemini, are you there?
97+
// Yes, I'm here. What would you like to talk about?
98+
9599
session.close();
96100
return turns;
97101
}
98-
// Example output:
99-
//> Hello? Gemini, are you there?
100-
// Yes, I'm here. What would you like to talk about?
102+
101103
// [END googlegenaisdk_live_transcribe_with_audio]
102104

103105
module.exports = {

genai/live/live-txt-with-audio.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,16 @@ async function generateContent(
9595
}
9696

9797
console.log('Final response:', response.join(''));
98+
99+
// Example output:
100+
//> Answer to this audio url https://storage.googleapis.com/generativeai-downloads/data/16000.wav
101+
// Final response: Yes, I can hear you. How are you doing today?
102+
98103
session.close();
99104

100105
return response;
101106
}
102107

103-
// Example output:
104-
//> Answer to this audio url https://storage.googleapis.com/generativeai-downloads/data/16000.wav
105-
// Final response: Yes, I can hear you. How are you doing today?
106108
// [END googlegenaisdk_live_txt_with_audio]
107109

108110
module.exports = {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
//todo
1+
//todo

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"dependencies": {
3434
"commander": "^12.0.0",
35-
"eslint": "^8.57.0"
35+
"eslint": "^8.57.0",
36+
"node-fetch": "^3.3.2"
3637
}
3738
}

0 commit comments

Comments
 (0)