Skip to content

Commit

Permalink
Merge pull request #1245 from Codium-ai/tr/help_rag
Browse files Browse the repository at this point in the history
docs pr help
  • Loading branch information
mrT23 committed Sep 21, 2024
2 parents 9e28aca + 8229d98 commit 08d6bbc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

<kbd><img src="https://www.codium.ai/images/pr_agent/pr_help_chat.png" width="768"></kbd>


### 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.
Expand Down
1 change: 1 addition & 0 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion pr_agent/tools/pr_description.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def run(self):
pr_body += "\n</details>\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):
Expand Down
9 changes: 7 additions & 2 deletions pr_agent/tools/pr_help_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 =\
Expand Down

0 comments on commit 08d6bbc

Please sign in to comment.