diff --git a/README.md b/README.md index 86903c25..c9bbb4ab 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,11 @@ CodiumAI PR-Agent aims to help efficiently review and handle pull requests, by p ## News and Updates +### July 28, 2024 + +(1) improved support for bitbucket server - [auto commands](https://github.com/Codium-ai/pr-agent/pull/1059) and [direct links](https://github.com/Codium-ai/pr-agent/pull/1061) +(2) custom models are now [supported](https://pr-agent-docs.codium.ai/usage-guide/changing_a_model/#custom-models) + ### July 6, 2024 v0.23 has been released. See full log changes [here](https://github.com/Codium-ai/pr-agent/releases/tag/v0.23). diff --git a/docs/docs/usage-guide/changing_a_model.md b/docs/docs/usage-guide/changing_a_model.md index 9ba605f8..e8e501b3 100644 --- a/docs/docs/usage-guide/changing_a_model.md +++ b/docs/docs/usage-guide/changing_a_model.md @@ -170,7 +170,7 @@ drop_params = true AWS session is automatically authenticated from your environment, but you can also explicitly set `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_REGION_NAME` environment variables. Please refer to [this document](https://litellm.vercel.app/docs/providers/bedrock) for more details. -### custom models +### Custom models If the relevant model doesn't appear [here](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/algo/__init__.py), you can still use it as a custom model: (1) Set the model name in the configuration file: ``` diff --git a/docs/docs/usage-guide/index.md b/docs/docs/usage-guide/index.md index 328489ce..637048c1 100644 --- a/docs/docs/usage-guide/index.md +++ b/docs/docs/usage-guide/index.md @@ -23,4 +23,4 @@ It includes information on how to adjust PR-Agent configurations, define which t - [Changing a model](./additional_configurations.md#changing-a-model) - [Patch Extra Lines](./additional_configurations.md#patch-extra-lines) - [Editing the prompts](./additional_configurations.md#editing-the-prompts) -- [PR-Agent Pro Models 💎](./PR_agent_pro_models.md) \ No newline at end of file +- [PR-Agent Pro Models](./PR_agent_pro_models.md) \ No newline at end of file diff --git a/pr_agent/algo/utils.py b/pr_agent/algo/utils.py index 4bd6c631..c534e701 100644 --- a/pr_agent/algo/utils.py +++ b/pr_agent/algo/utils.py @@ -557,7 +557,7 @@ def _fix_key_value(key: str, value: str): def load_yaml(response_text: str, keys_fix_yaml: List[str] = [], first_key="", last_key="") -> dict: - response_text = response_text.removeprefix('```yaml').rstrip('`') + response_text = response_text.strip('\n').removeprefix('```yaml').rstrip('`') try: data = yaml.safe_load(response_text) except Exception as e: diff --git a/pr_agent/tools/pr_code_suggestions.py b/pr_agent/tools/pr_code_suggestions.py index 84e3cc8f..2cb47911 100644 --- a/pr_agent/tools/pr_code_suggestions.py +++ b/pr_agent/tools/pr_code_suggestions.py @@ -100,8 +100,8 @@ class PRCodeSuggestions: data = {"code_suggestions": []} if data is None or 'code_suggestions' not in data or not data['code_suggestions']: - get_logger().error('No code suggestions found for PR.') - pr_body = "## PR Code Suggestions ✨\n\nNo code suggestions found for PR." + get_logger().error('No code suggestions found for the PR.') + pr_body = "## PR Code Suggestions ✨\n\nNo code suggestions found for the PR." get_logger().debug(f"PR output", artifact=pr_body) if self.progress_response: self.git_provider.edit_comment(self.progress_response, body=pr_body)