From 48233fde237ca3c6a8513e81a0ce4d7085b41410 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Thu, 31 Aug 2023 08:02:14 +0300 Subject: [PATCH 1/4] Editing the prompts --- CONFIGURATION.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 66ec4f06..67a2be2d 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -48,6 +48,24 @@ Then when a new PR is opened, PR-Agent will run the `describe` tool with the abo Note that a local `.pr_agent.toml` file enables you to edit and customize the default parameters of any tool, not just the ones that are run automatically. +#### Editing the prompts +The prompts for the different tools of PR-Agent are defined in the `pr_agent/settings` folder. + +In practice, the prompts are loaded and stored as a standard setting object, +so editing them is similar to editing any other configuration value - just place the relevant setting in `.pr_agent.toml`file, and override the default value. + +For example, if you want to edit the prompts of the [describe](./pr_agent/settings/pr_description_prompts.toml) tool, you can add the following to your `.pr_agent.toml` file: +``` +[pr_description_prompt] +system=""" +... +""" +user=""" +... +""" +``` +Note that the new prompt will need to generate an output compatible with the relevant [post-process function](./pr_agent/tools/pr_description.py). + #### Online usage For online usage (calling tools by comments on a PR like `/ask ...`), just add `--config_path=` to any command, to edit a specific configuration value. For example if you want to edit `pr_reviewer` configurations, you can run: From e0ca594a6992d4e173821d46f0a9070c7dfe276f Mon Sep 17 00:00:00 2001 From: mrT23 Date: Thu, 31 Aug 2023 08:06:43 +0300 Subject: [PATCH 2/4] Editing the prompts --- CONFIGURATION.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 67a2be2d..26b72dc9 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -49,10 +49,10 @@ Then when a new PR is opened, PR-Agent will run the `describe` tool with the abo Note that a local `.pr_agent.toml` file enables you to edit and customize the default parameters of any tool, not just the ones that are run automatically. #### Editing the prompts -The prompts for the different tools of PR-Agent are defined in the `pr_agent/settings` folder. +The prompts for the various PR-Agent tools are defined in the `pr_agent/settings` folder. -In practice, the prompts are loaded and stored as a standard setting object, -so editing them is similar to editing any other configuration value - just place the relevant setting in `.pr_agent.toml`file, and override the default value. +In practice, the prompts are loaded and stored as a standard setting object. Hence, +editing them is similar to editing any other configuration value - just place the relevant key in `.pr_agent.toml`file, and override the default value. For example, if you want to edit the prompts of the [describe](./pr_agent/settings/pr_description_prompts.toml) tool, you can add the following to your `.pr_agent.toml` file: ``` From 376c4523ddb55273e0524b840817462bc1a7918c Mon Sep 17 00:00:00 2001 From: mrT23 Date: Thu, 31 Aug 2023 08:08:09 +0300 Subject: [PATCH 3/4] Editing the prompts --- CONFIGURATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 26b72dc9..cce29c77 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -64,7 +64,7 @@ user=""" ... """ ``` -Note that the new prompt will need to generate an output compatible with the relevant [post-process function](./pr_agent/tools/pr_description.py). +Note that the new prompt will need to generate an output compatible with the relevant [post-process function](./pr_agent/tools/pr_description.py#L137). #### Online usage For online usage (calling tools by comments on a PR like `/ask ...`), just add `--config_path=` to any command, to edit a specific configuration value. From ce9014073c0b3b2229770145ecd62b08e992ab80 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Thu, 31 Aug 2023 08:19:33 +0300 Subject: [PATCH 4/4] Editing the prompts --- CONFIGURATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index cce29c77..c54d047d 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -35,7 +35,7 @@ pr_commands = [ ] ``` This means that when a new PR is opened, PR-Agent will run the `describe` and `auto_review` tools. -For the describe tool, the `add_original_user_description` and `keep_original_user_title` parameters will be set to `true`. +For the describe tool, the `add_original_user_description` and `keep_original_user_title` parameters will be set to true. However, you can override the default tool parameters by uploading a local configuration file called `.pr_agent.toml` to the root of your repo. For example, if your local `.pr_agent.toml` file contains: