mirror of
https://github.com/coaidev/coai.git
synced 2025-06-03 20:30:19 +09:00
feat: add gpt-4-turbo
gemini-1.5-pro-latest
gemini-1.5-flash-latest
model (merge pr #198 @XiaomaiTX)
feat: add `gpt-4-turbo` `gemini-1.5-pro-latest` `gemini-1.5-flash-latest` model
This commit is contained in:
commit
907362a9aa
@ -109,6 +109,8 @@ export const ChannelInfos: Record<string, ChannelInfo> = {
|
|||||||
"gpt-4-turbo-preview",
|
"gpt-4-turbo-preview",
|
||||||
"gpt-4-vision-preview",
|
"gpt-4-vision-preview",
|
||||||
"gpt-4-1106-vision-preview",
|
"gpt-4-1106-vision-preview",
|
||||||
|
"gpt-4-turbo",
|
||||||
|
"gpt-4-turbo-2024-04-09",
|
||||||
"gpt-4-32k",
|
"gpt-4-32k",
|
||||||
"gpt-4-32k-0314",
|
"gpt-4-32k-0314",
|
||||||
"gpt-4-32k-0613",
|
"gpt-4-32k-0613",
|
||||||
@ -144,6 +146,8 @@ export const ChannelInfos: Record<string, ChannelInfo> = {
|
|||||||
"gpt-4-turbo-preview",
|
"gpt-4-turbo-preview",
|
||||||
"gpt-4-vision-preview",
|
"gpt-4-vision-preview",
|
||||||
"gpt-4-1106-vision-preview",
|
"gpt-4-1106-vision-preview",
|
||||||
|
"gpt-4-turbo",
|
||||||
|
"gpt-4-turbo-2024-04-09",
|
||||||
"gpt-4-32k",
|
"gpt-4-32k",
|
||||||
"gpt-4-32k-0314",
|
"gpt-4-32k-0314",
|
||||||
"gpt-4-32k-0613",
|
"gpt-4-32k-0613",
|
||||||
@ -240,7 +244,13 @@ export const ChannelInfos: Record<string, ChannelInfo> = {
|
|||||||
palm: {
|
palm: {
|
||||||
endpoint: "https://generativelanguage.googleapis.com",
|
endpoint: "https://generativelanguage.googleapis.com",
|
||||||
format: "<api-key>",
|
format: "<api-key>",
|
||||||
models: ["chat-bison-001", "gemini-pro", "gemini-pro-vision"],
|
models: [
|
||||||
|
"chat-bison-001",
|
||||||
|
"gemini-pro",
|
||||||
|
"gemini-pro-vision",
|
||||||
|
"gemini-1.5-pro-latest",
|
||||||
|
"gemini-1.5-flash-latest",
|
||||||
|
],
|
||||||
description:
|
description:
|
||||||
"> Google Gemini / PaLM2 密钥格式为 **api-key**,接入点填写 *https://generativelanguage.googleapis.com* 或其反代地址 \n" +
|
"> Google Gemini / PaLM2 密钥格式为 **api-key**,接入点填写 *https://generativelanguage.googleapis.com* 或其反代地址 \n" +
|
||||||
"> Google 对请求 IP 地域有限制,可能出现 **User Location Is Not Supported** 的错误,可以看运气通过反代解决。 \n" +
|
"> Google 对请求 IP 地域有限制,可能出现 **User Location Is Not Supported** 的错误,可以看运气通过反代解决。 \n" +
|
||||||
|
@ -23,6 +23,8 @@ export const modelColorMapper: Record<string, string> = {
|
|||||||
"gpt-4-turbo-preview": "purple-600",
|
"gpt-4-turbo-preview": "purple-600",
|
||||||
"gpt-4-1106-vision-preview": "purple-600",
|
"gpt-4-1106-vision-preview": "purple-600",
|
||||||
"gpt-4-vision-preview": "purple-600",
|
"gpt-4-vision-preview": "purple-600",
|
||||||
|
"gpt-4-turbo": "purple-600",
|
||||||
|
"gpt-4-turbo-2024-04-09": "purple-600",
|
||||||
"gpt-4-0613": "purple-600",
|
"gpt-4-0613": "purple-600",
|
||||||
"gpt-4-0314": "purple-600",
|
"gpt-4-0314": "purple-600",
|
||||||
"gpt-4-all": "purple-600",
|
"gpt-4-all": "purple-600",
|
||||||
@ -63,6 +65,8 @@ export const modelColorMapper: Record<string, string> = {
|
|||||||
"chat-bison-001": "red-500",
|
"chat-bison-001": "red-500",
|
||||||
"gemini-pro": "red-500",
|
"gemini-pro": "red-500",
|
||||||
"gemini-pro-vision": "red-500",
|
"gemini-pro-vision": "red-500",
|
||||||
|
"gemini-1.5-pro-latest": "red-500",
|
||||||
|
"gemini-1.5-flash-latest": "red-500",
|
||||||
|
|
||||||
"bing-creative": "blue-700",
|
"bing-creative": "blue-700",
|
||||||
"bing-balanced": "blue-700",
|
"bing-balanced": "blue-700",
|
||||||
|
@ -62,6 +62,8 @@ export const pricing: PricingDataset = [
|
|||||||
"gpt-4-turbo-preview",
|
"gpt-4-turbo-preview",
|
||||||
"gpt-4-1106-vision-preview",
|
"gpt-4-1106-vision-preview",
|
||||||
"gpt-4-vision-preview",
|
"gpt-4-vision-preview",
|
||||||
|
"gpt-4-turbo",
|
||||||
|
"gpt-4-turbo-2024-04-09",
|
||||||
],
|
],
|
||||||
input: 0.01,
|
input: 0.01,
|
||||||
output: 0.03,
|
output: 0.03,
|
||||||
@ -212,7 +214,12 @@ export const pricing: PricingDataset = [
|
|||||||
output: 0.001,
|
output: 0.001,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
models: ["gemini-pro", "gemini-pro-vision"],
|
models: [
|
||||||
|
"gemini-pro",
|
||||||
|
"gemini-pro-vision",
|
||||||
|
"gemini-1.5-pro-latest",
|
||||||
|
"gemini-1.5-flash-latest",
|
||||||
|
],
|
||||||
input: 0.000125,
|
input: 0.000125,
|
||||||
output: 0.000375,
|
output: 0.000375,
|
||||||
},
|
},
|
||||||
|
@ -86,6 +86,8 @@ const (
|
|||||||
GPT40125Preview = "gpt-4-0125-preview"
|
GPT40125Preview = "gpt-4-0125-preview"
|
||||||
GPT4TurboPreview = "gpt-4-turbo-preview"
|
GPT4TurboPreview = "gpt-4-turbo-preview"
|
||||||
GPT4VisionPreview = "gpt-4-vision-preview"
|
GPT4VisionPreview = "gpt-4-vision-preview"
|
||||||
|
GPT4Turbo = "gpt-4-turbo"
|
||||||
|
GPT4Turbo20240409 = "gpt-4-turbo-2024-04-09"
|
||||||
GPT41106VisionPreview = "gpt-4-1106-vision-preview"
|
GPT41106VisionPreview = "gpt-4-1106-vision-preview"
|
||||||
GPT432k = "gpt-4-32k"
|
GPT432k = "gpt-4-32k"
|
||||||
GPT432k0314 = "gpt-4-32k-0314"
|
GPT432k0314 = "gpt-4-32k-0314"
|
||||||
@ -109,6 +111,8 @@ const (
|
|||||||
ChatBison001 = "chat-bison-001"
|
ChatBison001 = "chat-bison-001"
|
||||||
GeminiPro = "gemini-pro"
|
GeminiPro = "gemini-pro"
|
||||||
GeminiProVision = "gemini-pro-vision"
|
GeminiProVision = "gemini-pro-vision"
|
||||||
|
Gemini15ProLatest = "gemini-1.5-pro-latest"
|
||||||
|
Gemini15FlashLatest = "gemini-1.5-flash-latest"
|
||||||
BingCreative = "bing-creative"
|
BingCreative = "bing-creative"
|
||||||
BingBalanced = "bing-balanced"
|
BingBalanced = "bing-balanced"
|
||||||
BingPrecise = "bing-precise"
|
BingPrecise = "bing-precise"
|
||||||
@ -140,12 +144,16 @@ var OpenAIDalleModels = []string{
|
|||||||
}
|
}
|
||||||
|
|
||||||
var VisionModels = []string{
|
var VisionModels = []string{
|
||||||
GPT4VisionPreview, GPT41106VisionPreview, GPT4O, GPT4O20240513, // openai
|
GPT4VisionPreview, GPT41106VisionPreview, GPT4Turbo, GPT4Turbo20240409, GPT4O, GPT4O20240513, // openai
|
||||||
GeminiProVision, // gemini
|
GeminiProVision, Gemini15ProLatest, Gemini15FlashLatest, // gemini
|
||||||
Claude3, // anthropic
|
Claude3, // anthropic
|
||||||
ZhiPuChatGLM4Vision, // chatglm
|
ZhiPuChatGLM4Vision, // chatglm
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var VisionSkipModels = []string{
|
||||||
|
GPT4TurboPreview,
|
||||||
|
}
|
||||||
|
|
||||||
func in(value string, slice []string) bool {
|
func in(value string, slice []string) bool {
|
||||||
for _, item := range slice {
|
for _, item := range slice {
|
||||||
if item == value || strings.Contains(value, item) {
|
if item == value || strings.Contains(value, item) {
|
||||||
@ -161,5 +169,6 @@ func IsOpenAIDalleModel(model string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsVisionModel(model string) bool {
|
func IsVisionModel(model string) bool {
|
||||||
return in(model, VisionModels)
|
return in(model, VisionModels) && !in(model, VisionSkipModels)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user