-
Notifications
You must be signed in to change notification settings - Fork 62
Description
Description:
This is a client library issue related to Jackson's StreamReadConstraints limiting audio response processing.
Environment details
- Programming language: Java/Kotlin
- OS: macOS/Linux/Windows (affects all platforms)
- Language runtime version: Java 17+
- Package version: com.google.genai:google-genai:1.10.0
Steps to reproduce
- Use the SDK to call generateContentStream() with audio response modality
- Provide text input that generates audio responses larger than ~20MB
- Observe StreamConstraintsException thrown by Jackson
Expected Behavior:
The SDK should handle audio responses of any reasonable size, as audio generation commonly produces responses larger than 20MB.
Actual Behavior:
The SDK fails with:
com.fasterxml.jackson.core.exc.StreamConstraintsException: String value length (20048112) exceeds the maximum allowed (20000000, from
StreamReadConstraints.getMaxStringLength())
at com.google.genai.JsonSerializable.stringToJsonNode(JsonSerializable.java:146)
Additional Context:
Audio generation is a standard use case for the Gemini API, and the 20MB limit makes the SDK unusable for this purpose. The limit should be removed or significantly increased
for audio responses.