Skip to content

Commit

Permalink
Add documentation for PROMPTS_DIR.
Browse files Browse the repository at this point in the history
  • Loading branch information
drazvan committed Aug 21, 2023
1 parent cbeba24 commit 46f94fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Support for [custom configuration data](./docs/user_guide/configuration-guide.md#custom-data).
- Example for using [custom LLM and multiple KBs](./examples/multi_kb/README.md)

- Support for [`PROMPTS_DIR`](./docs/user_guide/advanced/prompt-customization.md#prompt-configuration).

### Fixed

Expand Down
2 changes: 2 additions & 0 deletions docs/user_guide/advanced/prompt-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Check out the [Task type](../../../nemoguardrails/llm/types.py) for the complete

The toolkit provides predefined prompts for each task and for certain LLM models. They are located in the [nemoguardrails/llm/prompts](../../../nemoguardrails/llm/prompts) folder. You can customize the prompts further by including a `prompts.yml` file in a guardrails configuration (technically, the file name is not essential, and you can also include the `prompts` key in the general `config.yml` file).

Additionally, if the environment variable `PROMPTS_DIR` is set, the toolkit will also load any prompts defined in the specified directory. The loading is performed once, when the python module is loaded. The folder must contain one or more `.yml` files which contain prompt definitions (inside the `prompts` key).

To override the prompt for a specific model, you need to specify the `models` key:

```yaml
Expand Down

0 comments on commit 46f94fe

Please sign in to comment.