# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: OpenAI Responses API with Different Response Formats
prompts:
  - 'Extract information about the event: {{event}}'

providers:
  # GPT-5 models showcasing latest capabilities
  - id: openai:responses:gpt-5.5
    label: gpt-5.5-json-schema
    config:
      instructions: 'You are a helpful AI assistant. Extract key details about the event.'
      response_format:
        type: 'json_schema'
        name: 'event_information'
        schema:
          type: 'object'
          properties:
            event_name:
              type: 'string'
              description: 'The name of the event'
            date:
              type: 'string'
              description: 'When the event takes place'
            location:
              type: 'string'
              description: 'Where the event takes place'
            participants:
              type: 'array'
              items:
                type: 'string'
              description: 'People attending the event'
          required: ['event_name', 'date', 'location', 'participants']
          additionalProperties: false

  - id: openai:responses:gpt-5.4-nano
    label: gpt-5.4-nano-json-schema
    config:
      instructions: 'You are a helpful AI assistant. Extract key details about the event.'
      response_format:
        type: 'json_schema'
        name: 'event_information'
        schema:
          type: 'object'
          properties:
            event_name:
              type: 'string'
              description: 'The name of the event'
            date:
              type: 'string'
              description: 'When the event takes place'
            location:
              type: 'string'
              description: 'Where the event takes place'
            participants:
              type: 'array'
              items:
                type: 'string'
              description: 'People attending the event'
          required: ['event_name', 'date', 'location', 'participants']
          additionalProperties: false
      store: true

  - id: openai:responses:gpt-5.4-mini
    label: gpt-5.4-mini-json-schema
    config:
      instructions: 'You are a helpful AI assistant. Extract key details about the event.'
      response_format:
        type: 'json_schema'
        name: 'event_information'
        schema:
          type: 'object'
          properties:
            event_name:
              type: 'string'
              description: 'The name of the event'
            date:
              type: 'string'
              description: 'When the event takes place'
            location:
              type: 'string'
              description: 'Where the event takes place'
            participants:
              type: 'array'
              items:
                type: 'string'
              description: 'People attending the event'
          required: ['event_name', 'date', 'location', 'participants']
          additionalProperties: false

  # Legacy GPT-4.1 for comparison
  - id: openai:responses:gpt-4.1
    label: gpt-4.1-json-schema
    config:
      temperature: 0.7
      instructions: 'You are a helpful AI assistant. Extract key details about the event.'
      response_format:
        type: 'json_schema'
        name: 'event_information'
        schema:
          type: 'object'
          properties:
            event_name:
              type: 'string'
              description: 'The name of the event'
            date:
              type: 'string'
              description: 'When the event takes place'
            location:
              type: 'string'
              description: 'Where the event takes place'
            participants:
              type: 'array'
              items:
                type: 'string'
              description: 'People attending the event'
          required: ['event_name', 'date', 'location', 'participants']
          additionalProperties: false

tests:
  - vars:
      event: 'Alice and Bob are attending a JSON schema conference in New York on September 15th, 2025.'
  - vars:
      event: 'The annual music festival will take place in Central Park this weekend, featuring local artists and food vendors.'
