diff --git a/README.md b/README.md index 5571c4b49..e29a7cafb 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,12 @@ CodiumAI PR-Agent aims to help efficiently review and handle pull requests, by p ## News and Updates +### September 21, 2024 +Need help with PR-Agent? New feature - simply comment `/help "your question"` in a pull request, and PR-Agent will provide you with the [relevant documentation](https://github.com/Codium-ai/pr-agent/pull/1241#issuecomment-2365259334). + + + + ### September 12, 2024 [Dynamic context](https://pr-agent-docs.codium.ai/core-abilities/dynamic_context/) is now the default option for context extension. This feature enables PR-Agent to dynamically adjusting the relevant context for each code hunk, while avoiding overflowing the model with too much information. diff --git a/docs/docs/index.md b/docs/docs/index.md index 13918132c..d39249905 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -8,6 +8,7 @@ CodiumAI PR-Agent is an open-source tool to help efficiently review and handle p - See the [Tools Guide](./tools/index.md) for a detailed description of the different tools. +To search the documentation site using natural language, simply comment `/help "your question"` in a pull request where PR-Agent is installed. PR-Agent will then provide you with an [answer](https://github.com/Codium-ai/pr-agent/pull/1241#issuecomment-2365259334), including relevant documentation links. ## PR-Agent Features PR-Agent offers extensive pull request functionalities across various git providers. diff --git a/pr_agent/tools/pr_description.py b/pr_agent/tools/pr_description.py index 7fbeb25b9..150c4cc98 100644 --- a/pr_agent/tools/pr_description.py +++ b/pr_agent/tools/pr_description.py @@ -119,7 +119,7 @@ async def run(self): pr_body += "\n\n" elif self.git_provider.is_supported("gfm_markdown") and get_settings().pr_description.enable_help_comment: pr_body += "\n\n___\n\n> 💡 **PR-Agent usage**:" - pr_body += "\n>Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions\n\n" + pr_body += '\n>Need PR-Agent help? Comment `/help "your question"` on any pull request to receive relevant information' # Output the relevant configurations if enabled if get_settings().get('config', {}).get('output_relevant_configurations', False): diff --git a/pr_agent/tools/pr_help_message.py b/pr_agent/tools/pr_help_message.py index 7bad18cdc..72266e3e0 100644 --- a/pr_agent/tools/pr_help_message.py +++ b/pr_agent/tools/pr_help_message.py @@ -105,8 +105,10 @@ def get_sim_results_from_local_db(self, embeddings): get_logger().info("Loading the Chroma index...") db_path = "./docs/chroma_db.zip" if not os.path.exists(db_path): - get_logger().error("Local db not found") - return sim_results + db_path= "/app/docs/chroma_db.zip" + if not os.path.exists(db_path): + get_logger().error("Local db not found") + return sim_results with tempfile.TemporaryDirectory() as temp_dir: # Extract the ZIP file @@ -169,6 +171,9 @@ async def run(self): if not sim_results: get_logger().info("Failed to load the S3 index. Loading the local index...") sim_results = self.get_sim_results_from_local_db(embeddings) + if not sim_results: + get_logger().error("Failed to retrieve similar snippets. Exiting...") + return # Prepare relevant snippets relevant_pages_full, relevant_snippets_full_header, relevant_snippets_str =\