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 3ca9076c0d
fix(providers): use prompt config for structured outputs in azure (#2331)
8 months ago
..
311f8325d3
chore(providers): improve JSON schema support for openai azure (#2318)
8 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

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...