-
Notifications
You must be signed in to change notification settings - Fork 852
Refine built-in prompts #866
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
The head ref may contain hidden characters: "codex/\u5F37\u5316\u5167\u5EFA-prompt-\u4F7F\u7528\u6280\u5DE7"
Conversation
WalkthroughThe changes update prompt strings across multiple content generation and site adapter modules to be more explicit, detailed, and professional. Each prompt now clearly defines the role, expected output format, and focus areas for summarization, translation, explanation, or analysis tasks. No changes were made to exported entities, control flow, or error handling. Changes
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (14)
✅ Files skipped from review due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (2)
🔇 Additional comments (8)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to cda5ce2
Previous suggestionsSuggestions up to commit f198be7
✅ Suggestions up to commit 1bc643b
✅ Suggestions up to commit 6e0e6d5
|
|||||||||||||||||||||||||||||||||||||||||||||||
|
@coderabbitai, please give me a code suggestion patch based on Qodo's suggestion so that I can directly apply it. |
|
Tip For best results, initiate chat on the files or code changes. @PeterDaveHello, here's a patch based on Qodo's suggestion to fix the inconsistent punctuation in the bidirectional translation logic: diff --git a/src/content-script/selection-tools/index.mjs b/src/content-script/selection-tools/index.mjs
index 1234567..abcdefg 100644
--- a/src/content-script/selection-tools/index.mjs
+++ b/src/content-script/selection-tools/index.mjs
@@ -27,10 +27,10 @@ const configs = [
genPrompt: async (selection) => {
let fullMessage = isTranslation
- ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result`
+ ? `You are a professional translator. Translate the following text into ${preferredLanguage}, preserving meaning, tone, and formatting. Only provide the translated result.`
: message
if (enableBidirectional) {
- fullMessage += `. If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
+ fullMessage += ` If it is already in ${preferredLanguage}, translate it into English and only show me the translated content.`
}
return fullMessage + ':\n\n' + selection
},You can save this as a 🐰📝 |
|
@coderabbitai use PR Review function with suggestion block for the patch. |
|
Tip For best results, initiate chat on the files or code changes. @PeterDaveHello, here's the punctuation fix in a proper suggestion block format: src/content-script/selection-tools/index.mjs This fixes the inconsistent punctuation by:
This ensures proper sentence flow when both parts are combined. |
|
I spent several hours teaching Codex how to improve the prompt, but I didn’t expect it wouldn’t even know how to name the title and branch... It seems I still have to manually revise everything to save trouble. |
|
@coderabbitai, can you create a commit in the current branch based on Qodo's suggestion? I believe that's something you can do. |
|
Tip For best results, initiate chat on the files or code changes. @PeterDaveHello, I understand your request, but I'm not able to directly commit code to the repository. However, I can plan the code changes based on Qodo's suggestion, and another agent will execute the actual commit for you. Task: Fix punctuation inconsistency in bidirectional translation logic
The planning agent will now create a commit with this punctuation fix. This ensures proper sentence flow when the translation and bidirectional prompts are combined. ⏳ Preparing changes... |
|
A summary of the edits CodeRabbit can apply:
A plan of each step that CodeRabbit will take in order to execute the edits for each file (with inline rough draft snippets): ✏️ src/content-script/selection-tools/index.mjsLocate the ternary assignment of fullMessage at line 29. Replace the branch for isTranslation to include a trailing period. Use this suggestion block: Locate the enableBidirectional concatenation at line 32. Remove the leading period before "If" so that the sentence flows correctly. Use this suggestion block:
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
The built-in prompts under src/content-script/site-adapters/ haven't been handled, and Codex can't detect the changes we make here. In the end, I still have to go back to local to take care of all this...lol |
cda5ce2 to
021a7d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refines and expands the prompt instructions used across various content and selection tools to provide more detailed, role-based guidance for content analysis and summarization. Key changes include:
- Conversion of prompts from Chinese to detailed English instructions with expert roles.
- Enhanced clarity and structure in prompts for Q&A, video, article, commit, and forum content analysis.
- Consistent formatting improvements across all site adapter and selection tool modules.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/content-script/site-adapters/zhihu/index.mjs | Updated Zhihu Q&A prompts for clear analysis and summary output. |
| src/content-script/site-adapters/youtube/index.mjs | Refined YouTube video summarizing prompt with structured format. |
| src/content-script/site-adapters/weixin/index.mjs | Enhanced WeChat article analysis with detailed role instructions. |
| src/content-script/site-adapters/stackoverflow/index.mjs | Expanded Stack Overflow Q&A prompt for solution and overview. |
| src/content-script/site-adapters/reddit/index.mjs | Improved Reddit discussion analysis prompt with clear format. |
| src/content-script/site-adapters/quora/index.mjs | Clarified Quora Q&A discussion prompt with expert guidance. |
| src/content-script/site-adapters/juejin/index.mjs | Revised Juejin article analysis prompt with commentary summary. |
| src/content-script/site-adapters/gitlab/index.mjs | Enhanced GitLab file and commit analysis prompts with detailed tasks. |
| src/content-script/site-adapters/github/index.mjs | Updated GitHub issue/PR discussion prompts and commit message guidance. |
| src/content-script/site-adapters/followin/index.mjs | Improved prompt for article and long tweet summarization. |
| src/content-script/site-adapters/bilibili/index.mjs | Refined Bilibili video summarizing prompt with markdown formatting. |
| src/content-script/site-adapters/arxiv/index.mjs | Upgraded arXiv paper abstract analysis prompt with academic tone. |
| src/content-script/selection-tools/index.mjs | Broadened prompt functions for translation, explanation, and summarization. |
| src/content-script/menu-tools/index.mjs | Updated web page summarization prompt to provide expert analysis. |
Comments suppressed due to low confidence (1)
src/content-script/site-adapters/juejin/index.mjs:21
- If the variable 'comment' holds multiple comment elements, consider renaming it to 'comments' to better reflect its content. Additionally, ensure that if 'comment' is an array, it is properly joined or formatted before being injected into the prompt.
comment += `answer${i}: ${comment[i - 1].textContent}|`
User description
Summary
Testing
npm cinpm run linthttps://chatgpt.com/codex/tasks/task_e_684441aa5a5083279adf7f2e74f77485
PR Type
Enhancement
Description
Enhanced prompt instructions for all selection tools
Refined web page summarization prompt for clarity
Changes walkthrough 📝
index.mjs
Refine web page summarization prompt for claritysrc/content-script/menu-tools/index.mjs
index.mjs
Expand and clarify prompts for all selection toolssrc/content-script/selection-tools/index.mjs
bidirectional logic
design rationale
better output
Summary by CodeRabbit
New Features
Style