MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / UpdateModelPriceByJSONString

Function UpdateModelPriceByJSONString

setting/ratio_setting/model_ratio.go:321–330  ·  view source on GitHub ↗
(jsonStr string)

Source from the content-addressed store, hash-verified

319}
320
321func UpdateModelPriceByJSONString(jsonStr string) error {
322 modelPriceMapMutex.Lock()
323 defer modelPriceMapMutex.Unlock()
324 modelPriceMap = make(map[string]float64)
325 err := json.Unmarshal([]byte(jsonStr), &modelPriceMap)
326 if err == nil {
327 InvalidateExposedDataCache()
328 }
329 return err
330}
331
332// GetModelPrice 返回模型的价格,如果模型不存在则返回-1,false
333func GetModelPrice(name string, printErr bool) (float64, bool) {

Callers 1

updateOptionMapFunction · 0.92

Calls 1

Tested by

no test coverage detected