Adapter for converting LLM messages to OpenAI format.
This module handles the conversion of universal message format to OpenAI's API format, including multimodal content with images.
Summary
Functions
Adapts LLM messages to OpenAI format.
Converts tool calls from OpenAI format to internal format.
Functions
@spec adapt_messages([Mojentic.LLM.Message.t()]) :: [map()]
Adapts LLM messages to OpenAI format.
Parameters
messages- List of LLM messages to adapt
Returns
List of messages in OpenAI API format
@spec convert_tool_calls([map()]) :: [Mojentic.LLM.ToolCall.t()]
Converts tool calls from OpenAI format to internal format.
Parameters
tool_calls- List of tool calls in OpenAI format
Returns
List of ToolCall structs