-
-
Notifications
You must be signed in to change notification settings - Fork 103
Closed
Labels
Description
Describe the bug 🎯
When using the Symfony AI Platform with Gemini, a fatal error occurs if the model response contains the finish reason "STOP".
Instead of being handled gracefully, it triggers a RuntimeException:
PHP Fatal error: Uncaught Symfony\AI\Platform\Exception\RuntimeException: Unsupported finish reason "STOP".
in vendor/symfony/ai-platform/src/Bridge/Gemini/Gemini/ResultConverter.php:130
Expected behavior ✅
- No exception should be thrown in this case.
Actual behavior 🐛
- "STOP" is not supported in ResultConverter.
- This leads to a fatal error and crashes the application.
Steps to reproduce 🔄
- Call Gemini through the Symfony AI Platform with code_execution server tool enabled.
- Receive a response where finishReason = "STOP".
- The error occurs inside ResultConverter->convertChoice().
Error log 📋
Uncaught Symfony\AI\Platform\Exception\RuntimeException: Unsupported finish reason "STOP".
in vendor/symfony/ai-platform/src/Bridge/Gemini/Gemini/ResultConverter.php:130
Stack trace:
#0 ResultConverter->convertChoice()
#1 ResultConverter->convert()
#2 ResultPromise->await()
#3 Agent->call()
#4 Program->__invoke()
Environment 🌍
AI Platform version: latest (from main)
Gemini model: 2.5 Pro
PHP version: 8.4