feat: update MaxTokens handling

This commit is contained in:
CaIon committed 2025-08-07 16:15:59 +08:00
1 parent 97b8d7de9e
commit a4b02107dd
13 files changed
+18 -39

No files matched your search

+5 -2
View File
@@ -99,8 +99,11 @@ type StreamOptions struct {
IncludeUsage bool `json:"include_usage,omitempty"`
}
func (r *GeneralOpenAIRequest) GetMaxTokens() int {
return int(r.MaxTokens)
func (r *GeneralOpenAIRequest) GetMaxTokens() uint {
if r.MaxCompletionTokens != 0 {
return r.MaxCompletionTokens
}
return r.MaxTokens
}
func (r *GeneralOpenAIRequest) ParseInput() []string {