feat(rag): steering notes — tune how Brain answers, stored in Postgres and injected into every system prompt
This commit is contained in:
@@ -279,8 +279,19 @@ class _CannedLLM:
|
||||
yield self.answer[i : i + 12]
|
||||
|
||||
|
||||
class _FakeSteeringResult:
|
||||
"""Empty steering-note result (no stored notes in these unit tests)."""
|
||||
|
||||
def all(self) -> list[Any]:
|
||||
return []
|
||||
|
||||
|
||||
class _FakeSession:
|
||||
"""Stands in for the DB session: records the QueryLog row it is given."""
|
||||
"""Stands in for the DB session: records the QueryLog row it is given.
|
||||
|
||||
``scalars`` always yields no steering notes (phase 15) so the chat
|
||||
turn's ``load_steering_notes`` call stays a no-op here.
|
||||
"""
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.added: list[Any] = []
|
||||
@@ -292,6 +303,9 @@ class _FakeSession:
|
||||
def commit(self) -> None:
|
||||
self.commits += 1
|
||||
|
||||
def scalars(self, _stmt: Any) -> _FakeSteeringResult:
|
||||
return _FakeSteeringResult()
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def gate_env(monkeypatch: pytest.MonkeyPatch) -> Iterator[tuple[_FakeSession, _CannedLLM]]:
|
||||
|
||||
Reference in New Issue
Block a user