adding in ability to provide per repo hints (#32)

* adding in ability to provide per repo hints

* tidy up test
This commit is contained in:
Michael Neale
2024-09-04 16:18:01 +10:00
committed by GitHub
parent bb8966bb02
commit 13db5150bd
2 changed files with 10 additions and 1 deletions

View File

@@ -34,7 +34,12 @@ class Developer(Toolkit):
def system(self) -> str:
"""Retrieve system configuration details for developer"""
return Message.load("prompts/developer.jinja").text
hints_path = Path('.goosehints')
system_prompt = Message.load("prompts/developer.jinja").text
if hints_path.is_file():
goosehints = hints_path.read_text()
system_prompt = f"{system_prompt}\n\nHints:\n{goosehints}"
return system_prompt
@tool
def update_plan(self, tasks: List[dict]) -> List[dict]:

View File

@@ -1,4 +1,6 @@
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import MagicMock, Mock
@@ -66,3 +68,5 @@ def test_write_file(temp_dir, developer_toolkit):
content = "Hello World"
developer_toolkit.write_file(test_file.as_posix(), content)
assert test_file.read_text() == content