Skip to content

Commit

Permalink
Handle MALFORMED_FUNCTION_CALL in google gemini api (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshvfleming authored Dec 4, 2024
1 parent 0624131 commit 044b3d0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ax/ai/google-gemini/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,11 @@ export class AxAIGoogleGemini extends AxBaseAI<
throw new Error('Finish reason: SAFETY');
case 'RECITATION':
throw new Error('Finish reason: RECITATION');
case 'MALFORMED_FUNCTION_CALL':
throw new Error('Finish reason: MALFORMED_FUNCTION_CALL');
}

if (!candidate.content.parts) {
if (!candidate.content || !candidate.content.parts) {
return result;
}

Expand Down

0 comments on commit 044b3d0

Please sign in to comment.