diff --git a/atlasbot/llm/client.py b/atlasbot/llm/client.py index 28c6d19..a987e4d 100644 --- a/atlasbot/llm/client.py +++ b/atlasbot/llm/client.py @@ -60,9 +60,10 @@ class LLMClient: def build_messages(system: str, prompt: str, *, context: str | None = None) -> list[dict[str, str]]: - messages: list[dict[str, str]] = [{"role": "system", "content": system}] + system_content = system if context: - messages.append({"role": "user", "content": "Context (grounded):\n" + context}) + system_content = system_content + "\n\nContext (grounded facts):\n" + context + messages: list[dict[str, str]] = [{"role": "system", "content": system_content}] messages.append({"role": "user", "content": prompt}) return messages