Bug
OciClientV2.chat() with image content returns 400 from OCI Generative AI when using Command A Vision:
status_code: 400, body: {'message': 'Please pass in correct format of request.'}
Root Cause
OCI Generative AI expects camelCase field names. The SDK transforms message roles and content types but passes image_url through as-is instead of converting it to imageUrl.
SDK sends:
{"type": "IMAGE_URL", "image_url": {"url": "data:image/png;base64,..."}}
OCI expects:
{"type": "IMAGE_URL", "imageUrl": {"url": "data:image/png;base64,..."}}
Impact
All vision requests via OciClientV2 with inline images are broken.
Reproduction
response = client.chat(
model="command-a-vision",
messages=[{
"role": "user",
"content": [
{"type": "text", "text": "What color is this image?"},
{"type": "image_url", "image_url": {"url": "data:image/png;base64,..."}},
],
}],
)
Bug
OciClientV2.chat()with image content returns 400 from OCI Generative AI when using Command A Vision:Root Cause
OCI Generative AI expects camelCase field names. The SDK transforms message roles and content types but passes
image_urlthrough as-is instead of converting it toimageUrl.SDK sends:
{"type": "IMAGE_URL", "image_url": {"url": "data:image/png;base64,..."}}OCI expects:
{"type": "IMAGE_URL", "imageUrl": {"url": "data:image/png;base64,..."}}Impact
All vision requests via
OciClientV2with inline images are broken.Reproduction