Skip to content

Commit ee2878d

Browse files
committed
feat: gpt-5 support (#377)
1 parent e19f5da commit ee2878d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adapter/openai/chat.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"errors"
88
"fmt"
99
"regexp"
10+
"strings"
1011
)
1112

1213
func (c *ChatInstance) GetChatEndpoint(props *adaptercommon.ChatProps) string {
@@ -45,8 +46,8 @@ func (c *ChatInstance) GetChatBody(props *adaptercommon.ChatProps, stream bool)
4546

4647
messages := formatMessages(props)
4748

48-
// o1, o3 compatibility
49-
isNewModel := len(props.Model) >= 2 && (props.Model[:2] == "o1" || props.Model[:2] == "o3")
49+
// o1, o3, gpt-5 compatibility
50+
isNewModel := len(props.Model) >= 2 && (props.Model[:2] == "o1" || props.Model[:2] == "o3") || strings.HasPrefix(props.Model, "gpt-5")
5051

5152
var temperature *float32
5253
if isNewModel {

0 commit comments

Comments
 (0)