Coverage for src / ai_lls_lib / providers / base.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-05-06 23:45 +0000

1""" 

2Base protocol for verification providers 

3""" 

4 

5from typing import Protocol 

6 

7from ..core.models import LineType 

8 

9 

10class VerificationProvider(Protocol): 

11 """ 

12 Protocol for phone verification providers. 

13 All providers must implement this interface. 

14 """ 

15 

16 def verify_phone(self, phone: str) -> tuple[LineType, bool]: 

17 """ 

18 Verify a phone number's line type and DNC status. 

19 

20 Args: 

21 phone: E.164 formatted phone number 

22 

23 Returns: 

24 Tuple of (line_type, is_on_dnc_list) 

25 

26 Raises: 

27 ValueError: If phone format is invalid 

28 ProviderError: For upstream provider failures (API errors, network issues) 

29 """ 

30 ...