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 e5cf9dcd0c
chore(testCases): improve JSON field support in csv test cases (#3102)
6 months ago
..
e5cf9dcd0c
chore(testCases): improve JSON field support in csv test cases (#3102)
6 months ago
a36cd41b82
chore: update to prettier v3 (#901)
1 year ago
bf81260b44
Simplify API and add support for unified test suite definition (#14)
2 years ago
76797692e5
feat(schema): add yaml schema validation to config files (#1990)
10 months ago
e5cf9dcd0c
chore(testCases): improve JSON field support in csv test cases (#3102)
6 months ago
e5cf9dcd0c
chore(testCases): improve JSON field support in csv test cases (#3102)
6 months ago

README.md

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

Simple CSV Example

This example demonstrates how to use CSV files for test cases in promptfoo, including working with JSON fields for language translation tasks.

Getting Started

You can initialize this example in your project by running:

promptfoo init --example simple-csv

Features Demonstrated

  • CSV test case format with JSON configuration fields
  • Multiple prompt variations for different translation styles
  • Style configuration via JSON fields (tone, length)
  • Case-insensitive test assertions (icontains)

Project Structure

  • promptfooconfig.yaml: Main configuration file
  • prompts.txt: Contains two prompt templates:
    1. A formal translator prompt
    2. A conversational language assistant prompt
  • tests.csv: Test cases for French and Pirate translations

Running the Tests

From the root of this example, you can run the eval as:

promptfoo eval

To view the results in your browser:

promptfoo view

For more details on using CSV files in promptfoo, see our Import from CSV documentation.

Tip!

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

Comments

Loading...