Skip to content

Commit

Permalink
fix: optimize prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Feb 4, 2024
1 parent 7610169 commit cd20221
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/ai/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ export interface SprintFestivalCouplets {

export async function getCouplets(couplet: string) {
const tooltip = [
'请根据我的提示生成一组春联,包含上联、下联各一句,每句字数在五到十三字之间,并附上一个恰当的不超过五个字的横批。',
'请根据我的提示生成一组春联,包含上联、下联各一句,每句字数在五到十三字之间,上下联字数相同,并附上一个恰当的不超过五个字的横批。',
'并给出一个字总结。',
'不需要标点符号,尽量不要使用生僻字。',
'以可以被 JSON.parse 解析的字符串格式给出,务必不要生成多余文本。',
`参考 TS 类型:export interface SprintFestivalCouplets {
上联: string
下联: string
横批: string
总结: string
`格式类型:{
"上联": "",
"下联": "",
"横批": "",
"总结": ""
}`,
'直接给出可以被 JSON.parse 解析的字符串,不需要解释内容。',
]

const messages: OpenAI.ChatCompletionMessageParam[] = [
Expand Down

0 comments on commit cd20221

Please sign in to comment.