Converts a standard LangChain content block to an OpenAI Completions API content part.
This converter transforms LangChain's standardized content blocks (image, audio, file)
into the format expected by OpenAI's Chat Completions API. It handles various content
types including images (URL or base64), audio (base64), and files (data or file ID).
Param: block
The standard content block to convert. Can be an image, audio, or file block.
Returns
An OpenAI Chat Completions content part object, or undefined if the block
cannot be converted (e.g., missing required data).
Converts a standard LangChain content block to an OpenAI Completions API content part.
This converter transforms LangChain's standardized content blocks (image, audio, file) into the format expected by OpenAI's Chat Completions API. It handles various content types including images (URL or base64), audio (base64), and files (data or file ID).