Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/google-generation-failures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@livekit/agents-plugin-google': patch
---

fix(google): surface Gemini content blocking and empty generation failures
19 changes: 8 additions & 11 deletions plugins/google/src/llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -408,16 +408,13 @@ export class LLMStream extends llm.LLMStream {

if (!chunk.candidates || !chunk.candidates[0]?.content?.parts) {
this.logger.warn(`No content in the response: ${JSON.stringify(chunk)}`);
if (retryable) {
throw new APIStatusError({
message: 'Google LLM: no content in the response',
options: {
retryable: true,
requestId,
},
});
}
continue;
throw new APIStatusError({
message: 'Google LLM: no content in the response',
options: {
retryable,
requestId,
},
});
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Outdated
}

if (chunk.candidates.length > 1) {
Expand All @@ -439,7 +436,7 @@ export class LLMStream extends llm.LLMStream {
}
}

if (finishReason === 'STOP' && !chunksYielded && retryable) {
if (finishReason === 'STOP' && !chunksYielded) {
throw new APIStatusError({
message: 'Google LLM: no response generated',
options: {
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Outdated
Expand Down
Loading