From 2eeb9b041130fd4816e2e27026bf6a52b04c7c63 Mon Sep 17 00:00:00 2001 From: mrT23 Date: Sun, 25 May 2025 14:59:18 +0300 Subject: [PATCH] fix: improve Mermaid diagram formatting and instructions in PR description template --- pr_agent/settings/pr_description_prompts.toml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pr_agent/settings/pr_description_prompts.toml b/pr_agent/settings/pr_description_prompts.toml index 934b30da..81cb0afb 100644 --- a/pr_agent/settings/pr_description_prompts.toml +++ b/pr_agent/settings/pr_description_prompts.toml @@ -47,7 +47,7 @@ class PRDescription(BaseModel): description: str = Field(description="summarize the PR changes in up to four bullet points, each up to 8 words. For large PRs, add sub-bullets if needed. Order bullets by importance, with each bullet highlighting a key change group.") title: str = Field(description="a concise and descriptive title that captures the PR's main theme") {%- if enable_pr_diagram %} - changes_diagram: str = Field(description="a horizontal diagram that represents the main PR changes, in the format of a mermaid flowchart. The diagram should be concise and easy to read. Leave empty if no diagram is relevant.") + changes_diagram: str = Field(description="a horizontal diagram that represents the main PR changes, in the format of a valid mermaid LR flowchart. The diagram should be concise and easy to read. Leave empty if no diagram is relevant. To create robust Mermaid diagrams, follow this two-step process: (1) Declare first the nodes: nodeID['Node Label']. (2) Then define the links: nodeID1 -- 'link text' --> nodeID2 ") {%- endif %} {%- if enable_semantic_files_types %} pr_files: List[FileDescription] = Field(max_items=20, description="a list of all the files that were changed in the PR, and summary of their changes. Each file must be analyzed regardless of change size.") @@ -68,7 +68,8 @@ title: | {%- if enable_pr_diagram %} changes_diagram: | ```mermaid - ... + flowchart LR + ... ``` {%- endif %} {%- if enable_semantic_files_types %} @@ -155,7 +156,8 @@ title: | {%- if enable_pr_diagram %} changes_diagram: | ```mermaid - ... + flowchart LR + ... ``` {%- endif %} {%- if enable_semantic_files_types %}