feat: enhance grammar checking functionality in DocumentSchema and DocumentService
- Updated the 'testCheckGrammar' field in DocumentSchema to accept additional arguments: documentId, pageId, and promptType, allowing for more flexible grammar checking options. - Modified the checkGrammarForPage method in DocumentService to utilize the new promptType argument, enabling different processing types (CHECK_GRAMMAR, REWRITE_TEXT, etc.) for grammar checks. - Improved logging for better debugging and tracking of grammar check results. These changes enhance the document editing experience by providing more robust grammar checking capabilities and leveraging AI for various text processing tasks.
This commit is contained in:
@@ -20,12 +20,14 @@ const prompts = {
|
||||
REWRITE_TEXT: `You will be provided with text delimited by triple quotes.
|
||||
Rewrite the text to improve clarity, conciseness, and overall readability.
|
||||
Maintain the original meaning and tone of the text.
|
||||
If the text is already well-written, return it as is.
|
||||
Return the text within triple quotes.
|
||||
If the text is already well-written, return back the text delimited by triple quotes.
|
||||
\"\"\"{text}\"\"\"
|
||||
`,
|
||||
SUMMARIZE: `You will be provided with text delimited by triple quotes.
|
||||
Create a concise summary that captures the key points and main ideas of the text.
|
||||
The summary should be clear, objective, and no longer than 3-4 sentences.
|
||||
If the text is already well-written, return back the text delimited by triple quotes.
|
||||
\"\"\"{text}\"\"\"
|
||||
`,
|
||||
TRANSLATE: `You will be provided with text delimited by triple quotes and a target language.
|
||||
|
||||
Reference in New Issue
Block a user