feat: add midjourney price log

This commit is contained in:
CaIon
2024-01-25 14:56:49 +08:00
parent 705171e495
commit a3921ea54d
3 changed files with 6 additions and 4 deletions

View File

@@ -103,13 +103,15 @@ func UpdateModelPriceByJSONString(jsonStr string) error {
return json.Unmarshal([]byte(jsonStr), &ModelPrice)
}
func GetModelPrice(name string) float64 {
func GetModelPrice(name string, printErr bool) float64 {
if strings.HasPrefix(name, "gpt-4-gizmo") {
name = "gpt-4-gizmo-*"
}
price, ok := ModelPrice[name]
if !ok {
//SysError("model price not found: " + name)
if printErr {
SysError("model price not found: " + name)
}
return -1
}
return price