(res, error)
| 647 | * 构造 OpenAI 图像响应项 |
| 648 | * @param {string} contentUrl - 图片链接 |
| 649 | * @param {string} responseFormat - 输出格式 |
| 650 | * @returns {Promise<object>} 图像响应项 |
| 651 | */ |
| 652 | const buildOpenAIImageResultItem = async (contentUrl, responseFormat) => { |
| 653 | if (responseFormat === 'b64_json') { |
| 654 | return { |
| 655 | b64_json: await downloadAssetAsBase64(contentUrl) |
| 656 | } |
| 657 | } |
| 658 | |
| 659 | return { |
| 660 | url: contentUrl |
| 661 | } |
| 662 | } |
no outgoing calls
no test coverage detected