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 c592fdb629
feat(tests): add configuration support for test generators (#4301)
2 months ago
..
360d7b519d
docs(examples): add uniform init commands to all example READMEs (#4068)
3 months ago
c592fdb629
feat(tests): add configuration support for test generators (#4301)
2 months ago
c592fdb629
feat(tests): add configuration support for test generators (#4301)
2 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

javascript-test-cases (JavaScript/TypeScript Test Cases Example)

You can run this example with:

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

This example demonstrates different ways to generate test cases using JavaScript/TypeScript functions. It shows both static and dynamic test case generation with optional type checking.

Files

  • promptfooconfig.yaml - Configuration file specifying prompts and providers
  • staticTests.ts - Static test cases with type checking examples
  • dynamicTests.ts - Dynamic test case generation from a simulated database

Usage

  1. Install dependencies:

    npm install promptfoo
    
  2. Set up your API key:

    export OPENAI_API_KEY=your_api_key_here
    
  3. Run the evaluation:

    npx promptfoo eval
    
Tip!

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

Comments

Loading...