Package org.a2aproject.sdk.spec
Class ContentTypeNotSupportedError
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.a2aproject.sdk.spec.A2AError
org.a2aproject.sdk.spec.A2AProtocolError
org.a2aproject.sdk.spec.ContentTypeNotSupportedError
- All Implemented Interfaces:
Serializable,Event
A2A Protocol error indicating incompatibility between requested content types and agent capabilities.
This error is returned when the input or output modes requested by a client are not supported
by the agent. Agents declare their supported content types via AgentCard.defaultInputModes()
and AgentCard.defaultOutputModes(), and clients can request specific modes via
MessageSendConfiguration.
Common scenarios:
- Client requests audio input but agent only supports text
- Client requires video output but agent only produces text and images
- Incompatible combinations of input and output modes
Corresponds to A2A-specific error code -32005.
Usage example:
if (!agentCard.defaultInputModes().contains(requestedInputMode)) {
throw new ContentTypeNotSupportedError(
null,
"Input mode " + requestedInputMode + " not supported",
null
);
}
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.a2aproject.sdk.spec.A2AError
getCode, getDetailsMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
ContentTypeNotSupportedError
public ContentTypeNotSupportedError() -
ContentTypeNotSupportedError
public ContentTypeNotSupportedError(@Nullable Integer code, @Nullable String message, @Nullable Map<String, Object> details) Constructs a content type not supported error.- Parameters:
code- the error codemessage- the error messagedetails- additional error details
-