Skip to content

Commit

Permalink
perf(next): ai desc input show on product which is not root (#930)
Browse files Browse the repository at this point in the history
  • Loading branch information
NotEvenANeko authored Jul 21, 2023
1 parent c3e541a commit 4779235
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion next/api/src/service/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')}
`;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const CategoryMetaOptions: MetaOptionsGroup<CategorySchema>[] = [
key: 'aiDescription',
label: 'AI 分类描述',
type: 'text',
predicate: (v) => !v.alias,
predicate: (v) => !v.alias || !!v.parentId,
description:
'描述的详细与否会影响 AI 帮助用户进行分类的准确度,为空时代表此分类不参与 AI 分类',
},
Expand Down

0 comments on commit 4779235

Please sign in to comment.