(data: any)
| 1856 | |
| 1857 | const parseOpenAIStyleImageResponse = (data: any): AIImage[] => { |
| 1858 | const images: AIImage[] = []; |
| 1859 | const list = data?.data || []; |
| 1860 | for (const item of list) { |
| 1861 | if (item?.b64_json) { |
| 1862 | images.push({ |
| 1863 | data: Buffer.from(item.b64_json, "base64"), |
| 1864 | mimeType: "image/png", |
| 1865 | }); |
| 1866 | } else if (item?.url) { |
| 1867 | images.push({ url: item.url, mimeType: "image/png" }); |
| 1868 | } |
| 1869 | } |
| 1870 | return images; |
| 1871 | }; |
| 1872 | |
| 1873 | const isAsyncIterable = (value: any): value is AsyncIterable<any> => |
| 1874 | !!value && typeof value[Symbol.asyncIterator] === "function"; |
| 1875 |
no outgoing calls
no test coverage detected