(jsonStr string)
| 351 | } |
| 352 | |
| 353 | func UpdateModelRatioByJSONString(jsonStr string) error { |
| 354 | modelRatioMapMutex.Lock() |
| 355 | defer modelRatioMapMutex.Unlock() |
| 356 | modelRatioMap = make(map[string]float64) |
| 357 | err := json.Unmarshal([]byte(jsonStr), &modelRatioMap) |
| 358 | if err == nil { |
| 359 | InvalidateExposedDataCache() |
| 360 | } |
| 361 | return err |
| 362 | } |
| 363 | |
| 364 | // 处理带有思考预算的模型名称,方便统一定价 |
| 365 | func handleThinkingBudgetModel(name, prefix, wildcard string) string { |
no test coverage detected