feat: integrate pinned teacher discussion workspace

This commit is contained in:
鲨鱼辣椒
2026-09-23 19:13:51 +08:00
parent 7951cca700
commit 404cfcde46
21 changed files with 1666 additions and 11 deletions

View File

@@ -46,7 +46,8 @@ export function compileTeacherContext(
question: string,
references: TeacherReference[],
maxInputTokens = definition.limits.max_input_tokens,
intent: TeacherRequestIntent = 'question'
intent: TeacherRequestIntent = 'question',
presentationInstructions?: string
) {
const system: TeacherModelMessage = {
role: 'system',
@@ -79,7 +80,7 @@ export function compileTeacherContext(
]
: intent === 'guided-help'
? [
'本轮交互要求(仅本轮):学生暂时说不清想问什么。依据当前来源操作对话和本咨询历史,只发起一个具体、容易回答的交流起点,帮助学生开口。用正常、简短的中文文字回答,不返回 JSON,不列出多个问题或一串任务。没有可用上下文时,坦诚从构思切入,不假定学生已经完成了任何功能。',
'本轮交互要求(仅本轮):学生暂时说不清想问什么。依据当前来源操作对话和本咨询历史,只发起一个具体、容易回答的交流起点,帮助学生开口。' + (presentationInstructions ? '按本轮界面协议返回,reply使用简短中文,' : '用正常、简短的中文文字回答,不返回 JSON,') + '不列出多个问题或一串任务。没有可用上下文时,坦诚从构思切入,不假定学生已经完成了任何功能。',
]
: []),
].join('\n\n'),
@@ -116,6 +117,7 @@ export function compileTeacherContext(
].join('\n\n'),
},
]),
...(presentationInstructions ? [{ role: 'system' as const, content: presentationInstructions }] : []),
current,
];
while (estimateTeacherTokens(build()) > maxInputTokens && sourceMessages.length) {