MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / buildSummaryPrompt

Function buildSummaryPrompt

packages/node-runtime/src/ai/summary/index.ts:179–190  ·  view source on GitHub ↗
(content: string, lengthLimit: number, locale: string, strategy: SummaryStrategy)

Source from the content-addressed store, hash-verified

177// ==================== Prompt builders ====================
178
179function buildSummaryPrompt(content: string, lengthLimit: number, locale: string, strategy: SummaryStrategy): string {
180 if (strategy === 'brief') {
181 if (locale.startsWith('zh')) {
182 return `请用简洁的语言(${lengthLimit}字以内)总结以下对话的主要内容或话题。只输出摘要内容,不要添加任何前缀、解释或引号。\n\n${content}`
183 }
184 return `Summarize the following conversation concisely (max ${lengthLimit} characters). Output only the summary, no prefix, explanation, or quotes.\n\n${content}`
185 }
186 if (locale.startsWith('zh')) {
187 return `请总结以下聊天记录(${lengthLimit}字以内),需包含:谁参与了讨论、讨论了什么事情、关键细节和结论。用2-4句话描述,不要罗列每条消息。只输出摘要内容,不要添加任何前缀、解释或引号。\n\n${content}`
188 }
189 return `Summarize the following chat log (max ${lengthLimit} characters). Include: who participated, what was discussed, key details and conclusions. Use 2-4 sentences, don't list individual messages. Output only the summary, no prefix, explanation, or quotes.\n\n${content}`
190}
191
192function buildSubSummaryPrompt(content: string, locale: string, strategy: SummaryStrategy): string {
193 const limit = strategy === 'brief' ? 50 : 100

Callers 1

generateSessionSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected