mirror of
https://github.com/JOYCEQL/magic-resume.git
synced 2026-07-03 14:07:11 +02:00
fix: ai grammar check
This commit is contained in:
@@ -19,8 +19,7 @@ export async function POST(req: NextRequest) {
|
||||
{
|
||||
role: "system",
|
||||
content: `你是一个专业的中文简历语法检查助手。请完整检查以下文本中的语法语境错别字,包括:
|
||||
1. 只考虑语法环境中的错别字
|
||||
2. 标点符号使用错误
|
||||
1. 只考虑语法组词中的错别字
|
||||
|
||||
对每个发现的问题,请以JSON格式返回,格式如下:
|
||||
{
|
||||
|
||||
@@ -4,6 +4,7 @@ import { getLocale, getMessages, getTranslations } from "next-intl/server";
|
||||
import { ReactNode } from "react";
|
||||
import Document from "@/components/Document";
|
||||
import { Providers } from "@/app/providers";
|
||||
import { Toaster } from "@/components/ui/sonner";
|
||||
type Props = {
|
||||
children: ReactNode;
|
||||
params: {
|
||||
@@ -27,6 +28,7 @@ export default async function LocaleLayout({ children }: Props) {
|
||||
<Document locale={locale}>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
<Providers>{children}</Providers>
|
||||
<Toaster position="top-center" richColors />
|
||||
</NextIntlClientProvider>
|
||||
</Document>
|
||||
);
|
||||
|
||||
@@ -69,8 +69,6 @@ export const useGrammarStore = create<GrammarStore>((set, get) => ({
|
||||
|
||||
try {
|
||||
const grammarErrors = JSON.parse(aiResponse);
|
||||
console.log(grammarErrors, "grammarErrors");
|
||||
toast.success("语法检查完成");
|
||||
if (grammarErrors.errors.length === 0) {
|
||||
toast.success("无语法错误");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user