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

Make goosehints jinja templated #43

Merged
merged 7 commits into from
Sep 4, 2024
Merged

Make goosehints jinja templated #43

merged 7 commits into from
Sep 4, 2024

Conversation

salman1993
Copy link
Collaborator

Easier to include files like README.md & CONTRIBUTING.md

README.md Outdated Show resolved Hide resolved
system_prompt = Message.load("prompts/developer.jinja").text
if hints_path.is_file():
goosehints = hints_path.read_text()
goosehints = render_template(hints_path)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i found the .goose.jinja file in this repo but couldn't find a reference on where/how it was being used
https://github.com/squareup/goose/blob/cffd4bfe8eaac603ec84c4c3b9e7f204cc91a948/.goose.jinja#L1

Copy link
Contributor

@lukealvoeiro lukealvoeiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Have an improvement suggested. Out of curiosity what .md formatter are you using - we should standardize on one to avoid changes to docs that are just formatting.

README.md Outdated Show resolved Hide resolved
if not template_path.exists():
raise FileNotFoundError(f"Template file {template_path} does not exist.")

env = Environment(loader=FileSystemLoader(template_path.parent))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] could we look up parent paths recursively up until we reach the repo root? this is because in a monorepo setting it might be included at a subproject level, or at the top level of the repo - and goose could be ran at either level.

Copy link
Collaborator Author

@salman1993 salman1993 Sep 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am gonna hold off on this till for now & keep it simple so that it just uses the working directory hints.

Copy link
Collaborator

@baxen baxen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@salman1993
Copy link
Collaborator Author

salman1993 commented Sep 4, 2024

fixed the formatting by running just format

Copy link

github-actions bot commented Sep 4, 2024

Hey there and thank you for opening this pull request! 👋🏼

We require pull request titles to follow the Conventional Commits specification and it looks like your proposed title needs to be adjusted.

Details:

No release type found in pull request title "Make goosehints jinja templated". Add a prefix to indicate what kind of release this pull request corresponds to. For reference, see https://www.conventionalcommits.org/

Available types:
 - feat: A new feature
 - fix: A bug fix
 - docs: Documentation only changes
 - style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
 - refactor: A code change that neither fixes a bug nor adds a feature
 - perf: A code change that improves performance
 - test: Adding missing tests or correcting existing tests
 - build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
 - ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
 - chore: Other changes that don't modify src or test files
 - revert: Reverts a previous commit

@salman1993 salman1993 merged commit 72d927f into main Sep 4, 2024
1 of 2 checks passed
@michaelneale
Copy link
Collaborator

@salman1993 a bit late to mention - but this is genius BTW ! love it

lukealvoeiro added a commit that referenced this pull request Sep 9, 2024
* main:
  fix: typo in exchange method `rewind` (#54)
  fix: remove unsafe pop of messages (#47)
  chore: Update LICENSE (#53)
  chore(docs): update is_dangerous_command method description (#48)
  refactor: improve safety rails speed and prompt (#45)
  feat: make goosehints jinja templated (#43)
  ci: enforce PR title follows conventional commit (#14)
  feat: show available toolkits (#37)
  adding in ability to provide per repo hints (#32)
  Apply ruff and add to CI (#40)
  added some regex based checks for dangerous commands (#38)
  chore: Update publish github workflow to check package versions before publishing (#19)
  chore: upgrade ai-exchange dependency (#36)
  fix: resuming sessions (#35)
  feat: upgrade `ai-exchange` to version `0.8.3` and fix tests (#34)
  fix: export metadata.plugins export should have valid module (#30)
  fix (#24)
  link to vs code extension (#20)
  Enable cli options for plugin (#22)
  Modified the readme to be more friendly to new users (#16)
Kvadratni added a commit to Kvadratni/goose that referenced this pull request Sep 23, 2024
* origin/main:
  chore: release 0.9.0 (block#58)
  fix: goose should track files it reads and not overwrite changes (block#46)
  docs: Small dev notes for using exchange from source (block#50)
  fix: typo in exchange method `rewind` (block#54)
  fix: remove unsafe pop of messages (block#47)
  chore: Update LICENSE (block#53)
  chore(docs): update is_dangerous_command method description (block#48)
  refactor: improve safety rails speed and prompt (block#45)
  feat: make goosehints jinja templated (block#43)
  ci: enforce PR title follows conventional commit (block#14)
  feat: show available toolkits (block#37)
  adding in ability to provide per repo hints (block#32)
  Apply ruff and add to CI (block#40)
  added some regex based checks for dangerous commands (block#38)
  chore: Update publish github workflow to check package versions before publishing (block#19)

# Conflicts:
#	src/goose/toolkit/developer.py
#	src/goose/utils/check_shell_command.py
#	tests/utils/test_check_shell_command.py
lily-de pushed a commit that referenced this pull request Oct 7, 2024
@lamchau lamchau deleted the sm/goosehint_jinja branch October 24, 2024 11:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants