langchain
langchain copied to clipboard
ChatOpenAI basepath support
Some of the other OpenAI wrappers within langchain, and the openai python module itself support overriding the API base path.
LocalAI is at least one project that aims to provide a partial implementation of the OpenAI apis. By overriding the API base path, I was able to quickly hook together the existing langchain JS OpenAI modules to the LocalAI backend. This PR would enable similar overriding for the ChatOpenAI class so the python implementation would be able to do so as well.
EDIT: Changes pass tests and have been proven to redirect the API request successfully!