Skip to content

Build your personal knowledge base with Trilium Notes

feat(llm): improve prompt when no access to web

Elian Dorane4a38fe277bb
diff --git a/apps/server/src/services/llm/providers/base_provider.ts b/apps/server/src/services/llm/providers/base_provider.ts
index e60775dbbd..ff2363a94c 100644
--- a/apps/server/src/services/llm/providers/base_provider.ts
+++ b/apps/server/src/services/llm/providers/base_provider.ts
@@ -104,6 +104,13 @@ export abstract class BaseProvider implements LlmProvider {
: noToolsHint;
}
+ if (!config.enableWebSearch) {
+ const noWebSearchHint = `You do not have access to web search. If the user asks for current/real-time information, news, or anything that requires searching the web, inform them that "Web search" is disabled and they need to enable it in the chat settings (click on the model name dropdown and toggle "Web search").`;
+ systemPrompt = systemPrompt
+ ? `${systemPrompt}\n\n${noWebSearchHint}`
+ : noWebSearchHint;
+ }
+
return systemPrompt;
}