MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / formatFinishReasonHint

Function formatFinishReasonHint

packages/kosong/src/generate.ts:321–332  ·  view source on GitHub ↗
(stream: StreamedMessage)

Source from the content-addressed store, hash-verified

319}
320
321function formatFinishReasonHint(stream: StreamedMessage): string {
322 if (stream.finishReason === null && stream.rawFinishReason === null) return '';
323
324 const raw =
325 stream.rawFinishReason === null ? '' : `, rawFinishReason=${stream.rawFinishReason}`;
326 const filteredHint =
327 stream.finishReason === 'filtered'
328 ? ' The provider filtered the response before visible output was emitted.'
329 : '';
330
331 return ` Provider stop details: finishReason=${stream.finishReason ?? 'unknown'}${raw}.${filteredHint}`;
332}
333
334/**
335 * Produce a shallow-ish copy of a StreamedMessagePart.

Callers 1

generateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected