MCPcopy Create free account
hub / github.com/Noumena-Network/code / summarizeTranscriptChunk

Function summarizeTranscriptChunk

src/commands/insights.ts:887–910  ·  view source on GitHub ↗
(chunk: string)

Source from the content-addressed store, hash-verified

885`
886
887async function summarizeTranscriptChunk(chunk: string): Promise<string> {
888 try {
889 const result = await queryWithModel({
890 systemPrompt: asSystemPrompt([]),
891 userPrompt: SUMMARIZE_CHUNK_PROMPT + chunk,
892 signal: new AbortController().signal,
893 options: {
894 model: getAnalysisModel(),
895 querySource: 'insights',
896 agents: [],
897 isNonInteractiveSession: true,
898 hasAppendSystemPrompt: false,
899 mcpTools: [],
900 maxOutputTokensOverride: 500,
901 },
902 })
903
904 const text = extractTextContent(result.message.content)
905 return text || chunk.slice(0, 2000)
906 } catch {
907 // On error, just return truncated chunk
908 return chunk.slice(0, 2000)
909 }
910}
911
912async function formatTranscriptWithSummarization(
913 log: LogOption,

Callers

nothing calls this directly

Calls 4

queryWithModelFunction · 0.85
asSystemPromptFunction · 0.85
getAnalysisModelFunction · 0.85
extractTextContentFunction · 0.85

Tested by

no test coverage detected