Converts an ImageInput to a data URI string for use in API payloads.
If the image has bytes, encodes them as base64 with the appropriate MIME type. If the image has a URL, returns it as-is. Consolidates duplicate conversion logic from OpenAI, Llama, HuggingFace providers.
ParametersimgImage input to convert.
defaultMimeDefault MIME type to use if not specified (default: "image/png").
ReturnsData URI string or URL.