Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding in ability to provide per repo hints #32

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/goose/toolkit/developer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,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