From aa2121a48def2f05e2e85e373063259999b1955b Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 7 Apr 2024 16:28:30 +0300 Subject: [PATCH 1/3] readme --- docs/docs/tools/improve.md | 2 +- docs/docs/tools/review.md | 4 ++-- docs/docs/usage-guide/configuration_options.md | 2 +- pr_agent/servers/help.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/docs/tools/improve.md b/docs/docs/tools/improve.md index 40945775..b62fd649 100644 --- a/docs/docs/tools/improve.md +++ b/docs/docs/tools/improve.md @@ -72,7 +72,7 @@ To edit [configurations](https://github.com/Codium-ai/pr-agent/blob/main/pr_agen Examples for extra instructions: ``` [pr_code_suggestions] # /improve # - extra_instructions=""" + extra_instructions="""\ Emphasize the following aspects: - Does the code logic cover relevant edge cases? - Is the code logic clear and easy to understand? diff --git a/docs/docs/tools/review.md b/docs/docs/tools/review.md index 41ef75ed..c5681bb4 100644 --- a/docs/docs/tools/review.md +++ b/docs/docs/tools/review.md @@ -124,8 +124,8 @@ The tool will first ask the author questions about the PR, and will guide the re Examples for extra instructions: ``` - [pr_reviewer] # /review # - extra_instructions=""" + [pr_reviewer] + extra_instructions="""\ In the code feedback section, emphasize the following: - Does the code logic cover relevant edge cases? - Is the code logic clear and easy to understand? diff --git a/docs/docs/usage-guide/configuration_options.md b/docs/docs/usage-guide/configuration_options.md index 1d56baa2..ee908b76 100644 --- a/docs/docs/usage-guide/configuration_options.md +++ b/docs/docs/usage-guide/configuration_options.md @@ -22,7 +22,7 @@ Click [here](https://codium.ai/images/pr_agent/wiki_configuration_pr_agent.mp4) An example content: ``` -[pr_description] # /describe # +[pr_description] keep_original_user_title=false ``` diff --git a/pr_agent/servers/help.py b/pr_agent/servers/help.py index 364088ec..9e85887d 100644 --- a/pr_agent/servers/help.py +++ b/pr_agent/servers/help.py @@ -128,7 +128,7 @@ Be specific, clear, and concise in the instructions. With extra instructions, yo Examples for extra instructions: ``` [pr_description] -extra_instructions=""" +extra_instructions="""\ - The PR title should be in the format: ': ' - The title should be short and concise (up to 10 words) - ... From 2be0e9108e531c2d39bfdd7f05ae76e0e2c0d4c3 Mon Sep 17 00:00:00 2001 From: mrT23 <tal.r@codium.ai> Date: Sun, 7 Apr 2024 17:00:40 +0300 Subject: [PATCH 2/3] readme --- pr_agent/algo/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index b017f0aa..5a1e332d 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -575,7 +575,7 @@ def clip_tokens(text: str, max_tokens: int, add_three_dots=True) -> str: num_output_chars = int(chars_per_token * max_tokens) clipped_text = text[:num_output_chars] if add_three_dots: - clipped_text += "...(truncated)" + clipped_text += " ...(truncated)" return clipped_text except Exception as e: get_logger().warning(f"Failed to clip tokens: {e}") From a5a68c2a733d1b34f343af70c0b99aaaf1ff2022 Mon Sep 17 00:00:00 2001 From: mrT23 <tal.r@codium.ai> Date: Sun, 7 Apr 2024 17:02:37 +0300 Subject: [PATCH 3/3] readme --- tests/unittest/test_clip_tokens.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unittest/test_clip_tokens.py b/tests/unittest/test_clip_tokens.py index cc52ab7e..2405a06b 100644 --- a/tests/unittest/test_clip_tokens.py +++ b/tests/unittest/test_clip_tokens.py @@ -15,5 +15,5 @@ class TestClipTokens: max_tokens = 10 result = clip_tokens(text, max_tokens) - expected_results = 'line1\nline2\nline3\nli...(truncated)' + expected_results = 'line1\nline2\nline3\nli ...(truncated)' assert result == expected_results