mirror of
https://github.com/coaidev/coai.git
synced 2025-05-20 21:40:15 +09:00
fix import cycle
This commit is contained in:
parent
fff9fd8b06
commit
5e9426b03e
@ -1,7 +1,6 @@
|
|||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"chat/adapter/zhipuai"
|
|
||||||
"chat/globals"
|
"chat/globals"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/pkoukk/tiktoken-go"
|
"github.com/pkoukk/tiktoken-go"
|
||||||
@ -115,9 +114,9 @@ func CountInputToken(model string, v []globals.Message) float32 {
|
|||||||
return 0
|
return 0
|
||||||
case globals.Claude2100k:
|
case globals.Claude2100k:
|
||||||
return float32(CountTokenPrice(v, model)) / 1000 * 0.008
|
return float32(CountTokenPrice(v, model)) / 1000 * 0.008
|
||||||
case zhipuai.ChatGLMPro:
|
case globals.ZhiPuChatGLMPro:
|
||||||
return float32(CountTokenPrice(v, model)) / 1000 * 0.1
|
return float32(CountTokenPrice(v, model)) / 1000 * 0.1
|
||||||
case zhipuai.ChatGLMStd:
|
case globals.ZhiPuChatGLMStd:
|
||||||
return float32(CountTokenPrice(v, model)) / 1000 * 0.05
|
return float32(CountTokenPrice(v, model)) / 1000 * 0.05
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
@ -140,9 +139,9 @@ func CountOutputToken(model string, t int) float32 {
|
|||||||
return 0
|
return 0
|
||||||
case globals.Claude2100k:
|
case globals.Claude2100k:
|
||||||
return float32(t*GetWeightByModel(model)) / 1000 * 0.008
|
return float32(t*GetWeightByModel(model)) / 1000 * 0.008
|
||||||
case zhipuai.ChatGLMPro:
|
case globals.ZhiPuChatGLMPro:
|
||||||
return float32(t*GetWeightByModel(model)) / 1000 * 0.1
|
return float32(t*GetWeightByModel(model)) / 1000 * 0.1
|
||||||
case zhipuai.ChatGLMStd:
|
case globals.ZhiPuChatGLMStd:
|
||||||
return float32(t*GetWeightByModel(model)) / 1000 * 0.05
|
return float32(t*GetWeightByModel(model)) / 1000 * 0.05
|
||||||
default:
|
default:
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
Reference in New Issue
Block a user