Skip to content

Commit a967880

Browse files
authored
fix(websearch): fix webSearch flag use for model with tool use (#1480)
1 parent 6ab4a1f commit a967880

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/lib/server/textGeneration/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,7 @@ async function* textGenerationWithoutTitle(
6262
// - it's not continuing a previous message
6363
// - AND the model doesn't support tools and websearch is selected
6464
// - OR the assistant has websearch enabled (no tools for assistants for now)
65-
if (
66-
!isContinue &&
67-
((!model.tools && webSearch && !conv.assistantId) || assistantHasWebSearch(assistant))
68-
) {
65+
if (!isContinue && ((webSearch && !conv.assistantId) || assistantHasWebSearch(assistant))) {
6966
webSearchResult = yield* runWebSearch(conv, messages, assistant?.rag);
7067
}
7168

src/routes/conversation/[id]/+page.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
let loading = false;
3333
let pending = false;
3434
35+
$: activeModel = findCurrentModel([...data.models, ...data.oldModels], data.model);
36+
3537
let files: File[] = [];
3638
3739
async function convFromShared() {
@@ -201,7 +203,7 @@
201203
messageId,
202204
isRetry,
203205
isContinue,
204-
webSearch: !hasAssistant && $webSearchParameters.useSearch,
206+
webSearch: !hasAssistant && !activeModel.tools && $webSearchParameters.useSearch,
205207
tools: $settings.tools, // preference for tools
206208
files: isRetry ? userMessage?.files : base64Files,
207209
},

0 commit comments

Comments
 (0)