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
2a9b61f0
Commit
2a9b61f0
authored
Nov 11, 2025
by
Eva Ho
Browse files
address comment
parent
9d615cda
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
20 deletions
+8
-20
app/ui/app/src/api.ts
app/ui/app/src/api.ts
+8
-1
app/ui/ui.go
app/ui/ui.go
+0
-19
No files found.
app/ui/app/src/api.ts
View file @
2a9b61f0
...
@@ -205,6 +205,13 @@ export async function* sendMessage(
...
@@ -205,6 +205,13 @@ export async function* sendMessage(
data
:
uint8ArrayToBase64
(
att
.
data
),
data
:
uint8ArrayToBase64
(
att
.
data
),
}));
}));
// Only send think parameter when actually requesting thinking
// Don't send false as it causes issues with some providers
const
shouldSendThink
=
think
!==
undefined
&&
((
typeof
think
===
"
boolean
"
&&
think
)
||
(
typeof
think
===
"
string
"
&&
think
!==
""
));
const
response
=
await
fetch
(
`
${
API_BASE
}
/api/v1/chat/
${
chatId
}
`
,
{
const
response
=
await
fetch
(
`
${
API_BASE
}
/api/v1/chat/
${
chatId
}
`
,
{
method
:
"
POST
"
,
method
:
"
POST
"
,
headers
:
{
headers
:
{
...
@@ -222,7 +229,7 @@ export async function* sendMessage(
...
@@ -222,7 +229,7 @@ export async function* sendMessage(
web_search
:
webSearch
??
false
,
web_search
:
webSearch
??
false
,
file_tools
:
fileTools
??
false
,
file_tools
:
fileTools
??
false
,
...(
forceUpdate
!==
undefined
?
{
forceUpdate
}
:
{}),
...(
forceUpdate
!==
undefined
?
{
forceUpdate
}
:
{}),
...(
think
!==
undefined
?
{
think
}
:
{}),
...(
shouldSendThink
?
{
think
}
:
{}),
}),
}),
),
),
signal
,
signal
,
...
...
app/ui/ui.go
View file @
2a9b61f0
...
@@ -782,25 +782,6 @@ func (s *Server) chat(w http.ResponseWriter, r *http.Request) error {
...
@@ -782,25 +782,6 @@ func (s *Server) chat(w http.ResponseWriter, r *http.Request) error {
var
thinkValue
any
var
thinkValue
any
if
req
.
Think
!=
nil
{
if
req
.
Think
!=
nil
{
// Validate that the model supports thinking if requested
thinkRequested
:=
false
switch
v
:=
req
.
Think
.
(
type
)
{
case
bool
:
thinkRequested
=
v
case
string
:
thinkRequested
=
v
!=
""
&&
v
!=
"none"
}
if
thinkRequested
&&
!
think
{
errorEvent
:=
responses
.
ErrorEvent
{
EventName
:
"error"
,
Error
:
fmt
.
Sprintf
(
"Model %q does not support thinking/reasoning"
,
req
.
Model
),
Code
:
"model_capability_error"
,
}
json
.
NewEncoder
(
w
)
.
Encode
(
errorEvent
)
flusher
.
Flush
()
return
nil
}
thinkValue
=
req
.
Think
thinkValue
=
req
.
Think
}
else
{
}
else
{
thinkValue
=
think
thinkValue
=
think
...
...
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