mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 07:56:38 +08:00
feat: format o1 model max tokens param
This commit is contained in:
parent
cb73889353
commit
13c993d87e
@ -78,6 +78,12 @@ func (a *Adaptor) ConvertRequest(c *gin.Context, info *relaycommon.RelayInfo, re
|
|||||||
if info.ChannelType != common.ChannelTypeOpenAI {
|
if info.ChannelType != common.ChannelTypeOpenAI {
|
||||||
request.StreamOptions = nil
|
request.StreamOptions = nil
|
||||||
}
|
}
|
||||||
|
if strings.HasPrefix(request.Model, "o1-") {
|
||||||
|
if request.MaxCompletionTokens == 0 && request.MaxTokens != 0 {
|
||||||
|
request.MaxCompletionTokens = request.MaxTokens
|
||||||
|
request.MaxTokens = 0
|
||||||
|
}
|
||||||
|
}
|
||||||
return request, nil
|
return request, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user