Package com.tnsai.exceptions
Class ToolCallNotSupportedException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.tnsai.exceptions.TnsAIException
com.tnsai.exceptions.LLMException
com.tnsai.exceptions.LLMCapabilityException
com.tnsai.exceptions.ToolCallNotSupportedException
- All Implemented Interfaces:
Serializable
Exception thrown when tools are sent to an LLM model that does not support function/tool calling.
This is a specific subtype of LLMCapabilityException for the most common
capability mismatch: attempting to use tool calling with a model that doesn't support it.
Common scenarios:
- Using older Ollama models (e.g., phi, orca) that lack function calling
- Using text-only models that don't support structured tool interactions
- Unknown models where capabilities default to no tool support
The exception message includes the model name, provider, and a suggestion for compatible models.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.tnsai.exceptions.LLMException
LLMException.ErrorType -
Constructor Summary
ConstructorsConstructorDescriptionToolCallNotSupportedException(String model, String provider) Creates a ToolCallNotSupportedException.ToolCallNotSupportedException(String model, String provider, Throwable cause) Creates a ToolCallNotSupportedException with a cause. -
Method Summary
Modifier and TypeMethodDescriptionReturns the suggestion text for compatible models.Methods inherited from class com.tnsai.exceptions.LLMCapabilityException
getCapability, getProvider, streamingNotSupported, structuredOutputNotSupported, visionNotSupportedMethods 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
-
ToolCallNotSupportedException
Creates a ToolCallNotSupportedException.- Parameters:
model- the model identifierprovider- the provider name
-
ToolCallNotSupportedException
Creates a ToolCallNotSupportedException with a cause.- Parameters:
model- the model identifierprovider- the provider namecause- the underlying cause
-
-
Method Details
-
getSuggestion
Returns the suggestion text for compatible models.
-