Prompt Chain

Test OpenAI Chat History Conversation Flows

Test and evaluate OpenAI chat implementations with multi-turn conversation history to ensure proper context preservation.

Works with openai

72
Spark score
out of 100
Updated 21 days ago
Version 0.121.18
Models
gpt 3 5gpt 4

Add to Favorites

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

01

Initialize and configure OpenAI chat history examples with API credentials

02

Define conversation prompts and expected multi-turn dialogue patterns

03

Run evaluation tests to verify context retention across message exchanges

04

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

01
Set OpenAI API Key
02
Review and Edit Configuration
03
Run Evaluation
04
View Results

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.