mirror of
https://github.com/coaidev/coai.git
synced 2025-06-01 03:10:20 +09:00
feat: support gpt-4-0125-preview, gpt-4-turbo-preview, gpt-4-1106-vision-preview models
This commit is contained in:
parent
31e1eaa684
commit
59e822264b
@ -55,7 +55,10 @@ export const ChannelInfos: Record<string, ChannelInfo> = {
|
||||
"gpt-4-0314",
|
||||
"gpt-4-0613",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-vision-preview",
|
||||
"gpt-4-1106-vision-preview",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-32k-0314",
|
||||
"gpt-4-32k-0613",
|
||||
@ -84,7 +87,10 @@ export const ChannelInfos: Record<string, ChannelInfo> = {
|
||||
"gpt-4-0314",
|
||||
"gpt-4-0613",
|
||||
"gpt-4-1106-preview",
|
||||
"gpt-4-0125-preview",
|
||||
"gpt-4-turbo-preview",
|
||||
"gpt-4-vision-preview",
|
||||
"gpt-4-1106-vision-preview",
|
||||
"gpt-4-32k",
|
||||
"gpt-4-32k-0314",
|
||||
"gpt-4-32k-0613",
|
||||
|
@ -19,6 +19,9 @@ export const modelColorMapper: Record<string, string> = {
|
||||
|
||||
"gpt-4": "#8e43e7",
|
||||
"gpt-4-1106-preview": "#8e43e7",
|
||||
"gpt-4-0125-preview": "#8e43e7",
|
||||
"gpt-4-turbo-preview": "#8e43e7",
|
||||
"gpt-4-1106-vision-preview": "#8e43e7",
|
||||
"gpt-4-vision-preview": "#8e43e7",
|
||||
"gpt-4-0613": "#8e43e7",
|
||||
"gpt-4-0314": "#8e43e7",
|
||||
|
@ -1,6 +1,7 @@
|
||||
package globals
|
||||
|
||||
import (
|
||||
"chat/utils"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/url"
|
||||
"strings"
|
||||
@ -55,7 +56,10 @@ const (
|
||||
GPT40314 = "gpt-4-0314"
|
||||
GPT40613 = "gpt-4-0613"
|
||||
GPT41106Preview = "gpt-4-1106-preview"
|
||||
GPT41106VisionPreview = "gpt-4-vision-preview"
|
||||
GPT40125Preview = "gpt-4-0125-preview"
|
||||
GPT4TurboPreview = "gpt-4-turbo-preview"
|
||||
GPT4VisionPreview = "gpt-4-vision-preview"
|
||||
GPT41106VisionPreview = "gpt-4-1106-vision-preview"
|
||||
GPT432k = "gpt-4-32k"
|
||||
GPT432k0314 = "gpt-4-32k-0314"
|
||||
GPT432k0613 = "gpt-4-32k-0613"
|
||||
@ -117,6 +121,8 @@ func IsDalleModel(model string) bool {
|
||||
|
||||
func IsGPT41106VisionPreview(model string) bool {
|
||||
// enable openai image format for gpt-4-vision-preview model
|
||||
return model == GPT41106VisionPreview ||
|
||||
strings.Contains(model, GPT41106VisionPreview)
|
||||
return utils.Any(
|
||||
model == GPT41106VisionPreview || strings.Contains(model, GPT41106VisionPreview),
|
||||
model == GPT4VisionPreview || strings.Contains(model, GPT4VisionPreview),
|
||||
)
|
||||
}
|
||||
|
@ -18,7 +18,9 @@ func GetWeightByModel(model string) int {
|
||||
return 2
|
||||
case globals.GPT3Turbo, globals.GPT3Turbo0613, globals.GPT3Turbo1106,
|
||||
globals.GPT3Turbo16k, globals.GPT3Turbo16k0613,
|
||||
globals.GPT4, globals.GPT40314, globals.GPT40613, globals.GPT41106Preview, globals.GPT41106VisionPreview,
|
||||
globals.GPT4, globals.GPT40314, globals.GPT40613,
|
||||
globals.GPT41106Preview, globals.GPT4TurboPreview, globals.GPT40125Preview,
|
||||
globals.GPT4VisionPreview, globals.GPT41106VisionPreview,
|
||||
globals.GPT432k, globals.GPT432k0613, globals.GPT432k0314:
|
||||
return 3
|
||||
case globals.GPT3Turbo0301, globals.GPT3Turbo16k0301:
|
||||
|
Loading…
Reference in New Issue
Block a user