feat: add global optional user goosehints file (#73)

This commit is contained in:
Michael Neale
2024-09-27 18:25:26 +10:00
committed by GitHub
parent 3bf4045f63
commit d0d9734331
3 changed files with 53 additions and 3 deletions
+8 -2
View File
@@ -41,9 +41,15 @@ class Developer(Toolkit):
"""Retrieve system configuration details for developer"""
hints_path = Path(".goosehints")
system_prompt = Message.load("prompts/developer.jinja").text
home_hints_path = Path.home() / ".config/goose/.goosehints"
hints = []
if hints_path.is_file():
goosehints = render_template(hints_path)
system_prompt = f"{system_prompt}\n\nHints:\n{goosehints}"
hints.append(render_template(hints_path))
if home_hints_path.is_file():
hints.append(render_template(home_hints_path))
if hints:
hints_text = "\n".join(hints)
system_prompt = f"{system_prompt}\n\nHints:\n{hints_text}"
return system_prompt
@tool