chore(api): add mypy coverage to interface

Signed-off-by: Mustafa Elbehery <melbeher@redhat.com>
This commit is contained in:
Mustafa Elbehery 2025-07-08 19:56:32 +02:00
parent 51b179e1c5
commit c67097ffeb
3 changed files with 11 additions and 10 deletions

View file

@ -171,7 +171,7 @@ class Tokenizer:
str: The decoded string.
"""
# Typecast is safe here. Tiktoken doesn't do anything list-related with the sequence.
return self.model.decode(cast(list[int], t))
return cast(str, self.model.decode(cast(list[int], t)))
@staticmethod
def _split_whitespaces_or_nonwhitespaces(s: str, max_consecutive_slice_len: int) -> Iterator[str]: