Use this template repo to quickly create a devcontainer enabled environment for experimenting with Langchain and OpenAI.
Included are several Jupyter notebooks that implement sample code found in the Langchain Quickstart guide.
- demo.ipynb - Basic sample, verifies you have valid API key and can call the OpenAI service.
- chains.ipynb - Your first (simple) chain.
- embeddings.ipynb - Sample of generating embeddings for given prompt (from Getting Started with LangChain: A Beginner’s Guide to Building LLM-Powered Applications).
- Click Use this template
- Clone to your local machine -OR- open in Codespace
- In a terminal, run
pip install -r requirements.txt
- Create a '.env' file at root of repo
- Add
OPENAI_API_KEY="<your key here>"
to .env file
- Create a '.env' file at root of repo
- Add
OPENAI_API_KEY="<your key here>"
to .env file
# Use for Azure OpenAI
OPENAI_API_KEY="<your key>"
OPENAI_API_BASE="https://<your instance name>.openai.azure.com/"
OPENAI_API_TYPE="azure"
OPENAI_API_VERSION= "2023-05-15"