convert_to_openai_data_block#

langchain_core.messages.content_blocks.convert_to_openai_data_block(block: dict) β†’ dict[source]#

Format standard data content block to format expected by OpenAI.

Parameters:

block (dict) – A data content block.

Raises:

ValueError – If the block type or source type is not supported.

Returns:

A dictionary formatted for OpenAI’s API.

Return type:

dict