Back to Promptfoo

integration-langchain (Langchain Python)

examples/integration-langchain/README.md

0.121.9565 B
Original Source

integration-langchain (Langchain Python)

You can run this example with:

bash
npx promptfoo@latest init --example integration-langchain
cd integration-langchain

Usage

This example shows how to run a Python (LangChain) chain implementation with Promptfoo. It compares GPT-5 versus LangChain's LLM Math module.

To run it, first create a virtual env and install the requirements:

Then activate the virtual env.

sh
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Then run the eval:

bash
npx promptfoo eval