Skip to content

Commit 89ccf1c

Browse files
[AI] Improve error messaging for LiveServerMessageSerializer (#7180)
The error message should include the actual content of the message that couldn't be de-serialized instead of class around java class names, which are not useful before de-serialization succeds. --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent f42fd56 commit 89ccf1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

firebase-ai/src/main/kotlin/com/google/firebase/ai/type/LiveServerMessage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ internal object LiveServerMessageSerializer :
183183
LiveServerToolCallCancellation.InternalWrapper.serializer()
184184
else ->
185185
throw SerializationException(
186-
"The given subclass of LiveServerMessage (${javaClass.simpleName}) is not supported in the serialization yet."
186+
"Unknown LiveServerMessage response type. Keys found: ${jsonObject.keys}"
187187
)
188188
}
189189
}

0 commit comments

Comments
 (0)