Package com.tnsai.exceptions
Class LLMCapabilityException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.exceptions.LLMException
com.tnsai.exceptions.LLMCapabilityException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ToolCallNotSupportedException
Exception thrown when an LLM model lacks a required capability.
This is the base exception for capability mismatches such as:
- Model does not support tool/function calling
- Model does not support streaming
- Model does not support vision/multimodal
- Model does not support structured output
These errors are never retryable — the model simply doesn't have the capability. The user must switch to a different model.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tnsai.exceptions.LLMException
LLMException.ErrorType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the missing capability identifier.Returns the provider name.static LLMCapabilityExceptionstreamingNotSupported(String model, String provider) Factory for streaming not supported.static LLMCapabilityExceptionstructuredOutputNotSupported(String model, String provider) Factory for structured output not supported.static LLMCapabilityExceptionvisionNotSupported(String model, String provider) Factory for vision not supported.Methods inherited from class com.tnsai.exceptions.LLMException
authenticationFailed, contentFiltered, contextTooLong, getErrorType, getModel, getProviderDetails, getSuggestedRetryDelayMs, malformedToolCall, malformedToolCall, modelNotFound, modelOverloaded, serverErrorMethods inherited from class com.tnsai.exceptions.TnsAIException
getContext, getErrorCode, getMaxRetryAttempts, getMessage, getThrownAt, isRetryable, wrapMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
LLMCapabilityException
Creates a capability exception.- Parameters:
message- human-readable error messagemodel- the model identifierprovider- the provider name (e.g., "Ollama", "OpenAI")capability- the missing capability (e.g., "function_calling", "streaming", "vision")
-
LLMCapabilityException
public LLMCapabilityException(String message, Throwable cause, String model, String provider, String capability) Creates a capability exception with a cause.
-
-
Method Details
-
getProvider
Returns the provider name. -
getCapability
Returns the missing capability identifier. -
streamingNotSupported
Factory for streaming not supported. -
visionNotSupported
Factory for vision not supported. -
structuredOutputNotSupported
Factory for structured output not supported.
-