Skip to content

Commit edf262f

Browse files
committed
Small changes from Gemini PR comments
1 parent 4ddb5f0 commit edf262f

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

packages/ai/integration/live.test.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ async function nextTurnData(
7272
hasAudioData = true;
7373
}
7474
} else {
75-
throw Error(`Expected TextPart but got ${JSON.stringify(part)}`);
75+
throw Error(
76+
`Expected TextPart or InlineDataPart but got ${JSON.stringify(
77+
part
78+
)}`
79+
);
7680
}
7781
});
7882
}
@@ -116,8 +120,7 @@ describe('Live', function () {
116120
);
117121
const responseData = await responsePromise;
118122
expect(responseData).to.exist;
119-
expect(responseData.hasAudioData).to.be
120-
.true;
123+
expect(responseData.hasAudioData).to.be.true;
121124
await session.close();
122125
});
123126
it('should handle multiple messages in a session', async () => {
@@ -134,17 +137,15 @@ describe('Live', function () {
134137

135138
const responsePromise1 = nextTurnData(generator);
136139
const responseData1 = await responsePromise1; // Wait for the turn to complete
137-
expect(responseData1.hasAudioData).to.be
138-
.true;
140+
expect(responseData1.hasAudioData).to.be.true;
139141

140142
await session.send(
141143
'What state is that in? Answer with the state name only.'
142144
);
143145

144146
const responsePromise2 = nextTurnData(generator);
145147
const responseData2 = await responsePromise2; // Wait for the second turn to complete
146-
expect(responseData2.hasAudioData).to.be
147-
.true;
148+
expect(responseData2.hasAudioData).to.be.true;
148149

149150
await session.close();
150151
});
@@ -187,8 +188,7 @@ describe('Live', function () {
187188
await session.sendTextRealtime('Are you an AI? Yes or No.');
188189

189190
const responseData = await responsePromise;
190-
expect(responseData.hasAudioData).to.be
191-
.true;
191+
expect(responseData.hasAudioData).to.be.true;
192192

193193
await session.close();
194194
});
@@ -209,8 +209,7 @@ describe('Live', function () {
209209
});
210210

211211
const responseData = await responsePromise;
212-
expect(responseData.hasAudioData).to.be
213-
.true;
212+
expect(responseData.hasAudioData).to.be.true;
214213

215214
await session.close();
216215
});
@@ -233,8 +232,7 @@ describe('Live', function () {
233232
]);
234233

235234
const responseData = await responsePromise;
236-
expect(responseData.hasAudioData).to.be
237-
.true;
235+
expect(responseData.hasAudioData).to.be.true;
238236

239237
await session.close();
240238
});
@@ -434,8 +432,8 @@ describe('Live', function () {
434432
// Send a message that should trigger a function call to fetchWeather
435433
await session.send('Whats the weather on June 15, 2025 in Toronto?');
436434
437-
const finalresponseData = await streamPromise;
438-
expect(finalresponseData).to.include('22'); // Should include the result of our function call
435+
const finalResponseData = await streamPromise;
436+
expect(finalResponseData).to.include('22'); // Should include the result of our function call
439437
440438
await session.close();
441439
});

0 commit comments

Comments
 (0)