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

Function postProcessSummary

packages/node-runtime/src/ai/summary/index.ts:221–231  ·  view source on GitHub ↗
(summary: string, lengthLimit: number)

Source from the content-addressed store, hash-verified

219// ==================== Post-processing ====================
220
221function postProcessSummary(summary: string, lengthLimit: number): string {
222 let result = summary
223 if ((result.startsWith('"') && result.endsWith('"')) || (result.startsWith('「') && result.endsWith('」'))) {
224 result = result.slice(1, -1)
225 }
226 const hardLimit = Math.floor(lengthLimit * 1.5)
227 if (result.length > hardLimit) {
228 result = result.slice(0, hardLimit - 3) + '...'
229 }
230 return result
231}
232
233// ==================== Public API ====================
234

Callers 1

generateSessionSummaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected