Merge pull request #1245 from Codium-ai/tr/help_rag

docs pr help
This commit is contained in:
Tal
2024-09-21 20:58:06 +03:00
committed by GitHub
4 changed files with 15 additions and 3 deletions

View File

@ -43,6 +43,12 @@ CodiumAI PR-Agent aims to help efficiently review and handle pull requests, by p
## News and Updates ## 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).
<kbd><img src="https://www.codium.ai/images/pr_agent/pr_help_chat.png" width="768"></kbd>
### September 12, 2024 ### September 12, 2024
[Dynamic context](https://pr-agent-docs.codium.ai/core-abilities/dynamic_context/) is now the default option for context extension. [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. This feature enables PR-Agent to dynamically adjusting the relevant context for each code hunk, while avoiding overflowing the model with too much information.

View File

@ -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. - 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 Features
PR-Agent offers extensive pull request functionalities across various git providers. PR-Agent offers extensive pull request functionalities across various git providers.

View File

@ -119,7 +119,7 @@ class PRDescription:
pr_body += "\n</details>\n" pr_body += "\n</details>\n"
elif self.git_provider.is_supported("gfm_markdown") and get_settings().pr_description.enable_help_comment: 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\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 # Output the relevant configurations if enabled
if get_settings().get('config', {}).get('output_relevant_configurations', False): if get_settings().get('config', {}).get('output_relevant_configurations', False):

View File

@ -105,8 +105,10 @@ class PRHelpMessage:
get_logger().info("Loading the Chroma index...") get_logger().info("Loading the Chroma index...")
db_path = "./docs/chroma_db.zip" db_path = "./docs/chroma_db.zip"
if not os.path.exists(db_path): if not os.path.exists(db_path):
get_logger().error("Local db not found") db_path= "/app/docs/chroma_db.zip"
return sim_results if not os.path.exists(db_path):
get_logger().error("Local db not found")
return sim_results
with tempfile.TemporaryDirectory() as temp_dir: with tempfile.TemporaryDirectory() as temp_dir:
# Extract the ZIP file # Extract the ZIP file
@ -169,6 +171,9 @@ class PRHelpMessage:
if not sim_results: if not sim_results:
get_logger().info("Failed to load the S3 index. Loading the local index...") get_logger().info("Failed to load the S3 index. Loading the local index...")
sim_results = self.get_sim_results_from_local_db(embeddings) 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 # Prepare relevant snippets
relevant_pages_full, relevant_snippets_full_header, relevant_snippets_str =\ relevant_pages_full, relevant_snippets_full_header, relevant_snippets_str =\