Skip to content

Conversation

sigoden
Copy link
Owner

@sigoden sigoden commented Mar 13, 2023

We can use role args to pass some additional arguments to the prompt.

- name: convert:json:yaml
  prompt: convert __ARG1__ below to __ARG2__

:json:yaml is role args. It has two args:

  • arg1 json, it will replace ARG1 in prompt
  • arg2 yaml, it will replace ARG2 in prompt
〉.role convert:json:yaml
name: convert:json:yaml
prompt: convert json below to yaml
temperature: null

〉.role convert:yaml:json
name: convert:yaml:json
prompt: convert yaml below to json
temperature: null

different role args, will generate different prompts.

sigoden added 2 commits March 13, 2023 09:32
We can use role args to pass some additional arguments to the prompt.

```
- name: convert:json:yaml
  prompt: convert __ARG1__ below to __ARG2__
```

`:json:yaml` is `role args`. It has two args:

- arg1 `json`, it will replace __ARG1__ in prompt
- arg2 `yaml`, it will replace __ARG2__ in prompt

```
〉.role convert:json:yaml
name: convert:json:yaml
prompt: convert json below to yaml
temperature: null

〉.role convert:yaml:json
name: convert:yaml:json
prompt: convert yaml below to json
temperature: null
```

different role args,  will generate different prompts.
@sigoden sigoden merged commit 9c04455 into main Mar 13, 2023
@sigoden sigoden deleted the feat-role-args branch March 13, 2023 02:09
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.

1 participant