MCPcopy Create free account
hub / github.com/apache/maka / rawFinishReasonString

Function rawFinishReasonString

packages/runtime/src/model-protocol.ts:291–297  ·  view source on GitHub ↗
(reason: unknown)

Source from the content-addressed store, hash-verified

289}
290
291export function rawFinishReasonString(reason: unknown): string | undefined {
292 if (typeof reason === 'string') return reason;
293 if (!reason || typeof reason !== 'object') return undefined;
294 const value = reason as { raw?: unknown; unified?: unknown };
295 if (typeof value.raw === 'string') return value.raw;
296 return typeof value.unified === 'string' ? value.unified : undefined;
297}
298
299/**
300 * Normalized provider finish reason as a Maka-owned string. The raw AI SDK

Callers 9

chunkFinishReasonFunction · 0.85
normalizeAiSdkUsageFunction · 0.85
trackStreamMethod · 0.85
trackGenerateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected