( prompt: string, images: AIContentPart[], httpClient: HttpClient, token?: AbortToken, )
| 2320 | |
| 2321 | const buildGeminiParts = async ( |
| 2322 | prompt: string, |
| 2323 | images: AIContentPart[], |
| 2324 | httpClient: HttpClient, |
| 2325 | token?: AbortToken, |
| 2326 | ): Promise<Array<Record<string, any>>> => { |
| 2327 | const parts: Array<Record<string, any>> = []; |
| 2328 | if (prompt.trim()) parts.push({ text: prompt }); |
| 2329 | |
| 2330 | const resolvedImages = await resolveImageInputs(images, httpClient, token, { |
| 2331 | allowFailures: true, |
| 2332 | }); |
| 2333 | for (const image of resolvedImages) { |
| 2334 | parts.push({ |
| 2335 | inlineData: { |
| 2336 | data: image.data.toString("base64"), |
| 2337 | mimeType: image.mimeType, |
| 2338 | }, |
| 2339 | }); |
| 2340 | } |
| 2341 | |
| 2342 | return parts; |
| 2343 | }; |
| 2344 | |
| 2345 | class FeatureRegistry { |
| 2346 | private features = new Map<string, FeatureHandler>(); |
| 2347 |
no test coverage detected