Hey! Great questions -- let me break these down.
1. Image URLs in inputText
When you pass image URLs in inputText, the API automatically detects standalone HTTPS URLs that end in a supported image extension and wraps them in <img> tags for you. Here's what to keep in mind for reliability:
- URLs must be HTTPS (not HTTP)
- URLs must end with a recognized extension: .jpg, .jpeg, .png, .gif, .webp, .svg, .heic, .heif, or .avif
- URLs should be on their own line or clearly standalone -- if they're embedded mid-sentence or inside markdown/HTML that already wraps them, the preprocessor may skip them
- If your image URL doesn't have a file extension (e.g. a dynamic URL like https://example.com/image?id=123), wrap it in an <img> tag yourself: <img src="https://example.com/image?id=123">
Regarding textMode -- it doesn't directly control image behavior. Images from your input are preserved regardless of whether you use preserve, condense, or generate. That said, with generate the AI rewrites more aggressively, so there's a slightly higher chance it restructures content in a way that drops an image reference. preserve is the safest bet if you want to make sure everything stays put.
One tip: placing each image URL on its own line directly below the relevant slide/section content helps make the association clearer for the AI. Using additionalInstructions like you're already doing is the right call.
2. webFreeToUse returning placeholders
This can happen when the web image search doesn't find a suitable match for a given slide's content, or when the source image fails to load/resolve during generation. It's not exactly a bug -- it's more of a graceful fallback when the search comes up empty or the source URL is unreachable.
That said, it shouldn't be happening frequently. If you're seeing it on a significant number of slides, could you share a generationId from an affected request? I can look into whether something specific is going wrong on our end.