mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-09-22 19:36:36 +08:00
docs: update README to include support for Gemini multimodal output and add relevant images
fix: ensure nil check for content text in token counting function
This commit is contained in:
parent
000f092023
commit
4d9a4f5c85
11
README.md
11
README.md
@ -36,6 +36,7 @@ Also welcome to register and use my deployed one-api gateway, which supports var
|
||||
- [Reasoning Format - thinking](#reasoning-format---thinking)
|
||||
- [Support AWS cross-region inferences](#support-aws-cross-region-inferences)
|
||||
- [Support OpenAI web search models](#support-openai-web-search-models)
|
||||
- [Support gemini multimodal output #2197](#support-gemini-multimodal-output-2197)
|
||||
- [Bug fix](#bug-fix)
|
||||
|
||||
## Turtorial
|
||||
@ -223,6 +224,16 @@ Supports two URL parameters: `thinking` and `reasoning_format`.
|
||||
|
||||
support `gpt-4o-search-preview` & `gpt-4o-mini-search-preview`
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
### Support gemini multimodal output #2197
|
||||
|
||||
- [feature: support gemini multimodal output #2197](https://github.com/songquanpeng/one-api/pull/2197)
|
||||
|
||||

|
||||
|
||||
## Bug fix
|
||||
|
||||
- [BUGFIX: Several issues when updating tokens #1933](https://github.com/songquanpeng/one-api/pull/1933)
|
||||
|
@ -103,7 +103,9 @@ func CountTokenMessages(ctx context.Context,
|
||||
for _, content := range contents {
|
||||
switch content.Type {
|
||||
case model.ContentTypeText:
|
||||
tokenNum += getTokenNum(tokenEncoder, content.Text)
|
||||
if content.Text != nil {
|
||||
tokenNum += getTokenNum(tokenEncoder, *content.Text)
|
||||
}
|
||||
case model.ContentTypeImageURL:
|
||||
imageTokens, err := countImageTokens(
|
||||
content.ImageURL.Url,
|
||||
|
Loading…
Reference in New Issue
Block a user