Build a Simple LLM Application with LCEL
install LangChain
pip instal langchainLangSmith
Method One(recommend)
Install python-dotenv and create .env
pip install python-dotenv
touch .envwrite the following code to file .env
LANGCHAIN_TRACING_V2="true"
LANGCHAIN_API_KEY="..."auto import env in code
from dotenv import load_dotenv
load_dotenv() # take environment variables from .env.
# Upon code is all you needMethod Two
Export env in shell or global env
export LANGCHAIN_TRACING_V2="true"
export LANGCHAIN_API_KEY="..."Last updated on