Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
1b91d4dd
Commit
1b91d4dd
authored
Oct 08, 2025
by
Patrick Devine
Browse files
openai: change the reasonin_effort field to also take none
parent
7d965258
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
openai/openai.go
openai/openai.go
+12
-6
No files found.
openai/openai.go
View file @
1b91d4dd
...
@@ -567,18 +567,24 @@ func FromChatRequest(r ChatCompletionRequest) (*api.ChatRequest, error) {
...
@@ -567,18 +567,24 @@ func FromChatRequest(r ChatCompletionRequest) (*api.ChatRequest, error) {
}
}
var
think
*
api
.
ThinkValue
var
think
*
api
.
ThinkValue
var
effort
string
if
r
.
Reasoning
!=
nil
{
if
r
.
Reasoning
!=
nil
{
if
!
slices
.
Contains
([]
string
{
"high"
,
"medium"
,
"low"
,
"none"
},
r
.
Reasoning
.
Effort
)
{
effort
=
r
.
Reasoning
.
Effort
return
nil
,
fmt
.
Errorf
(
"invalid reasoning value: '%s' (must be
\"
high
\"
,
\"
medium
\"
,
\"
low
\"
, or
\"
none
\"
)"
,
r
.
Reasoning
.
Effort
)
}
else
if
r
.
ReasoningEffort
!=
nil
{
effort
=
*
r
.
ReasoningEffort
}
if
effort
!=
""
{
if
!
slices
.
Contains
([]
string
{
"high"
,
"medium"
,
"low"
,
"none"
},
effort
)
{
return
nil
,
fmt
.
Errorf
(
"invalid reasoning value: '%s' (must be
\"
high
\"
,
\"
medium
\"
,
\"
low
\"
, or
\"
none
\"
)"
,
effort
)
}
}
if
r
.
Reasoning
.
E
ffort
==
"none"
{
if
e
ffort
==
"none"
{
think
=
&
api
.
ThinkValue
{
Value
:
false
}
think
=
&
api
.
ThinkValue
{
Value
:
false
}
}
else
{
}
else
{
think
=
&
api
.
ThinkValue
{
Value
:
r
.
Reasoning
.
E
ffort
}
think
=
&
api
.
ThinkValue
{
Value
:
e
ffort
}
}
}
}
else
if
r
.
ReasoningEffort
!=
nil
{
think
=
&
api
.
ThinkValue
{
Value
:
*
r
.
ReasoningEffort
}
}
}
return
&
api
.
ChatRequest
{
return
&
api
.
ChatRequest
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment