Test OpenAI Chat History Conversation Flows
Test and evaluate OpenAI chat implementations with multi-turn conversation history to ensure proper context preservation.
Why it matters
Evaluate and test conversational AI implementations that maintain chat history across multiple turns with OpenAI models, ensuring context is properly preserved and responses remain coherent throughout extended dialogues.
Outcomes
What it gets done
Initialize and configure OpenAI chat history examples with API credentials
Define conversation prompts and expected multi-turn dialogue patterns
Run evaluation tests to verify context retention across message exchanges
View and analyze test results to validate chat history implementation
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/pfoo-openai-chat-history | bash Steps
Steps in the chain
Overview
Openai Chat History
A promptfoo example configuration for OpenAI chat functionality When you need a starting template for using promptfoo with OpenAI chat
What it does
This is a promptfoo example called openai-chat-history. You can initialize it, configure it using prompt.json and promptfooconfig.yaml files, and run evaluations using the promptfoo command-line tool.
When to use - and when NOT to
Use this example when you want a starting point for working with OpenAI chat functionality in promptfoo. It provides the basic structure and configuration files you need to get started.
Do not use this if you don't have an OpenAI API key or if you're not working with OpenAI's services.
Inputs and outputs
You provide an OPENAI_API_KEY environment variable. You can edit the prompt.json and promptfooconfig.yaml configuration files. After running the evaluation command, you can view results using the promptfoo view command.
Integrations
This example requires an OPENAI_API_KEY environment variable to work with OpenAI's services.
Who it's for
This example is for developers who want to use promptfoo with OpenAI chat functionality and need a pre-configured starting point.
To get started:
npx promptfoo@latest init --example openai-chat-history
cd openai-chat-history
After setting your OPENAI_API_KEY and reviewing the configuration files, run:
promptfoo eval
Then view results with promptfoo view.
Source README
openai-chat-history (Openai Chat History)
You can run this example with:
npx promptfoo@latest init --example openai-chat-history
cd openai-chat-history
Usage
To get started, set your OPENAI_API_KEY environment variable.
Next, have a look at prompt.json and edit promptfooconfig.yaml.
Then run:
promptfoo eval
Afterwards, you can view the results by running promptfoo view
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.