Class MessageConversionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.google.adk.models.springai.MessageConversionException
- All Implemented Interfaces:
Serializable
Exception thrown when message conversion between ADK and Spring AI formats fails.
This exception is thrown when there are issues converting between ADK's Content/Part format and Spring AI's Message/ChatResponse format, such as JSON parsing errors, invalid message structures, or unsupported content types.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMessageConversionException(String message) Constructs a new MessageConversionException with the specified detail message.MessageConversionException(String message, Throwable cause) Constructs a new MessageConversionException with the specified detail message and cause.Constructs a new MessageConversionException with the specified cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageConversionExceptioninvalidMessageStructure(String message) Creates a MessageConversionException for invalid message structure.static MessageConversionExceptionjsonParsingFailed(String context, Throwable cause) Creates a MessageConversionException for JSON parsing failures.static MessageConversionExceptionunsupportedContentType(String contentType) Creates a MessageConversionException for unsupported content type.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MessageConversionException
Constructs a new MessageConversionException with the specified detail message.- Parameters:
message- the detail message
-
MessageConversionException
-
MessageConversionException
Constructs a new MessageConversionException with the specified cause.- Parameters:
cause- the cause of the exception
-
-
Method Details
-
jsonParsingFailed
Creates a MessageConversionException for JSON parsing failures.- Parameters:
context- the context where the parsing failed (e.g., "tool call arguments")cause- the underlying JSON processing exception- Returns:
- a new MessageConversionException with appropriate message
-
invalidMessageStructure
Creates a MessageConversionException for invalid message structure.- Parameters:
message- description of the invalid structure- Returns:
- a new MessageConversionException
-
unsupportedContentType
Creates a MessageConversionException for unsupported content type.- Parameters:
contentType- the unsupported content type- Returns:
- a new MessageConversionException
-