Are you sure you want to delete this access key?
This example demonstrates how to use OpenAI's Responses API to generate model outputs with advanced capabilities including image understanding, web search, function calling, and reasoning.
This example requires the following environment variables:
OPENAI_API_KEY
- Your OpenAI API keyYou can set this in a .env
file or directly in your environment.
You can run this example with:
npx promptfoo@latest init --example openai-responses
# and then
cd openai-responses
# Run specific configs
npx promptfoo eval -c promptfooconfig.yaml
npx promptfoo eval -c promptfooconfig.image.yaml
npx promptfoo eval -c promptfooconfig.web-search.yaml
npx promptfoo eval -c promptfooconfig.function-call.yaml
npx promptfoo eval -c promptfooconfig.reasoning.yaml
This example includes several configuration files, each demonstrating a different capability:
promptfooconfig.yaml
): Generates a structured story in JSON format with a schemapromptfooconfig.image.yaml
): Processes images with structured JSON inputpromptfooconfig.web-search.yaml
): Retrieves recent information from the web using gpt-4o
promptfooconfig.function-call.yaml
): Calls a weather function with parameters using various reasoning models (o1-pro, o3, o4-mini)promptfooconfig.reasoning.yaml
): Solves math problems step-by-step using OpenAI's reasoning models (o3-mini, o3, o4-mini)promptfooconfig.codex.yaml
): Generates Python code using the codex-mini-latest
model with medium reasoning effortopenai:responses:gpt-4o
- Vision-capable modelopenai:responses:o1-mini
, openai:responses:o1
, openai:responses:o1-pro
- Reasoning modelsopenai:responses:o3-mini
, openai:responses:o3
- High-performance reasoning modelsopenai:responses:o4-mini
- Latest fast, cost-effective reasoning modelopenai:responses:codex-mini-latest
- Fast reasoning model optimized for the Codex CLIPress p or to see the previous file or, n or to see the next file
Browsing data directories saved to S3 is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with AWS S3!
Are you sure you want to delete this access key?
Browsing data directories saved to Google Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Google Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to Azure Cloud Storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with Azure Cloud Storage!
Are you sure you want to delete this access key?
Browsing data directories saved to S3 compatible storage is possible with DAGsHub. Let's configure your repository to easily display your data in the context of any commit!
promptfoo is now integrated with your S3 compatible storage!
Are you sure you want to delete this access key?