Handles generic format conversions between OpenAI and LangChain.
Static
Convert OpenAI-format messages to LangChain messages.
Convert a LangChain AIMessage to an OpenAI-compatible ChatCompletionResponse.
Convert OpenAI tool_choice to LangChain format.
Replace tool call arguments that are not valid JSON, so the provider's SDK accepts the history. A relayed invalid tool call leaves them there, and the next turn must still go through.
Handles generic format conversions between OpenAI and LangChain.