Closed rob-mindtrip closed 8 months ago
Good find! What would you expect the response to be? nil
probably?
Yeah, I think that would make sense.
Fantastic. If you have a moment. A failing spec would be a great contribution. The repo is a bit between ownership but this is simple enough that it'd be an easy merge
Fixed by #29
When you pass an unrecognized model name to
Tiktoken.encoding_for_model
, instead of returning nil it returns an unexpected Hash.The bug seems to have been introduced by https://github.com/IAPark/tiktoken_ruby/commit/0c1a45b46af6ed250d2eb82303594dab5dc7d813 which lets Hash#each return self if nothing is found.