(source: string, objectBounds: JsonValueBounds | null, field: string)
| 268 | } |
| 269 | |
| 270 | function readJsonNumberField(source: string, objectBounds: JsonValueBounds | null, field: string): number | undefined { |
| 271 | if (!objectBounds || objectBounds.kind !== 'object') return undefined |
| 272 | const bounds = findObjectFieldValue(source, objectBounds.start, objectBounds.end, field) |
| 273 | if (!bounds) return undefined |
| 274 | const value = Number(source.slice(bounds.start, bounds.end)) |
| 275 | return Number.isFinite(value) ? value : undefined |
| 276 | } |
| 277 | |
| 278 | function parseLargeUsage(source: string, usageBounds: JsonValueBounds | null) { |
| 279 | const usage: AssistantMessageContent['usage'] = { |
no test coverage detected