Currently, when you pass an unrecognized model name to Tiktoken.encoding_for_model, instead of returning nil it returns an unexpected Hash, making it more difficult to detect whether the encoding is available. This seems to have been introduced by 0c1a45b46a
This pull request addresses issue #28.
Currently, when you pass an unrecognized model name to
Tiktoken.encoding_for_model
, instead of returning nil it returns an unexpected Hash, making it more difficult to detect whether the encoding is available. This seems to have been introduced by 0c1a45b46aAdded a simple spec to confirm.