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

Function buildMergePrompt

packages/node-runtime/src/ai/summary/index.ts:200–217  ·  view source on GitHub ↗
(
  subSummaries: string[],
  lengthLimit: number,
  locale: string,
  strategy: SummaryStrategy
)

Source from the content-addressed store, hash-verified

198}
199
200function buildMergePrompt(
201 subSummaries: string[],
202 lengthLimit: number,
203 locale: string,
204 strategy: SummaryStrategy
205): string {
206 const list = subSummaries.map((s, i) => `${i + 1}. ${s}`).join('\n')
207 if (strategy === 'brief') {
208 if (locale.startsWith('zh')) {
209 return `以下是一段对话的多个片段摘要,请将它们合并成一个完整的总结(${lengthLimit}字以内)。只输出摘要内容,不要添加任何前缀、解释或引号。\n\n${list}`
210 }
211 return `Below are summaries of different parts of a conversation. Merge them into one cohesive summary (max ${lengthLimit} characters). Output only the summary, no prefix or quotes.\n\n${list}`
212 }
213 if (locale.startsWith('zh')) {
214 return `以下是一段对话的多个片段摘要,请将它们合并成一个完整的总结(${lengthLimit}字以内)。保留参与者、事件和关键细节。只输出摘要内容,不要添加任何前缀、解释或引号。\n\n${list}`
215 }
216 return `Below are summaries of different parts of a conversation. Merge them into one cohesive summary (max ${lengthLimit} characters). Preserve participants, events, and key details. Output only the summary, no prefix or quotes.\n\n${list}`
217}
218
219// ==================== Post-processing ====================
220

Callers 1

generateSessionSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected