mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-13 03:43:44 +08:00
refactor: add GetRatio to Adaptor
This commit is contained in:
@@ -1,14 +1,19 @@
|
||||
package cohere
|
||||
|
||||
var ModelList = []string{
|
||||
"command", "command-nightly",
|
||||
"command-light", "command-light-nightly",
|
||||
"command-r", "command-r-plus",
|
||||
}
|
||||
import "github.com/songquanpeng/one-api/relay/billing/ratio"
|
||||
|
||||
func init() {
|
||||
num := len(ModelList)
|
||||
for i := 0; i < num; i++ {
|
||||
ModelList = append(ModelList, ModelList[i]+"-internet")
|
||||
}
|
||||
// https://cohere.com/pricing
|
||||
var RatioMap = map[string]ratio.Ratio{
|
||||
"command": {Input: 1 * ratio.MILLI_USD, Output: 2 * ratio.MILLI_USD},
|
||||
"command-internet": {Input: 1 * ratio.MILLI_USD, Output: 2 * ratio.MILLI_USD},
|
||||
"command-nightly": {Input: 1 * ratio.MILLI_USD, Output: 2 * ratio.MILLI_USD},
|
||||
"command-nightly-internet": {Input: 1 * ratio.MILLI_USD, Output: 2 * ratio.MILLI_USD},
|
||||
"command-light": {Input: 0.3 * ratio.MILLI_USD, Output: 0.6 * ratio.MILLI_USD},
|
||||
"command-light-internet": {Input: 0.3 * ratio.MILLI_USD, Output: 0.6 * ratio.MILLI_USD},
|
||||
"command-light-nightly": {Input: 0.3 * ratio.MILLI_USD, Output: 0.6 * ratio.MILLI_USD},
|
||||
"command-light-nightly-internet": {Input: 0.3 * ratio.MILLI_USD, Output: 0.6 * ratio.MILLI_USD},
|
||||
"command-r": {Input: 0.15 * ratio.MILLI_USD, Output: 0.6 * ratio.MILLI_USD},
|
||||
"command-r-internet": {Input: 0.15 * ratio.MILLI_USD, Output: 0.6 * ratio.MILLI_USD},
|
||||
"command-r-plus": {Input: 2.5 * ratio.MILLI_USD, Output: 10 * ratio.MILLI_USD},
|
||||
"command-r-plus-internet": {Input: 2.5 * ratio.MILLI_USD, Output: 10 * ratio.MILLI_USD},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user