diff --git a/next/api/src/service/openai.ts b/next/api/src/service/openai.ts index e1ba41163..5d48a066b 100644 --- a/next/api/src/service/openai.ts +++ b/next/api/src/service/openai.ts @@ -14,7 +14,9 @@ export const TicketClassifyPrompt = (categories: Category[]) => ` """ 以下是各种分类的 ID 以及他们的含义,由 '-' 开头,每个占一行: ${categories - .map(({ id, meta }) => meta?.aiDescription && `- ${id}:${meta.aiDescription}`) + .map( + ({ id, meta, hidden }) => !hidden && !!meta?.aiDescription && `- ${id}:${meta.aiDescription}` + ) .filter(Boolean) .join('\n')} `; diff --git a/next/web/src/App/Admin/Settings/Categories/CategoryForm.tsx b/next/web/src/App/Admin/Settings/Categories/CategoryForm.tsx index a70c0f89b..4e781470d 100644 --- a/next/web/src/App/Admin/Settings/Categories/CategoryForm.tsx +++ b/next/web/src/App/Admin/Settings/Categories/CategoryForm.tsx @@ -58,7 +58,7 @@ const CategoryMetaOptions: MetaOptionsGroup[] = [ key: 'aiDescription', label: 'AI 分类描述', type: 'text', - predicate: (v) => !v.alias, + predicate: (v) => !v.alias || !!v.parentId, description: '描述的详细与否会影响 AI 帮助用户进行分类的准确度,为空时代表此分类不参与 AI 分类', },