(image: unknown, mediaType?: string)
| 271 | } |
| 272 | |
| 273 | function toImageUrl(image: unknown, mediaType?: string): string | null { |
| 274 | if (typeof image !== 'string' || !image) return null |
| 275 | if (image.startsWith('http://') || image.startsWith('https://') || image.startsWith('data:')) { |
| 276 | return image |
| 277 | } |
| 278 | return `data:${mediaType ?? 'image/png'};base64,${image}` |
| 279 | } |
| 280 | |
| 281 | function extractTextParts(content: Array<Record<string, unknown>>): string { |
| 282 | const parts: string[] = [] |
no outgoing calls
no test coverage detected