Skip to main content

🦜️🔗✅ pytest-langchain

Pytest-style test runner for langchain projects.

license CI Publish

Installation

Install from PyPI:

pip install pytest-langchain

Install from source:

git clone https://github.com/ajndkr/pytest-langchain
cd pytest-langchain
pip install .

Usage

  • Serialise your LLM chain into a YAML file. Refer to docs for more details.

  • Create a new configuration YAML file to run pytest-langchain with the following structure:

    chain_file: <path to chain YAML file>
    test_cases:
    - [<input-1>, <expected output-1>]
    - [<input-2>, <expected output-2>]
    - ...
    
  • Run pytest-langchain:

    pytest-langchain -c <path to config YAML file> --openai-api-key <OPENAI API key>
    

    For more options, run pytest-langchain --help.

Metadata

Release files for pytest-langchain 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytest-langchain 0.1.0
File Size Uploaded
pytest-langchain-0.1.0.tar.gz 4.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytest-langchain 0.1.0
File Interpreter ABI Platform
pytest_langchain-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / pytest-langchain-0.1.0.tar.gz

Download URL pytest-langchain-0.1.0.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9f3708bcce82da37d713fdb6fa2fe887874717c2c79ba2e44e01463d6191baec
BLAKE2b-256 checksum
How to use checksums
d7a0855b8fe8630998ce15e7b0c757a70e6ba7050c5be36e71d431bf4371fb3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release files / pytest_langchain-0.1.0-py3-none-any.whl

Download URL pytest_langchain-0.1.0-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
763bef069908df2c56a40a9a307bbaf64250a962725d59e8b86f431e0bdc8405
BLAKE2b-256 checksum
How to use checksums
796657d74be1e429a67d0e79612dcca9e2302865b4f63a1850b12b2f297f53e3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page