2025-01-25 06:21:06 +00:00
2025-01-25 06:21:06 +00:00
2025-01-24 14:57:29 -08:00
2025-01-24 21:38:57 +00:00
2024-11-25 14:10:53 -08:00
2025-01-24 21:38:57 +00:00
2025-01-24 21:38:57 +00:00
2025-01-25 06:21:06 +00:00
2025-01-25 06:21:06 +00:00
2025-01-25 06:21:06 +00:00
2025-01-25 03:43:52 +00:00

Learning LangChain Code Examples

This repository contains code examples (in python and javascript) from each chapter of the book "Learning LangChain".

To run the examples, you can clone the repository and run the examples in your preferred language.

For python examples:

If you haven't installed python on your system, install it first as per the instructions here.

  1. Create a virtual environment:

This command creates a directory named .venv containing the virtual environment.

python -m venv .venv
  1. Activate the virtual environment:
  • MacOs/Linux:
source .venv/bin/activate
  • Windows:
.venv\Scripts\activate

After activation, your terminal prompt should prefix with (venv), indicating that the virtual environment is active.

  1. Install the dependencies in the pyproject.toml file:
pip install -e .
  1. Verify the installation:
pip list
  1. Run an example to see the output:
python ch2/py/a-text-loader.py

For javascript examples:

If you haven't installed node on your system, install it first as per the instructions here.

  1. Install the dependencies in the package.json file:
npm install
  1. Run the example to see the output:
node ch2/js/a-text-loader.js
S
Description
No description provided
Readme 11 MiB
Languages
Python 50.5%
JavaScript 40.8%
TypeScript 8.7%