0d3cb498a3
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Waiting to run
Test and Publish Multi-arch Docker Image / test (push) Waiting to run
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Blocked by required conditions
Validate Renovate Config / Validate Renovate Configuration (push) Waiting to run
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
2.6 KiB
2.6 KiB
sidebar_label, description
| sidebar_label | description |
|---|---|
| Sequence | Chain multiple AI providers sequentially to create sophisticated evaluation workflows with data transformation and routing |
Sequence Provider
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.
Configuration
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"
How It Works
The Sequence Provider:
- Takes each input string from the
inputsarray - Renders it using Nunjucks templating (with access to the original prompt and test variables)
- Sends it to the original provider
- Collects all responses
- Joins them together using the specified separator
Usage Example
Here'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
Variables and Templating
Each input string supports Nunjucks templating and has access to:
- The original
prompt - Any variables defined in the test context
- Any custom filters you've defined
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?
Configuration Options
| 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 |