convert_to_openai_image_block#
- langchain_core.messages.content_blocks.convert_to_openai_image_block(
- content_block: dict[str, Any],
Convert image content block to format expected by OpenAI Chat Completions API.
- Parameters:
content_block (dict[str, Any]) β The content block to convert.
- Raises:
ValueError β If the source type is not supported or if
mime_type
is missing for base64 data.- Returns:
A dictionary formatted for OpenAIβs API.
- Return type:
dict