(
finishReason: string | null,
usage?: {
promptTokens: number
completionTokens: number
totalTokens: number
},
model?: string,
timestamp?: number,
id?: string,
)
| 146 | } |
| 147 | |
| 148 | const createDoneChunk = ( |
| 149 | finishReason: string | null, |
| 150 | usage?: { |
| 151 | promptTokens: number |
| 152 | completionTokens: number |
| 153 | totalTokens: number |
| 154 | }, |
| 155 | model?: string, |
| 156 | timestamp?: number, |
| 157 | id?: string, |
| 158 | ): StreamChunk => ({ |
| 159 | type: 'done', |
| 160 | finishReason: normalizeFinishReason(finishReason), |
| 161 | usage, |
| 162 | model: model ?? 'unknown', |
| 163 | timestamp: timestamp ?? Date.now(), |
| 164 | id: id ?? `done-${Date.now()}`, |
| 165 | }) |
| 166 | |
| 167 | const createErrorChunk = ( |
| 168 | error: string, |
no test coverage detected