(value: unknown)
| 150 | } |
| 151 | |
| 152 | function asCount(value: unknown): number | undefined { |
| 153 | return typeof value === 'number' && Number.isFinite(value) ? value : undefined; |
| 154 | } |
| 155 | |
| 156 | /** The body, built in one place so the eval and the chat send the same bytes. */ |
| 157 | export function chatBody(request: ChatRequest): Record<string, unknown> { |