mirror of
https://github.com/langgenius/dify.git
synced 2026-11-24 20:59:04 +08:00
36 lines
889 B
Python
36 lines
889 B
Python
"""Framework-neutral knowledge hit-testing failures."""
|
|
|
|
from enums.knowledge import KnowledgeProviderFailure
|
|
|
|
|
|
class HitTestingError(Exception):
|
|
"""Base class for failures owned by the hit-testing use case."""
|
|
|
|
|
|
class HitTestingProviderError(HitTestingError):
|
|
def __init__(
|
|
self,
|
|
description: str,
|
|
*,
|
|
kind: KnowledgeProviderFailure,
|
|
) -> None:
|
|
super().__init__(description)
|
|
self.description = description
|
|
self.kind = kind
|
|
|
|
|
|
class HitTestingInvocationError(HitTestingError):
|
|
pass
|
|
|
|
|
|
class HitTestingUnsupportedInputError(HitTestingError):
|
|
"""The requested retrieval input is valid generally but unsupported by this dataset provider."""
|
|
|
|
|
|
class HitTestingUpstreamError(HitTestingError):
|
|
"""An external knowledge provider could not complete retrieval."""
|
|
|
|
|
|
class HitTestingFailedError(HitTestingError):
|
|
pass
|