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
..
billing.go chore: update error code 2023-09-17 11:30:20 +08:00
channel-billing.go fix: fix unable to set zero value for base url & model mapping 2023-09-18 22:07:17 +08:00
channel-test.go fix: fix Cloudflare AI Gateway channel test support (#639) 2023-11-05 19:08:25 +08:00
channel.go feat: able to delete all disabled channels 2023-10-14 17:25:48 +08:00
github.go fix: fix oauth2 state not checking 2023-09-15 00:24:20 +08:00
group.go feat: Refactor message handling and update dependencies 2023-11-17 03:24:55 +00:00
log.go feat: supprt channel priority now & record channel id in log (#484) 2023-09-17 19:18:16 +08:00
misc.go feat: support email domain whitelist (#337) 2023-07-30 12:44:41 +08:00
model.go feat: sync pricing for new 1106 models (#696) 2023-11-10 21:08:23 +08:00
option.go feat: support Tencent's model (close #519) 2023-10-03 14:19:03 +08:00
redemption.go feat: now user can top up via redemption code (close #9) 2023-04-26 17:02:26 +08:00
relay_test.go feat: Refactor message handling and update dependencies 2023-11-17 03:24:55 +00:00
relay-aiproxy.go feat: Refactor message handling and update dependencies 2023-11-17 03:24:55 +00:00
relay-ali.go feat: support vision 2023-11-17 01:59:11 +00:00
relay-audio.go feat: add cloudflare ai gateway support for image & audio (#607) 2023-10-22 17:50:52 +08:00
relay-baidu.go feat: support vision 2023-11-17 01:59:11 +00:00
relay-claude.go feat: support vision 2023-11-17 01:59:11 +00:00
relay-image.go feat: add cloudflare ai gateway support for image & audio (#607) 2023-10-22 17:50:52 +08:00
relay-openai.go refactor: add set event stream headers func (#402) 2023-08-12 21:55:18 +08:00
relay-palm.go feat: support vision 2023-11-17 01:59:11 +00:00
relay-tencent.go feat: support vision 2023-11-17 01:59:11 +00:00
relay-text.go feat: Add token counting functionality to vision-related functions 2023-11-17 04:00:49 +00:00
relay-utils.go feat: Add token counting functionality to vision-related functions 2023-11-17 04:00:49 +00:00
relay-xunfei.go feat: support vision 2023-11-17 01:59:11 +00:00
relay-zhipu.go feat: support vision 2023-11-17 01:59:11 +00:00
relay.go feat: Add token counting functionality to vision-related functions 2023-11-17 04:00:49 +00:00
token.go refactor: Refactor token handling in the controller 2023-11-16 05:24:56 +00:00
user.go feat: Implement API endpoints for user management and information retrieval 2023-10-19 09:42:47 +00:00
wechat.go feat: support aff now (close #75) 2023-06-17 18:12:58 +08:00