(content: string, lengthLimit: number, locale: string, strategy: SummaryStrategy)
| 177 | // ==================== Prompt builders ==================== |
| 178 | |
| 179 | function 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 | |
| 192 | function buildSubSummaryPrompt(content: string, locale: string, strategy: SummaryStrategy): string { |
| 193 | const limit = strategy === 'brief' ? 50 : 100 |
no outgoing calls
no test coverage detected