litellm
litellm copied to clipboard
Convert tool use arguments to string before counting tokens
Convert tool use arguments to string before counting tokens
Relevant issues
Fixes #6958
Type
🐛 Bug Fix
Changes
In at least some cases the messages["tool_calls"]["function"]["arguments"] is a dict, not a string. In order to tokenize it properly it needs to be a string. In the case that it is already a string this is a noop, which is also fine.
Testing
I'm not sure how to prove that this works, but I'm happy to provide some proof if you suggest how to do that.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| litellm | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 2, 2024 10:49pm |