Skip to main content

Pytest-style test runner for langchain agents

Project description

🦜️🔗✅ 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-langchain-0.1.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytest_langchain-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pytest-langchain-0.1.0.tar.gz.

File metadata

  • Download URL: pytest-langchain-0.1.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pytest-langchain-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f3708bcce82da37d713fdb6fa2fe887874717c2c79ba2e44e01463d6191baec
MD5 6661a260da47ed0eb66660bdc2f0e1e1
BLAKE2b-256 d7a0855b8fe8630998ce15e7b0c757a70e6ba7050c5be36e71d431bf4371fb3d

See more details on using hashes here.

File details

Details for the file pytest_langchain-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for pytest_langchain-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 763bef069908df2c56a40a9a307bbaf64250a962725d59e8b86f431e0bdc8405
MD5 bbd59a034e4d0ba18ac4090861bf9bd0
BLAKE2b-256 796657d74be1e429a67d0e79612dcca9e2302865b4f63a1850b12b2f297f53e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page