Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompts #1242

Merged
merged 1 commit into from
Sep 21, 2024
Merged

prompts #1242

merged 1 commit into from
Sep 21, 2024

Conversation

mrT23
Copy link
Collaborator

@mrT23 mrT23 commented Sep 21, 2024

PR Type

Enhancement, Documentation


Description

  • Introduced a new feature for documentation assistance:
    • Added "pr_help_prompts.toml" file with prompts for a documentation helper
    • The helper is designed to answer questions about the PR-Agent project using RAG-retrieved snippets
  • Updated the configuration loader to include the new prompts file
  • Reorganized the order of configuration files in the loader

Changes walkthrough 📝

Relevant files
Configuration changes
config_loader.py
Update configuration file list                                                     

pr_agent/config_loader.py

  • Added "settings/pr_help_prompts.toml" to the list of configuration
    files
  • Moved "settings/custom_labels.toml" higher in the list
  • +2/-1     
    Enhancement
    pr_help_prompts.toml
    Add documentation helper prompts                                                 

    pr_agent/settings/pr_help_prompts.toml

  • Added new file with prompts for a documentation helper feature
  • Includes system and user prompts for answering questions about
    PR-Agent documentation
  • Defines output structure for documentation help responses
  • +43/-0   

    💡 PR-Agent usage:
    Comment /help on the PR to get a list of all available PR-Agent tools and their descriptions

    @codiumai-pr-agent-pro codiumai-pr-agent-pro bot added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 21, 2024
    Copy link
    Contributor

    PR Reviewer Guide 🔍

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🏅 Score: 95
    🧪 No relevant tests
    🔒 No security concerns identified
    🔀 Multiple PR themes

    Sub-PR theme: Update configuration loader

    Relevant files:

    • pr_agent/config_loader.py

    Sub-PR theme: Add documentation helper prompts

    Relevant files:

    • pr_agent/settings/pr_help_prompts.toml

    ⚡ No key issues to review

    @mrT23 mrT23 merged commit 81e847e into main Sep 21, 2024
    2 checks passed
    @mrT23 mrT23 deleted the tr/help_rag branch September 21, 2024 13:59
    Copy link
    Contributor

    PR Code Suggestions ✨

    CategorySuggestion                                                                                                                                    Score
    Enhancement
    Introduce a constant for the settings file path to reduce repetition and improve maintainability

    Consider using a constant or configuration variable for the base path of the
    settings files to improve maintainability and reduce repetition.

    pr_agent/config_loader.py [19-31]

    -"settings/pr_reviewer_prompts.toml",
    -"settings/pr_questions_prompts.toml",
    -"settings/pr_line_questions_prompts.toml",
    +SETTINGS_PATH = "settings/"
    +f"{SETTINGS_PATH}pr_reviewer_prompts.toml",
    +f"{SETTINGS_PATH}pr_questions_prompts.toml",
    +f"{SETTINGS_PATH}pr_line_questions_prompts.toml",
     ...
    -"settings/custom_labels.toml",
    -"settings/pr_help_prompts.toml",
    +f"{SETTINGS_PATH}custom_labels.toml",
    +f"{SETTINGS_PATH}pr_help_prompts.toml",
     
    Suggestion importance[1-10]: 7

    Why: This suggestion improves code maintainability by reducing repetition, making it easier to update the settings path if needed in the future.

    7
    Add error handling for missing or invalid input data in the TOML configuration

    Consider adding error handling for potential issues such as missing or invalid input
    data in the TOML configuration.

    pr_agent/settings/pr_help_prompts.toml [28-43]

     user="""\
     User's Question:
     =====
    +{% if question %}
     {{ question|trim }}
    +{% else %}
    +No question provided.
    +{% endif %}
     =====
     
     
     Relevant doc snippets retrieved:
     =====
    +{% if snippets %}
     {{ snippets|trim }}
    +{% else %}
    +No relevant snippets found.
    +{% endif %}
     =====
     
     
     Response (should be a valid YAML, and nothing else):
     ```yaml
     """
     
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: This suggestion adds robustness to the configuration by handling potential missing data, which is a good practice, although not critical for this specific TOML file.

    6

    💡 Need additional feedback ? start a PR chat

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    documentation Improvements or additions to documentation enhancement New feature or request Review effort [1-5]: 2
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants