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

feature request: YAML anchors and aliases for simplifying roles.yaml #110

Closed
sudomain opened this issue Apr 14, 2023 · 2 comments
Closed

Comments

@sudomain
Copy link

Sorry if this is naive (it probably is, I'm less than a week into using aichat), but I think it would be useful to be able to use YAML anchors and aliases. This is the usecase I had in mind:

- name: &code_generator
  prompt: code_generator
    Your answer must only executable code.
    Do not answer with fenced code block.
    The first line of your answer must contain a she-bang.
    Provide explanations in comments.

- name: bash
  prompt: bash generator                                                                                            <<: *code_generator
    Your answer must only be executable Bash code

- name: python
  prompt: python generator                                                                                          <<: *code_generator
    Your answer must only be executable Python code

Basically I have a set of requirements that I ask aichat when generating code in any programming language. I'd like to be able to have these requirements be inherited by specific language roles, which would allow me to tweak the wording of only the code_generator if I want to change how all of the languages are generated.

I can just keep copy/pasting the common requirements though. What do you think?

@sigoden
Copy link
Owner

sigoden commented May 4, 2023

for your usage, you can check https://github.com/sigoden/aichat/wiki/Role-Guide#role-args

@sigoden sigoden closed this as completed May 4, 2023
@sudomain
Copy link
Author

sudomain commented May 4, 2023

Thank you. I ended up finding that and after some toying with it went with the following:

- name: code_generator:Python                                                              temperature: 0
  prompt: Write functions in __ARG1__. Reply must use fenced code blocks.

- name: code_generator:Bash                                                                temperature: 0
  prompt: Write functions in __ARG1__. Reply must use fenced code blocks.

Idk about you, but I'm have more programming success when giving it smaller tasks, thus I've been having it write functions.

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

No branches or pull requests

2 participants