New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pytest-langchain

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pytest-langchain

Pytest-style test runner for langchain agents

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

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

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc