( msg: AssistantMessage, includeMetadata: boolean, providers?: Provider[] | ReadonlyMap<string, Provider>, )
| 65 | } |
| 66 | |
| 67 | export function formatAssistantHeader( |
| 68 | msg: AssistantMessage, |
| 69 | includeMetadata: boolean, |
| 70 | providers?: Provider[] | ReadonlyMap<string, Provider>, |
| 71 | ): string { |
| 72 | if (!includeMetadata) { |
| 73 | return `## Assistant\n\n` |
| 74 | } |
| 75 | |
| 76 | const duration = |
| 77 | msg.time.completed && msg.time.created ? ((msg.time.completed - msg.time.created) / 1000).toFixed(1) + "s" : "" |
| 78 | |
| 79 | const modelName = Model.name(providers, msg.providerID, msg.modelID) |
| 80 | |
| 81 | return `## Assistant (${Locale.titlecase(msg.agent)} · ${modelName}${duration ? ` · ${duration}` : ""})\n\n` |
| 82 | } |
| 83 | |
| 84 | export function formatPart(part: Part, options: TranscriptOptions): string { |
| 85 | if (part.type === "text" && !part.synthetic) { |
no outgoing calls
no test coverage detected