exc.py 932 B

1234567891011121314151617181920212223242526272829303132333435
  1. class LLMNodeError(ValueError):
  2. """Base class for LLM Node errors."""
  3. class VariableNotFoundError(LLMNodeError):
  4. """Raised when a required variable is not found."""
  5. class InvalidContextStructureError(LLMNodeError):
  6. """Raised when the context structure is invalid."""
  7. class InvalidVariableTypeError(LLMNodeError):
  8. """Raised when the variable type is invalid."""
  9. class ModelNotExistError(LLMNodeError):
  10. """Raised when the specified model does not exist."""
  11. class LLMModeRequiredError(LLMNodeError):
  12. """Raised when LLM mode is required but not provided."""
  13. class NoPromptFoundError(LLMNodeError):
  14. """Raised when no prompt is found in the LLM configuration."""
  15. class NotSupportedPromptTypeError(LLMNodeError):
  16. """Raised when the prompt type is not supported."""
  17. class MemoryRolePrefixRequiredError(LLMNodeError):
  18. """Raised when memory role prefix is required for completion model."""