docs: improve formatting and readability of documentation

This commit is contained in:
ofir-frd
2025-02-21 10:38:18 +02:00
parent 1e98d27ab4
commit b2d8dee00a
13 changed files with 48 additions and 52 deletions

View File

@ -1,5 +1,5 @@
## Local and global metadata injection with multi-stage analysis ## Local and global metadata injection with multi-stage analysis
(1) 1\.
Qodo Merge initially retrieves for each PR the following data: Qodo Merge initially retrieves for each PR the following data:
- PR title and branch name - PR title and branch name
@ -11,7 +11,7 @@ Qodo Merge initially retrieves for each PR the following data:
!!! tip "Tip: Organization-level metadata" !!! tip "Tip: Organization-level metadata"
In addition to the inputs above, Qodo Merge can incorporate supplementary preferences provided by the user, like [`extra_instructions` and `organization best practices`](https://qodo-merge-docs.qodo.ai/tools/improve/#extra-instructions-and-best-practices). This information can be used to enhance the PR analysis. In addition to the inputs above, Qodo Merge can incorporate supplementary preferences provided by the user, like [`extra_instructions` and `organization best practices`](https://qodo-merge-docs.qodo.ai/tools/improve/#extra-instructions-and-best-practices). This information can be used to enhance the PR analysis.
(2) 2\.
By default, the first command that Qodo Merge executes is [`describe`](https://qodo-merge-docs.qodo.ai/tools/describe/), which generates three types of outputs: By default, the first command that Qodo Merge executes is [`describe`](https://qodo-merge-docs.qodo.ai/tools/describe/), which generates three types of outputs:
- PR Type (e.g. bug fix, feature, refactor, etc) - PR Type (e.g. bug fix, feature, refactor, etc)
@ -49,8 +49,8 @@ __old hunk__
... ...
``` ```
(3) The entire PR files that were retrieved are also used to expand and enhance the PR context (see [Dynamic Context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/)). 3\. The entire PR files that were retrieved are also used to expand and enhance the PR context (see [Dynamic Context](https://qodo-merge-docs.qodo.ai/core-abilities/dynamic_context/)).
(4) All the metadata described above represents several level of cumulative analysis - ranging from hunk level, to file level, to PR level, to organization level. 4\. All the metadata described above represents several level of cumulative analysis - ranging from hunk level, to file level, to PR level, to organization level.
This comprehensive approach enables Qodo Merge AI models to generate more precise and contextually relevant suggestions and feedback. This comprehensive approach enables Qodo Merge AI models to generate more precise and contextually relevant suggestions and feedback.

View File

@ -14,6 +14,5 @@ An example result:
![Analyze 1](https://codium.ai/images/pr_agent/analyze_1.png){width=750} ![Analyze 1](https://codium.ai/images/pr_agent/analyze_1.png){width=750}
**Notes** !!! note "Language that are currently supported:"
Python, Java, C++, JavaScript, TypeScript, C#.
- Language that are currently supported: Python, Java, C++, JavaScript, TypeScript, C#.

View File

@ -38,20 +38,20 @@ where `https://real_link_to_image` is the direct link to the image.
Note that GitHub has a built-in mechanism of pasting images in comments. However, pasted image does not provide a direct link. Note that GitHub has a built-in mechanism of pasting images in comments. However, pasted image does not provide a direct link.
To get a direct link to an image, we recommend using the following scheme: To get a direct link to an image, we recommend using the following scheme:
1) First, post a comment that contains **only** the image: 1\. First, post a comment that contains **only** the image:
![Ask image1](https://codium.ai/images/pr_agent/ask_images1.png){width=512} ![Ask image1](https://codium.ai/images/pr_agent/ask_images1.png){width=512}
2) Quote reply to that comment: 2\. Quote reply to that comment:
![Ask image2](https://codium.ai/images/pr_agent/ask_images2.png){width=512} ![Ask image2](https://codium.ai/images/pr_agent/ask_images2.png){width=512}
3) In the screen opened, type the question below the image: 3\. In the screen opened, type the question below the image:
![Ask image3](https://codium.ai/images/pr_agent/ask_images3.png){width=512} ![Ask image3](https://codium.ai/images/pr_agent/ask_images3.png){width=512}
![Ask image4](https://codium.ai/images/pr_agent/ask_images4.png){width=512} ![Ask image4](https://codium.ai/images/pr_agent/ask_images4.png){width=512}
4) Post the comment, and receive the answer: 4\. Post the comment, and receive the answer:
![Ask image5](https://codium.ai/images/pr_agent/ask_images5.png){width=512} ![Ask image5](https://codium.ai/images/pr_agent/ask_images5.png){width=512}

View File

@ -51,8 +51,8 @@ Results obtained with the prompt above:
## Configuration options ## Configuration options
`prompt`: the prompt for the tool. It should be a multi-line string. - `prompt`: the prompt for the tool. It should be a multi-line string.
`num_code_suggestions_per_chunk`: number of code suggestions provided by the 'custom_prompt' tool, per chunk. Default is 4. - `num_code_suggestions_per_chunk`: number of code suggestions provided by the 'custom_prompt' tool, per chunk. Default is 4.
`enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true. - `enable_help_text`: if set to true, the tool will display a help text in the comment. Default is true.

View File

@ -143,7 +143,7 @@ The marker `pr_agent:type` will be replaced with the PR type, `pr_agent:summary`
![Describe markers before](https://codium.ai/images/pr_agent/describe_markers_before.png){width=512} ![Describe markers before](https://codium.ai/images/pr_agent/describe_markers_before.png){width=512}
→ becomes
![Describe markers after](https://codium.ai/images/pr_agent/describe_markers_after.png){width=512} ![Describe markers after](https://codium.ai/images/pr_agent/describe_markers_after.png){width=512}

View File

@ -27,7 +27,6 @@ You can state a name of a specific component in the PR to get documentation only
- `docs_style`: The exact style of the documentation (for python docstring). you can choose between: `google`, `numpy`, `sphinx`, `restructuredtext`, `plain`. Default is `sphinx`. - `docs_style`: The exact style of the documentation (for python docstring). you can choose between: `google`, `numpy`, `sphinx`, `restructuredtext`, `plain`. Default is `sphinx`.
- `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...". - `extra_instructions`: Optional extra instructions to the tool. For example: "focus on the changes in the file X. Ignore change in ...".
**Notes** !!! notes "Notes"
- The following languages are currently supported: Python, Java, C++, JavaScript, TypeScript, C#.
- Language that are currently fully supported: Python, Java, C++, JavaScript, TypeScript, C#.
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool. - This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.

View File

@ -10,8 +10,9 @@ It leverages LLM technology to transform PR comments and review suggestions into
### For Reviewers ### For Reviewers
Reviewers can request code changes by: <br> Reviewers can request code changes by:
1. Selecting the code block to be modified. <br>
1. Selecting the code block to be modified.
2. Adding a comment with the syntax: 2. Adding a comment with the syntax:
``` ```
/implement <code-change-description> /implement <code-change-description>
@ -46,7 +47,8 @@ You can reference and implement changes from any comment by:
Note that the implementation will occur within the review discussion thread. Note that the implementation will occur within the review discussion thread.
**Configuration options** <br> **Configuration options**
- Use `/implement` to implement code change within and based on the review discussion. <br> - Use `/implement` to implement code change within and based on the review discussion. <br>
- Use `/implement <code-change-description>` inside a review discussion to implement specific instructions. <br> - Use `/implement <code-change-description>` inside a review discussion to implement specific instructions. <br>
- Use `/implement <link-to-review-comment>` to indirectly call the tool from any comment. <br> - Use `/implement <link-to-review-comment>` to indirectly call the tool from any comment. <br>

View File

@ -9,7 +9,7 @@ The tool can be triggered automatically every time a new PR is [opened](../usage
![code_suggestions_as_comment_open.png](https://codium.ai/images/pr_agent/code_suggestions_as_comment_open.png){width=512} ![code_suggestions_as_comment_open.png](https://codium.ai/images/pr_agent/code_suggestions_as_comment_open.png){width=512}
Note that the following features are available only for Qodo Merge💎 users: !!! note "The following features are available only for Qodo Merge 💎 users:"
- The `Apply this suggestion` checkbox, which interactively converts a suggestion into a committable code comment - The `Apply this suggestion` checkbox, which interactively converts a suggestion into a committable code comment
- The `More` checkbox to generate additional suggestions - The `More` checkbox to generate additional suggestions
@ -196,7 +196,7 @@ And the label will be: `{organization_name} best practice`.
>`Platforms supported: GitHub` >`Platforms supported: GitHub`
'Auto best practices' is a novel Qodo Merge capability that: `Auto best practices` is a novel Qodo Merge capability that:
1. Identifies recurring patterns from accepted suggestions 1. Identifies recurring patterns from accepted suggestions
2. **Automatically** generates [best practices page](https://github.com/qodo-ai/pr-agent/wiki/.pr_agent_auto_best_practices) based on what your team consistently values 2. **Automatically** generates [best practices page](https://github.com/qodo-ai/pr-agent/wiki/.pr_agent_auto_best_practices) based on what your team consistently values
@ -315,17 +315,13 @@ code_suggestions_self_review_text = "... (your text here) ..."
### How many code suggestions are generated? ### How many code suggestions are generated?
Qodo Merge uses a dynamic strategy to generate code suggestions based on the size of the pull request (PR). Here's how it works: Qodo Merge uses a dynamic strategy to generate code suggestions based on the size of the pull request (PR). Here's how it works:
1) Chunking large PRs: #### 1. Chunking large PRs
- Qodo Merge divides large PRs into 'chunks'. - Qodo Merge divides large PRs into 'chunks'.
- Each chunk contains up to `pr_code_suggestions.max_context_tokens` tokens (default: 14,000). - Each chunk contains up to `pr_code_suggestions.max_context_tokens` tokens (default: 14,000).
#### 2. Generating suggestions
2) Generating suggestions:
- For each chunk, Qodo Merge generates up to `pr_code_suggestions.num_code_suggestions_per_chunk` suggestions (default: 4). - For each chunk, Qodo Merge generates up to `pr_code_suggestions.num_code_suggestions_per_chunk` suggestions (default: 4).
This approach has two main benefits: This approach has two main benefits:
- Scalability: The number of suggestions scales with the PR size, rather than being fixed. - Scalability: The number of suggestions scales with the PR size, rather than being fixed.

View File

@ -18,7 +18,7 @@ The tool will generate code suggestions for the selected component (if no compon
![improve_component2](https://codium.ai/images/pr_agent/improve_component2.png){width=768} ![improve_component2](https://codium.ai/images/pr_agent/improve_component2.png){width=768}
**Notes** !!! note "Notes"
- Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#. - Language that are currently supported by the tool: Python, Java, C++, JavaScript, TypeScript, C#.
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool. - This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.

View File

@ -16,14 +16,17 @@ It can be invoked manually by commenting on any PR:
Note that to perform retrieval, the `similar_issue` tool indexes all the repo previous issues (once). Note that to perform retrieval, the `similar_issue` tool indexes all the repo previous issues (once).
### Selecting a Vector Database
Configure your preferred database by changing the `pr_similar_issue` parameter in `configuration.toml` file.
**Select VectorDBs** by changing `pr_similar_issue` parameter in `configuration.toml` file #### Available Options
Choose from the following Vector Databases:
2 VectorDBs are available to switch in
1. LanceDB 1. LanceDB
2. Pinecone 2. Pinecone
To enable usage of the '**similar issue**' tool for Pinecone, you need to set the following keys in `.secrets.toml` (or in the relevant environment variables): #### Pinecone Configuration
To use Pinecone with the `similar issue` tool, add these credentials to `.secrets.toml` (or set as environment variables):
``` ```
[pinecone] [pinecone]

View File

@ -17,8 +17,8 @@ The tool will generate tests for the selected component (if no component is stat
(Example taken from [here](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429)): (Example taken from [here](https://github.com/Codium-ai/pr-agent/pull/598#issuecomment-1913679429)):
**Notes** <br> !!! notes "Notes"
- The following languages are currently supported: Python, Java, C++, JavaScript, TypeScript, C#. <br> - The following languages are currently supported: Python, Java, C++, JavaScript, TypeScript, C#.
- This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool. - This tool can also be triggered interactively by using the [`analyze`](./analyze.md) tool.

View File

@ -14,12 +14,12 @@ Examples of invoking the different tools via the CLI:
**Notes:** **Notes:**
(1) in addition to editing your local configuration file, you can also change any configuration value by adding it to the command line: 1. in addition to editing your local configuration file, you can also change any configuration value by adding it to the command line:
``` ```
python -m pr_agent.cli --pr_url=<pr_url> /review --pr_reviewer.extra_instructions="focus on the file: ..." python -m pr_agent.cli --pr_url=<pr_url> /review --pr_reviewer.extra_instructions="focus on the file: ..."
``` ```
(2) You can print results locally, without publishing them, by setting in `configuration.toml`: 2. You can print results locally, without publishing them, by setting in `configuration.toml`:
``` ```
[config] [config]
publish_output=false publish_output=false
@ -27,14 +27,11 @@ verbosity_level=2
``` ```
This is useful for debugging or experimenting with different tools. This is useful for debugging or experimenting with different tools.
(3) 3. **git provider**: The [git_provider](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L5) field in a configuration file determines the GIT provider that will be used by Qodo Merge. Currently, the following providers are supported:
**git provider**: The [git_provider](https://github.com/Codium-ai/pr-agent/blob/main/pr_agent/settings/configuration.toml#L5) field in a configuration file determines the GIT provider that will be used by Qodo Merge. Currently, the following providers are supported:
` `
"github", "gitlab", "bitbucket", "azure", "codecommit", "local", "gerrit" "github", "gitlab", "bitbucket", "azure", "codecommit", "local", "gerrit"
` `.
Default is "github".
### CLI Health Check ### CLI Health Check
To verify that Qodo Merge has been configured correctly, you can run this health check command from the repository root: To verify that Qodo Merge has been configured correctly, you can run this health check command from the repository root:

View File

@ -189,18 +189,18 @@ key = ...
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: 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: 1. Set the model name in the configuration file:
``` ```
[config] [config]
model="custom_model_name" model="custom_model_name"
fallback_models=["custom_model_name"] fallback_models=["custom_model_name"]
``` ```
(2) Set the maximal tokens for the model: 2. Set the maximal tokens for the model:
``` ```
[config] [config]
custom_model_max_tokens= ... custom_model_max_tokens= ...
``` ```
(3) Go to [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms), find the model you want to use, and set the relevant environment variables. 3. Go to [litellm documentation](https://litellm.vercel.app/docs/proxy/quick_start#supported-llms), find the model you want to use, and set the relevant environment variables.
(4) Most reasoning models do not support chat-style inputs (`system` and `user` messages) or temperature settings. 4. Most reasoning models do not support chat-style inputs (`system` and `user` messages) or temperature settings.
To bypass chat templates and temperature controls, set `config.custom_reasoning_model = true` in your configuration file. To bypass chat templates and temperature controls, set `config.custom_reasoning_model = true` in your configuration file.