Are you sure you want to delete this access key?
sidebar_label |
---|
Sequence |
The Sequence Provider allows you to send a series of prompts to another provider in sequence, collecting and combining all responses. This is useful for multi-step interactions, conversation flows, or breaking down complex prompts into smaller pieces.
To use the Sequence Provider, set the provider id
to sequence
and provide a configuration object with an array of inputs:
providers:
- id: sequence
config:
inputs:
- 'First question: {{prompt}}'
- 'Follow up: Can you elaborate on that?'
- 'Finally: Can you summarize your thoughts?'
separator: "\n---\n" # Optional, defaults to "\n---\n"
The Sequence Provider:
inputs
arrayHere's a complete example showing how to use the Sequence Provider to create a multi-turn conversation:
providers:
- openai:chat:gpt-4
- id: sequence
config:
inputs:
- 'What is {{prompt}}?'
- 'What are the potential drawbacks of {{prompt}}?'
- 'Can you summarize the pros and cons of {{prompt}}?'
separator: "\n\n=== Next Response ===\n\n"
prompts:
- 'artificial intelligence'
tests:
- vars:
prompt: artificial intelligence
assert:
- type: contains
value: drawbacks
- type: contains
value: pros and cons
Each input string supports Nunjucks templating and has access to:
prompt
For example:
providers:
- id: sequence
config:
inputs:
- 'Question about {{topic}}: {{prompt}}'
- 'Follow up: How does {{topic}} relate to {{industry}}?'
tests:
- vars:
topic: AI
industry: healthcare
prompt: What are the main applications?
Option | Type | Required | Default | Description |
---|---|---|---|---|
inputs | string[] | Yes | - | Array of prompt templates to send sequentially |
separator | string | No | "\n---\n" | String used to join the responses |
Press 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?