Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel
Michael ab2de8cce4
feat(testcases): add support for loading dynamic test cases from Python and Javascript/Typescript files (#2993)
6 months ago
..
ab2de8cce4
feat(testcases): add support for loading dynamic test cases from Python and Javascript/Typescript files (#2993)
6 months ago
ab2de8cce4
feat(testcases): add support for loading dynamic test cases from Python and Javascript/Typescript files (#2993)
6 months ago
ab2de8cce4
feat(testcases): add support for loading dynamic test cases from Python and Javascript/Typescript files (#2993)
6 months ago

README.md

You have to be logged in to leave a comment. Sign In

Python Test Cases Example

This example demonstrates how to generate test cases using Python. It showcases three methods for generating test cases:

  1. Loading static test cases via a Python function.
  2. Generating test cases programmatically using pandas (simulating CSV data).
  3. Systematically creating test cases through a class method.

Quick Start

Initialize this example in a new directory with:

npx promptfoo@latest init --example python-test-cases

Requirements

  1. Python Dependencies:

    pip install pandas
    
  2. Environment Variables:

    export OPENAI_API_KEY=your_api_key_here
    

Usage

Run the evaluation with:

promptfoo eval
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...