Files
one-api/controller
Laisky.Cai 08ca72184a feat: Add token counting functionality to vision-related functions
- Add function `CountVisionImageToken` to count vision image tokens
- Modify function `imageSize` to handle different image types
- Add function `countVisonTokenMessages` to count tokens in vision messages
- Add logic to count tokens for different types of vision messages in `countVisonTokenMessages`
- Add tokens for role and name in `countVisonTokenMessages`
- Update total token count calculation in `countVisonTokenMessages` to include image tokens and message tokens
- Add constant values for tokens per message and tokens per name in `countVisonTokenMessages`
- Modify the error message on line 12 to include the JSON string that failed to unmarshal
2023-11-17 04:00:49 +00:00
..
2023-09-17 11:30:20 +08:00
2023-09-15 00:24:20 +08:00
2023-11-17 01:59:11 +00:00
2023-11-17 01:59:11 +00:00
2023-11-17 01:59:11 +00:00
2023-11-17 01:59:11 +00:00
2023-11-17 01:59:11 +00:00
2023-11-17 01:59:11 +00:00
2023-11-17 01:59:11 +00:00
2023-06-17 18:12:58 +08:00