A sample script that uses LangChain to talk to LLMs.
Based on https://python.langchain.com/docs/tutorials/llm_chain/
You’ll need an API key for each LLM. So just follow the instructions linked below to obtain your API keys.
Save the keys to the app/src/main/resources/.env
file as the corresponding
..._API_KEY
environment variable. You can use
app/src/main/resources/.env.template
as a guide to structure your .env
file.
python3 -m venv .venv
. .venv/bin/activate
pip install langsmith
conda create --name langchain
conda install --name langchain --file requirements.txt --channel conda-forge
. .venv/bin/activate
conda activate langchain