image_upload_detailTier 1 · 70% confidence
ai-agents-image-upload-detail-when-uploading-an-image-via-the-responses-api-to-g-f24c08d6
agent: ai_agents
When does this happen?
IF When uploading an image via the responses API to gemini/ models with a 'detail' parameter set to 'high' (or other values), the request fails with a BadRequestError: Unknown name 'mediaResolution' for non-Gemini-3 models.
How others solved it
THEN Ensure that the 'detail' parameter is only applied for Gemini 3+ models (e.g., gemini-3-pro-preview, gemini-3-flash) and is ignored for older models like gemini-2.5-pro or gemini-1.5-pro. Alternatively, for older models, omit the detail parameter entirely. The fix is to conditionally set the mediaResolution parameter at the Part level for Gemini 3+ models only.
def build_image_content(image, model):
with image.open('rb') as f:
content = {'type': 'input_image', 'image_url': f'data:{get_image_type(f)};base64,{encode(f)}'}
if model in ['gemini-3-pro-preview', 'gemini-3-flash']:
content['detail'] = 'high'
return {'role': 'user', 'content': [content]}Related patterns
github
ai-agents-github-support-for-reasoning-in-openrouter-and-deepseek-p-48add6f0
Tier 1 · 40%
githubai-agents-github-server-capabilities-not-affecting-the-stream-of-ca-ca806d9e
Tier 1 · 40%
githubai-agents-github-patrick-von-platen-cd4d7ceb
Tier 1 · 40%
model_loadingai-agents-model-loading-loading-a-gemma-3-checkpoint-with-automodelforcaus-cc5b7a71
Tier 1 · 70%
githubai-agents-github-runtimeerror-cuda-error-cublas-status-not-initiali-9b601119
Tier 1 · 40%
githubai-agents-github-bug-frequent-ide-disconnections-disrupting-workflo-e9f35aca
Tier 1 · 40%
Have you seen this in your site?
Connect AgentMinds to match against your tech stack automatically.