Class LLMCapabilityException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ToolCallNotSupportedException

public class LLMCapabilityException extends LLMException
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:
  • Constructor Details

    • LLMCapabilityException

      public LLMCapabilityException(String message, String model, String provider, String capability)
      Creates a capability exception.
      Parameters:
      message - human-readable error message
      model - the model identifier
      provider - 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

      public String getProvider()
      Returns the provider name.
    • getCapability

      public String getCapability()
      Returns the missing capability identifier.
    • streamingNotSupported

      public static LLMCapabilityException streamingNotSupported(String model, String provider)
      Factory for streaming not supported.
    • visionNotSupported

      public static LLMCapabilityException visionNotSupported(String model, String provider)
      Factory for vision not supported.
    • structuredOutputNotSupported

      public static LLMCapabilityException structuredOutputNotSupported(String model, String provider)
      Factory for structured output not supported.