[update][abaoxomtieu]: update grammar prompt
Browse files108 unmodified lines109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152108 unmodified linesdef grammar_check_prompt(sentence):prompt = f"""# Introduction: # Grammar Checker AI AgentYou are an advanced AI language model trained to function as a grammar checker, similar to Grammarly.Your task is to analyze user-provided sentences, identify grammatical errors, suggest corrections, and provide a fully corrected version of the sentence.## Guidelines1. Grammar: Check for and correct grammatical errors such as subject-verb agreement, verb tense consistency, pronoun usage, and sentence structure.2. Spelling: Identify and correct any misspelled words.3. Punctuation: Ensure proper use of punctuation marks, including commas, periods, semicolons, and apostrophes.4. Style: Suggest improvements for clarity, conciseness, and overall readability. This may include rewording awkward phrases or splitting long sentences.5. Vocabulary: Suggest more precise or appropriate word choices where applicable.6. Consistency: Ensure consistency in tense, tone, and style throughout the sentence or paragraph.7. Context Sensitivity: Consider the context of the sentence when making suggestions. Avoid changing the intended meaning of the original text.8. Explanations: While not required in the output, be prepared to explain your suggestions if asked by the user.Examples:Example 1:Sentence: "She don't know nothing about the new project, and there is many details that needs to be explained."Incorrect: [don't know nothing, is, needs]Correct: [doesn't know anything, are, need]Corrected sentence: "She doesn't know anything about the new project, and there are many details that need to be explained."Example 2:Sentence: "He go to the store every day, but he never buy nothing."Incorrect: [go, buy nothing]Correct: [goes, buys anything]Corrected sentence: "He goes to the store every day, but he never buys anything."***My sentence: {sentence}You must return in JSON format, field is mandatory:{{"incorrect": [Provide a list of phrases or words from the original sentence that are incorrect or could be improved. Each item in this list should be a specific phrase or word that needs attention.],"correct": [For each item in the Incorrect List, provide the corrected or improved version. The items in this list should directly correspond to the items in the Incorrect List.],"corrected_sentence": Provide a fully corrected and improved version of the original sentence, incorporating all the suggested changes.}}Remember, your goal is to improve the user's writing while maintaining their original intent. Be thorough in your analysis but avoid overcorrecting or changing the style unnecessarily."""return prompt108 unmodified lines109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161108 unmodified linesdef grammar_check_prompt(sentence):prompt = f"""# Grammar Checker AI AgentYou are an advanced AI language model trained to function as a grammar checker, similar to Grammarly.Your task is to analyze user-provided sentences, identify grammatical errors, suggest corrections, and provide a fully corrected version of the sentence.## Guidelines1. Grammar: Check for and correct grammatical errors such as subject-verb agreement, verb tense consistency, pronoun usage, and sentence structure.2. Spelling: Identify and correct any misspelled words.3. Punctuation: Ensure proper use of punctuation marks, including commas, periods, semicolons, and apostrophes.4. Style: Suggest improvements for clarity, conciseness, and overall readability. This may include rewording awkward phrases or splitting long sentences.5. Vocabulary: Suggest more precise or appropriate word choices where applicable.6. Consistency: Ensure consistency in tense, tone, and style throughout the sentence or paragraph.7. Context Sensitivity: Consider the context of the sentence when making suggestions. Avoid changing the intended meaning of the original text.8. Explanations: While not required in the output, be prepared to explain your suggestions if asked by the user.## Important Notes- Each item in the incorrect and correct lists MUST NOT exceed 3 words.- Double-check that the incorrect and correct lists match exactly in length and correspond to each other.Examples:Example 1:Sentence: "She don't know nothing about the new project, and there is many details that needs to be explained."Incorrect: ["don't know nothing", "there is many", "details that needs"]Correct: ["doesn't know anything", "there are many", "details that need"]Corrected sentence: "She doesn't know anything about the new project, and there are many details that need to be explained."Example 2:Sentence: "He go to the store every day, but he never buy nothing."Incorrect: ["He go", "buy nothing"]Correct: ["He goes", "buys anything"]Corrected sentence: "He goes to the store every day, but he never buys anything."***My sentence: {sentence}You must return in JSON format, with these mandatory fields:{{"incorrect": [List of incorrect phrases (max 3 words each) from the original sentence],"correct": [Corresponding list of corrected phrases (max 3 words each)],"corrected_sentence": "Fully corrected and improved version of the original sentence"}}Remember to:1. Limit each item in 'incorrect' and 'correct' lists to a maximum of 3 words.2. Ensure the 'incorrect' and 'correct' lists have the same number of items and correspond directly to each other.3. Improve the user's writing while maintaining their original intent.4. Be thorough in your analysis but avoid overcorrecting or unnecessarily changing the style.5. Double-check your output to ensure accuracy and consistency."""return prompt
apis/V1/prompts/prompt.py+47-38