diff --git a/meshai/cli/configurator.py b/meshai/cli/configurator.py index 3e5dabe..050d4e8 100644 --- a/meshai/cli/configurator.py +++ b/meshai/cli/configurator.py @@ -256,6 +256,8 @@ class Configurator: table.add_row("3", "Base URL", self.config.llm.base_url) table.add_row("4", "Model", self.config.llm.model) table.add_row("5", "System Prompt", f"[dim]{len(self.config.llm.system_prompt)} chars[/dim]") + use_prompt = getattr(self.config.llm, 'use_system_prompt', True) + table.add_row("6", "Use System Prompt", self._status_icon(use_prompt)) table.add_row("0", "Back", "") console.print(table) @@ -300,6 +302,10 @@ class Configurator: if value != self.config.llm.system_prompt: self.config.llm.system_prompt = value self.modified = True + elif choice == 6: + current = getattr(self.config.llm, 'use_system_prompt', True) + self.config.llm.use_system_prompt = not current + self.modified = True def _weather_settings(self) -> None: """Weather settings submenu.""" diff --git a/meshai/config.py b/meshai/config.py index 1c123c6..199d321 100644 --- a/meshai/config.py +++ b/meshai/config.py @@ -211,6 +211,7 @@ class LLMConfig: "Keep responses VERY brief - under 250 characters total. " "Be concise but friendly. No markdown formatting." ) + use_system_prompt: bool = True # Toggle to disable sending system prompt # Fallback settings fallback: Optional[LLMBackendConfig] = None diff --git a/meshai/router.py b/meshai/router.py index 2d4911a..dba56e9 100644 --- a/meshai/router.py +++ b/meshai/router.py @@ -130,10 +130,15 @@ class MessageRouter: history = await self.history.get_history_for_llm(message.sender_id) # Generate response with user_id for memory optimization + # Use system prompt only if enabled in config + system_prompt = "" + if getattr(self.config.llm, 'use_system_prompt', True): + system_prompt = self.config.llm.system_prompt + try: response = await self.llm.generate( messages=history, - system_prompt=self.config.llm.system_prompt, + system_prompt=system_prompt, max_tokens=300, user_id=message.sender_id, # Enable memory optimization )