java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.ai.agent.LLMException
- All Implemented Interfaces:
Serializable
Runtime exception thrown when a Large Language Model (LLM) operation fails.
This exception indicates errors during LLM processing such as:
- Communication failures with the LLM service
- Invalid or malformed responses from the LLM (truncated output, error payloads, protocol-level failures)
- Rate limiting or quota exceeded errors
- Model unavailability or timeout
- Response deserialization failures when a typed result is requested and the LLM response cannot be converted to the expected Java type
As a runtime exception, it does not require explicit handling but can be
caught by HandleException annotated methods in agent workflows.
- Since:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLLMException(String message) Constructs a new LLM exception with the specified detail message.LLMException(String message, Throwable cause) Constructs a new LLM exception with the specified detail message and cause.LLMException(Throwable cause) Constructs a new LLM exception with the specified cause and a detail message of (cause==null ? -
Method Summary
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LLMException
Constructs a new LLM exception with the specified detail message.- Parameters:
message- The detail message.
-
LLMException
Constructs a new LLM exception with the specified detail message and cause.- Parameters:
message- The detail message.cause- The cause (which is saved for later retrieval by theThrowable.getCause()method).
-
LLMException
Constructs a new LLM exception with the specified cause and a detail message of (cause==null ? null : cause.toString()).- Parameters:
cause- The cause (which is saved for later retrieval by theThrowable.getCause()method).
-