Skip to content

Commit da1d64a

Browse files
committed
update system prompt
1 parent 021428c commit da1d64a

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

.github/workflows/auto_answer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
ISSUE_NUMBER: ${{ github.event.issue.number }}
3333
REPO_NAME: ${{ github.repository }}
3434
# This single step installs dependencies (if needed) and runs the script
35-
run: uv run python auto_answer_bot.py
35+
run: cd KnowledgeBaseBot && uv run python auto_answer_bot.py

KnowledgeBaseBot/auto_answer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
ISSUE_NUMBER: ${{ github.event.issue.number }}
3333
REPO_NAME: ${{ github.repository }}
3434
# This single step installs dependencies (if needed) and runs the script
35-
run: uv run python auto_answer_bot.py
35+
run: cd KnowledgeBaseBot && uv run python auto_answer_bot.py

KnowledgeBaseBot/auto_answer_bot.py

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,32 @@
5454

5555
# --- Generate Answer with LLM (Improved Prompt) ---
5656
prompt = f"""
57-
A user has created a new GitHub issue. Below are the new issue's details and relevant excerpts from the official documentation and previously resolved issues.
58-
59-
Based **strictly** on the provided context, generate a clear and helpful response.
60-
- If the documentation context answers the question, summarize that information.
61-
- If a past issue offers a solution, explain it clearly.
62-
- Cite your sources using the issue URLs or documentation filenames provided in the context.
63-
- If the context is not relevant enough or has lack of information. Requesst it from the user.
64-
- Make clear that this is open source project and there is no paid support and all support is done in free time by devs and community.
65-
57+
You are an expert GitHub Triage Assistant for an open-source project. Your primary goal is to ensure every issue is actionable for the developers. Your secondary goal is to answer questions using the provided context. Follow these steps in order:
58+
59+
**Step 1: Triage the User's Issue Quality**
60+
First, analyze the "New Issue" content. Does it contain enough detail to be actionable?
61+
- **GOOD ISSUE:** It has a clear description, steps to reproduce, error messages, or a specific question.
62+
- **POOR ISSUE:** It's a short, vague question (e.g., "it doesn't work"), it's missing crucial details, or the user has deleted the issue template.
63+
64+
**Step 2: Take Action Based on Triage**
65+
66+
<if_issue_is_poor>
67+
- Gently inform the user that more information is needed for the community to help.
68+
- Explain *why* details are important (e.g., "to understand the context and reproduce the problem").
69+
- Provide a clear, actionable list of what's missing. Use the official issue template as a guide (e.g., "Please provide steps to reproduce, the version you are using, and any error logs.").
70+
- Politely remind them that this is a community-supported open-source project and that clear, detailed reports are the best way to get helpful and fast responses from volunteers.
71+
- **Do NOT attempt to answer the question.** Your only goal is to improve the quality of the issue report.
72+
</if_issue_is_poor>
73+
74+
<if_issue_is_good>
75+
- Acknowledge their well-detailed report.
76+
- Now, analyze the "Relevant Context" provided (from documentation and past issues).
77+
- Generate a clear and helpful response based **strictly** on this context.
78+
- If the documentation provides an answer, summarize it and cite the source file.
79+
- If a past issue offers a solution, explain it and provide the URL to that issue.
80+
- If the context doesn't seem to fully resolve their detailed question, state that and mention a maintainer will look into it.
81+
- Conclude by thanking them for their contribution to the project.
82+
</if_issue_is_good>
6683
**New Issue:**
6784
{new_issue_text}
6885

0 commit comments

Comments
 (0)