Skip to content

Commit

Permalink
adding in ability to provide per repo hints (#32)
Browse files Browse the repository at this point in the history
* adding in ability to provide per repo hints

* tidy up test
  • Loading branch information
michaelneale authored and lily-de committed Oct 7, 2024
1 parent 0c5e80e commit 97e0b48
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/goose/toolkit/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
4 changes: 4 additions & 0 deletions tests/toolkit/test_developer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
from pathlib import Path


from tempfile import TemporaryDirectory
from unittest.mock import MagicMock, Mock

Expand Down Expand Up @@ -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


0 comments on commit 97e0b48

Please sign in to comment.