I use the Gemini-3-Pro-Image Preview or Gemini-2.5-Flash-Image model.
messageConfig = types.GenerateContentConfig(
media_resolution=types.MediaResolution.MEDIA_RESOLUTION_HIGH,
temperature=2.0,
seed=None,
max_output_tokens=None,
image_config=types.ImageConfig{
image_size = "1k",
aspect_ratio = "1:1"
},
)
chatResponse = chat.send_message(
message = parameters["prompt"],
config = parameters["messageConfig"]
)
If you run the code above, the following error occurs.
400 INVALID_ARGUMENT. {‘error’: {‘code’: 400, ‘message’: ‘Request contains an invalid argument.’, ‘status’: ‘INVALID_ARGUMENT’}}