fetch_remote_images

Function fetch_remote_images 

Source
pub async fn fetch_remote_images(
    req: ChatRequest,
    cfg: &ImageFetchConfig,
) -> ChatRequest
Expand description

Fetch remote image URLs in a ChatRequest and fill data_b64 + media_type on each ContentPart::Image that has a remote URL but no base64 data. Images that already have data_b64 (from data: URIs) are left unchanged. The url field is preserved so the OpenAI adapter can still pass it through.

Returns the mutated ChatRequest. On fetch failure for any single image, the image is left as-is (the adapter will drop it, preserving the pre-#201 behavior) and a warning is logged.