|
@@ -23,10 +23,11 @@ const (
|
|
|
|
|
|
|
|
var defaultModelRatio = map[string]float64{
|
|
var defaultModelRatio = map[string]float64{
|
|
|
//"midjourney": 50,
|
|
//"midjourney": 50,
|
|
|
- "gpt-4-gizmo-*": 15,
|
|
|
|
|
- "gpt-4-all": 15,
|
|
|
|
|
- "gpt-4o-all": 15,
|
|
|
|
|
- "gpt-4": 15,
|
|
|
|
|
|
|
+ "gpt-4-gizmo-*": 15,
|
|
|
|
|
+ "gpt-4o-gizmo-*": 2.5,
|
|
|
|
|
+ "gpt-4-all": 15,
|
|
|
|
|
+ "gpt-4o-all": 15,
|
|
|
|
|
+ "gpt-4": 15,
|
|
|
//"gpt-4-0314": 15, //deprecated
|
|
//"gpt-4-0314": 15, //deprecated
|
|
|
"gpt-4-0613": 15,
|
|
"gpt-4-0613": 15,
|
|
|
"gpt-4-32k": 30,
|
|
"gpt-4-32k": 30,
|
|
@@ -187,8 +188,8 @@ var defaultModelPrice = map[string]float64{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var (
|
|
var (
|
|
|
- modelPriceMap = make(map[string]float64)
|
|
|
|
|
- modelPriceMapMutex = sync.RWMutex{}
|
|
|
|
|
|
|
+ modelPriceMap map[string]float64 = nil
|
|
|
|
|
+ modelPriceMapMutex = sync.RWMutex{}
|
|
|
)
|
|
)
|
|
|
var (
|
|
var (
|
|
|
modelRatioMap map[string]float64 = nil
|
|
modelRatioMap map[string]float64 = nil
|
|
@@ -197,8 +198,9 @@ var (
|
|
|
|
|
|
|
|
var CompletionRatio map[string]float64 = nil
|
|
var CompletionRatio map[string]float64 = nil
|
|
|
var defaultCompletionRatio = map[string]float64{
|
|
var defaultCompletionRatio = map[string]float64{
|
|
|
- "gpt-4-gizmo-*": 2,
|
|
|
|
|
- "gpt-4-all": 2,
|
|
|
|
|
|
|
+ "gpt-4-gizmo-*": 2,
|
|
|
|
|
+ "gpt-4o-gizmo-*": 3,
|
|
|
|
|
+ "gpt-4-all": 2,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func GetModelPriceMap() map[string]float64 {
|
|
func GetModelPriceMap() map[string]float64 {
|
|
@@ -232,6 +234,9 @@ func GetModelPrice(name string, printErr bool) (float64, bool) {
|
|
|
if strings.HasPrefix(name, "gpt-4-gizmo") {
|
|
if strings.HasPrefix(name, "gpt-4-gizmo") {
|
|
|
name = "gpt-4-gizmo-*"
|
|
name = "gpt-4-gizmo-*"
|
|
|
}
|
|
}
|
|
|
|
|
+ if strings.HasPrefix(name, "gpt-4o-gizmo") {
|
|
|
|
|
+ name = "gpt-4o-gizmo-*"
|
|
|
|
|
+ }
|
|
|
price, ok := modelPriceMap[name]
|
|
price, ok := modelPriceMap[name]
|
|
|
if !ok {
|
|
if !ok {
|
|
|
if printErr {
|
|
if printErr {
|
|
@@ -312,6 +317,9 @@ func GetCompletionRatio(name string) float64 {
|
|
|
if strings.HasPrefix(name, "gpt-4-gizmo") {
|
|
if strings.HasPrefix(name, "gpt-4-gizmo") {
|
|
|
name = "gpt-4-gizmo-*"
|
|
name = "gpt-4-gizmo-*"
|
|
|
}
|
|
}
|
|
|
|
|
+ if strings.HasPrefix(name, "gpt-4o-gizmo") {
|
|
|
|
|
+ name = "gpt-4o-gizmo-*"
|
|
|
|
|
+ }
|
|
|
if strings.HasPrefix(name, "gpt-3.5") {
|
|
if strings.HasPrefix(name, "gpt-3.5") {
|
|
|
if name == "gpt-3.5-turbo" || strings.HasSuffix(name, "0125") {
|
|
if name == "gpt-3.5-turbo" || strings.HasSuffix(name, "0125") {
|
|
|
// https://openai.com/blog/new-embedding-models-and-api-updates
|
|
// https://openai.com/blog/new-embedding-models-and-api-updates
|