From da0bd847468b7c0862290a27008faf040f810074 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Tue, 1 Oct 2024 08:20:16 +0300 Subject: [PATCH] dual --- docs/docs/tools/improve.md | 6 +++--- pr_agent/settings/configuration.toml | 2 +- pr_agent/tools/pr_code_suggestions.py | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/docs/tools/improve.md b/docs/docs/tools/improve.md index 5bba9d54..d18ed182 100644 --- a/docs/docs/tools/improve.md +++ b/docs/docs/tools/improve.md @@ -81,7 +81,7 @@ We advise users to apply critical analysis and judgment when implementing the pr In addition to mistakes (which may happen, but are rare), sometimes the presented code modification may serve more as an _illustrative example_ than a direct applicable solution. In such cases, we recommend prioritizing the suggestion's detailed description, using the diff snippet primarily as a supporting reference. -### Duel publishing mode +### Dual publishing mode Our recommended approach for presenting code suggestions is through a [table](https://qodo-merge-docs.qodo.ai/tools/improve/#overview) (`--pr_code_suggestions.commitable_code_suggestions=false`). This method significantly reduces the PR footprint and allows for quick and easy digestion of multiple suggestions. @@ -92,7 +92,7 @@ To activate dual publishing mode, use the following setting: ```toml [pr_code_suggestions] -duel_publishing_score_threshold = x +dual_publishing_score_threshold = x ``` Where x represents the minimum score threshold (>=) for suggestions to be presented as commitable PR comments in addition to the table. Default is -1 (disabled). @@ -238,7 +238,7 @@ Using a combination of both can help the AI model to provide relevant and tailor If set to true, the tool will display the suggestions as commitable code comments. Default is false. - duel_publishing_score_threshold + dual_publishing_score_threshold Minimum score threshold for suggestions to be presented as commitable PR comments in addition to the table. Default is -1 (disabled). diff --git a/pr_agent/settings/configuration.toml b/pr_agent/settings/configuration.toml index 1de42af3..fb90685b 100644 --- a/pr_agent/settings/configuration.toml +++ b/pr_agent/settings/configuration.toml @@ -111,7 +111,7 @@ enable_help_text=false max_context_tokens=14000 # commitable_code_suggestions = false -duel_publishing_score_threshold=7 # -1 to disable, [0-10] to set the threshold (>=) for publishing a code suggestion both in a table and as commitable +dual_publishing_score_threshold=7 # -1 to disable, [0-10] to set the threshold (>=) for publishing a code suggestion both in a table and as commitable # extra_instructions = "" rank_suggestions = false diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index 90baaf67..ecc352f2 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -166,24 +166,24 @@ class PRCodeSuggestions: max_previous_comments=get_settings().pr_code_suggestions.max_history_len, progress_response=self.progress_response) - # duel publishing mode - if int(get_settings().pr_code_suggestions.duel_publishing_score_threshold) > 0: + # dual publishing mode + if int(get_settings().pr_code_suggestions.dual_publishing_score_threshold) > 0: data_above_threshold = {'code_suggestions': []} try: for suggestion in data['code_suggestions']: - if int(suggestion.get('score', 0)) >= int(get_settings().pr_code_suggestions.duel_publishing_score_threshold) \ + if int(suggestion.get('score', 0)) >= int(get_settings().pr_code_suggestions.dual_publishing_score_threshold) \ and suggestion.get('improved_code'): data_above_threshold['code_suggestions'].append(suggestion) if not data_above_threshold['code_suggestions'][-1]['existing_code']: - get_logger().info(f'Identical existing and improved code for duel publishing found') + get_logger().info(f'Identical existing and improved code for dual publishing found') data_above_threshold['code_suggestions'][-1]['existing_code'] = suggestion[ 'improved_code'] if data_above_threshold['code_suggestions']: get_logger().info( - f"Publishing {len(data_above_threshold['code_suggestions'])} suggestions in duel publishing mode") + f"Publishing {len(data_above_threshold['code_suggestions'])} suggestions in dual publishing mode") self.push_inline_code_suggestions(data_above_threshold) except Exception as e: - get_logger().error(f"Failed to publish duel publishing suggestions, error: {e}") + get_logger().error(f"Failed to publish dual publishing suggestions, error: {e}") else: if self.progress_response: self.git_provider.edit_comment(self.progress_response, body=pr_body)