Skip to content

@sylis/api v0.0.1


@sylis/api / modules/ai/prompts/reading-prompts / ReadingPrompts

Class: ReadingPrompts

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:6

阅读文章生成提示词模板

Constructors

Constructor

new ReadingPrompts(): ReadingPrompts

Returns

ReadingPrompts

Properties

DIFFICULTY_GUIDE

readonly static DIFFICULTY_GUIDE: object

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:10

难度指南

easy

easy: string = '使用简单的句型结构,避免复杂的语法,词汇量控制在初中水平'

hard

hard: string = '可以使用复杂的句型结构和高级词汇,适合高级英语学习者'

medium

medium: string = '使用中等复杂度的句型,词汇量控制在高中到大学水平'


LENGTH_GUIDE

readonly static LENGTH_GUIDE: object

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:19

长度指南

long

long: string = '400-600词'

medium

medium: string = '200-400词'

short

short: string = '100-200词'


SYSTEM_PROMPT_TEMPLATE

readonly static SYSTEM_PROMPT_TEMPLATE: "你是一位专业的英语教学内容创作专家,擅长创作高质量的阅读材料。\n\n任务要求:\n1. 文章类型:\n2. 难度水平: - \n3. 文章长度:\n4. 必须自然地融入所有给定的单词,让它们在语境中显得自然合理\n5. 文章要有吸引力,内容有趣且富有教育意义\n6. 语法正确,表达地道\n\n输出格式要求:\n请严格按照以下JSON格式输出:\n```json\n{\n "title": "文章标题",\n "content": "文章正文内容",\n "wordCount": 实际字数,\n "difficulty": "",\n "usedWords": ["使用的单词列表"]\n}\n```\n\n注意事项:\n- 标题要简洁有吸引力\n- 正文要连贯流畅,逻辑清晰\n- 所有给定单词都必须在文章中出现至少一次\n- usedWords数组包含实际在文章中使用的给定单词\n- 不要添加任何额外的解释文字,只输出JSON数据"

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:38

系统提示词模板


TYPE_GUIDE

readonly static TYPE_GUIDE: object

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:28

文章类型指南

conversation

conversation: string = '创作一段对话,自然流畅'

essay

essay: string = '写一篇议论文或说明文,逻辑清晰'

news

news: string = '撰写一篇新闻报道,包含关键信息和客观描述'

story

story: string = '编写一个有趣的故事,包含完整的情节发展'


USER_PROMPT_TEMPLATE

readonly static USER_PROMPT_TEMPLATE: "请使用以下单词创作一篇阅读文章:\n\n\n\n要求:\n1. 所有单词都必须自然地融入到文章中\n2. 文章要有完整的结构和清晰的逻辑\n3. 内容要有趣且具有教育价值\n4. 严格按照要求的JSON格式输出"

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:70

用户提示词模板

Methods

buildSystemPrompt()

static buildSystemPrompt(params): string

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:83

构建系统提示词

Parameters

params
articleType?

"story" | "news" | "essay" | "conversation"

difficulty

"easy" | "medium" | "hard"

length?

"medium" | "short" | "long"

Returns

string


buildUserPrompt()

static buildUserPrompt(params): string

Defined in: apps/api/src/modules/ai/prompts/reading-prompts.ts:102

构建用户提示词

Parameters

params
theme?

string

words

object[]

Returns

string