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 360d7b519d
docs(examples): add uniform init commands to all example READMEs (#4068)
3 months ago
..
360d7b519d
docs(examples): add uniform init commands to all example READMEs (#4068)
3 months ago
3ca9076c0d
fix(providers): use prompt config for structured outputs in azure (#2331)
8 months ago

README.md

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

structured-outputs-config (Structured Outputs Config)

You can run this example with:

npx promptfoo@latest init --example structured-outputs-config

This example demonstrates how to enforce structured JSON outputs using schema validation with OpenAI and Azure OpenAI providers. The configuration supports both providers, but you can remove either one if you only want to test with a specific provider.

The example includes two prompt configurations for solving a math problem.

  • One that requires step-by-step problem solving
  • One that only requires the final answer

Prerequisites

  1. Set up your API credentials:
    • For OpenAI: Set OPENAI_API_KEY environment variable.
    • For Azure OpenAI: Set required Azure credentials. See Azure OpenAI provider docs for more details.

Getting Started

  1. Review and customize promptfooconfig.yaml as needed

  2. Run the evaluation:

    promptfoo eval
    
  3. View the results:

    promptfoo view
    
Tip!

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

Comments

Loading...