Are you sure you want to delete this access key?
sidebar_label |
---|
Echo |
The Echo Provider is a simple utility provider that returns the input prompt as the output. It's particularly useful for testing, debugging, and validating pre-generated outputs without making any external API calls.
To use the Echo Provider, set the provider ID to echo
in your configuration file:
providers:
- echo
# or
- id: echo
label: pass through provider
The Echo Provider returns a complete ProviderResponse
object with the following fields:
output
: The original input stringcost
: Always 0cached
: Always falsetokenUsage
: Set to { total: 0, prompt: 0, completion: 0 }
isRefusal
: Always falsemetadata
: Any additional metadata provided in the contextThe Echo Provider requires no additional configuration and returns the input after performing any variable substitutions.
providers:
- echo
- openai:chat:gpt-4.1-mini
prompts:
- 'Summarize this: {{text}}'
tests:
- vars:
text: 'The quick brown fox jumps over the lazy dog.'
assert:
- type: contains
value: 'quick brown fox'
- type: similar
value: '{{text}}'
threshold: 0.75
In this example, the Echo Provider returns the exact input after variable substitution, while the OpenAI provider generates a summary.
The Echo Provider is useful for:
Debugging and Testing Prompts: Ensure prompts and variable substitutions work correctly before using complex providers.
Assertion and Pre-generated Output Evaluation: Test assertion logic on known inputs and validate pre-generated outputs without new API calls.
Testing Transformations: Test how transformations affect the output without the variability of an LLM response.
Mocking in Test Environments: Use as a drop-in replacement for other providers in test environments when you don't want to make actual API calls.
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?