Spaces:
Running
Running
fix(websearch): fix `webSearch` flag use for model with tool use (#1480)
Browse files
src/lib/server/textGeneration/index.ts
CHANGED
@@ -62,10 +62,7 @@ async function* textGenerationWithoutTitle(
|
|
62 |
// - it's not continuing a previous message
|
63 |
// - AND the model doesn't support tools and websearch is selected
|
64 |
// - 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 |
-
) {
|
69 |
webSearchResult = yield* runWebSearch(conv, messages, assistant?.rag);
|
70 |
}
|
71 |
|
|
|
62 |
// - it's not continuing a previous message
|
63 |
// - AND the model doesn't support tools and websearch is selected
|
64 |
// - OR the assistant has websearch enabled (no tools for assistants for now)
|
65 |
+
if (!isContinue && ((webSearch && !conv.assistantId) || assistantHasWebSearch(assistant))) {
|
|
|
|
|
|
|
66 |
webSearchResult = yield* runWebSearch(conv, messages, assistant?.rag);
|
67 |
}
|
68 |
|
src/routes/conversation/[id]/+page.svelte
CHANGED
@@ -32,6 +32,8 @@
|
|
32 |
let loading = false;
|
33 |
let pending = false;
|
34 |
|
|
|
|
|
35 |
let files: File[] = [];
|
36 |
|
37 |
async function convFromShared() {
|
@@ -201,7 +203,7 @@
|
|
201 |
messageId,
|
202 |
isRetry,
|
203 |
isContinue,
|
204 |
-
webSearch: !hasAssistant && $webSearchParameters.useSearch,
|
205 |
tools: $settings.tools, // preference for tools
|
206 |
files: isRetry ? userMessage?.files : base64Files,
|
207 |
},
|
|
|
32 |
let loading = false;
|
33 |
let pending = false;
|
34 |
|
35 |
+
$: activeModel = findCurrentModel([...data.models, ...data.oldModels], data.model);
|
36 |
+
|
37 |
let files: File[] = [];
|
38 |
|
39 |
async function convFromShared() {
|
|
|
203 |
messageId,
|
204 |
isRetry,
|
205 |
isContinue,
|
206 |
+
webSearch: !hasAssistant && !activeModel.tools && $webSearchParameters.useSearch,
|
207 |
tools: $settings.tools, // preference for tools
|
208 |
files: isRetry ? userMessage?.files : base64Files,
|
209 |
},
|