fix(openai): handle reasoning_effort (#11868)

This commit is contained in:
Michael Yang
2025-08-12 11:02:01 -07:00
committed by GitHub
parent 8f4ec9ab28
commit d0cf6c8281
4 changed files with 23 additions and 20 deletions

View File

@@ -44,8 +44,8 @@ func chatPrompt(ctx context.Context, m *Model, tokenize tokenizeFunc, opts *api.
thinkVal := false
thinkLevel := ""
if think != nil {
thinkVal = think.AsBool()
thinkLevel = think.AsString()
thinkVal = think.Bool()
thinkLevel = think.String()
}
var b bytes.Buffer
if err := m.Template.Execute(&b, template.Values{Messages: append(system, msgs[i:]...), Tools: tools, Think: thinkVal, ThinkLevel: thinkLevel, IsThinkSet: think != nil}); err != nil {
@@ -105,8 +105,8 @@ func chatPrompt(ctx context.Context, m *Model, tokenize tokenizeFunc, opts *api.
thinkVal := false
thinkLevel := ""
if think != nil {
thinkVal = think.AsBool()
thinkLevel = think.AsString()
thinkVal = think.Bool()
thinkLevel = think.String()
}
if err := m.Template.Execute(&b, template.Values{Messages: append(system, msgs[currMsgIdx:]...), Tools: tools, Think: thinkVal, ThinkLevel: thinkLevel, IsThinkSet: think != nil}); err != nil {
return "", nil, err