OpenAI's LLM is used by default in LangChain. in order for you to use Azure's Openai API in LangChain, I made this example. It can be used as a starting point for your project.
- clone the repo.
- run
pip install
- Add
.env
file to the root directory with the following content:All these information are shown on your Azure Openai Portal.AZURE_OPENAI_API_KEY=<your azure openai key> OPENAI_API_VERSION=<api version> #eg: 2024-02-15-preview AZURE_OPENAI_ENDPOINT=<your azure openai endpoint> #eg: https://<azure resource>.openai.azure.com/
- run
python app.py