mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-09 02:03:42 +08:00
docs: Implement a function to get completion ratio
- Implement retrieval for the completion ratio of a given model
This commit is contained in:
@@ -169,6 +169,9 @@ func UpdateCompletionRatioByJSONString(jsonStr string) error {
|
|||||||
return json.Unmarshal([]byte(jsonStr), &CompletionRatio)
|
return json.Unmarshal([]byte(jsonStr), &CompletionRatio)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetCompletionRatio returns the completion ratio of a model
|
||||||
|
//
|
||||||
|
// completion ratio is the ratio comparing to the ratio of prompt
|
||||||
func GetCompletionRatio(name string) float64 {
|
func GetCompletionRatio(name string) float64 {
|
||||||
if ratio, ok := CompletionRatio[name]; ok {
|
if ratio, ok := CompletionRatio[name]; ok {
|
||||||
return ratio
|
return ratio
|
||||||
|
|||||||
Reference in New Issue
Block a user