mirror of
https://github.com/coaidev/coai.git
synced 2025-05-23 06:50:14 +09:00
init v3
This commit is contained in:
parent
ca2f0c347b
commit
51f025b0f4
@ -89,7 +89,6 @@ func NativeStreamRequest(model string, endpoint string, apikeys string, messages
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
defer res.Body.Close()
|
defer res.Body.Close()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
buf := make([]byte, 20480)
|
buf := make([]byte, 20480)
|
||||||
n, err := res.Body.Read(buf)
|
n, err := res.Body.Read(buf)
|
||||||
|
@ -36,7 +36,7 @@ func CountInputToken(model string, v []types.ChatGPTMessage) float32 {
|
|||||||
case types.GPT4:
|
case types.GPT4:
|
||||||
return float32(utils.CountTokenPrice(v, model)) / 1000 * 2.1
|
return float32(utils.CountTokenPrice(v, model)) / 1000 * 2.1
|
||||||
case types.GPT432k:
|
case types.GPT432k:
|
||||||
return float32(utils.CountTokenPrice(v, model)) / 1000 * 2.1 * 2
|
return float32(utils.CountTokenPrice(v, model)) / 1000 * 4.2
|
||||||
case types.Claude2, types.Claude2100k:
|
case types.Claude2, types.Claude2100k:
|
||||||
return 0
|
return 0
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user