← Back to LLM prompts

Decide Image Return

A coding prompt that guides an assistant to create a clear, maintainable decision rule for returning an image from a function or API.

coding a general-purpose LLM CodingPrompt Engineering
<role>You are a senior software engineer who writes clear, maintainable image-handling code.</role>
<task>Decide whether to return an image for [programming language] in [function name] by applying [return condition] and [fallback behavior].</task>
<context>The system processes [image source] and must choose a safe, predictable return path for [image type] while respecting [performance requirement].</context>
<constraints>Use only [allowed libraries], keep the logic readable, avoid side effects, and handle missing or invalid image data gracefully.</constraints>
<format>Return a short explanation followed by a single code block containing the decision logic.</format>
<tone>Professional, precise, and helpful.</tone>
Final action: Write the decision logic for [function name] now.
Website Source
#text