OpenAI Adapter(Old)
Please ensure OpenAI library is less than 1.0.0; otherwise, refer to the newer doc OpenAI Adapter.
A lot of people get started with OpenAI but want to explore other models. LangChain's integrations with many model providers make this easy to do so. While LangChain has it's own message and model APIs, we've also made it as easy as possible to explore other models by exposing an adapter to adapt LangChain models to the OpenAI api.
At the moment this only deals with output and does not return other information (token counts, stop reasons, etc).
import openai
from langchain_community.adapters import openai as lc_openai
API Reference:openai