Overview
Test the conversation flow with predefined interactions where you send specific user utterances to your agent and validate exact responses.Reference
A traditional test is a YAML file with the following structure:Input types
Text input
The input text is the simplest one. You just have to specify the text you want to send to Voiceflow. Make sure that the text is in the language you specified in thelocaleId field. to use this type you have to set the type field to text and the text field to the text you want to send.
Launch input
The launch input is used to start a new conversation session. This is typically the first interaction in a test. To use this type you have to set thetype field to launch.
Event input
The event input allows you to send custom events to your Voiceflow agent. Events can be used to trigger specific flows or actions in your agent. To use this type you have to set thetype field to event and the event field to the event name you want to send.
Intent input
The intent input allows you to directly send an intent to your Voiceflow agent, bypassing NLU processing. This is useful when you have your own NLU matching or want to test specific intent handling. To use this type you have to set thetype field to intent and provide an intent object with the intent name and optional entities.
intent object accepts the following properties:
name: (Required) The name of the intent to triggerentities: (Optional) An array of entity objects withnameandvaluefields
Button input
The button input allows you to simulate clicking a button that was presented in a previous choice/button response from your Voiceflow agent. This is useful for testing conversational flows that include button interactions. To use this type you have to set thetype field to button and the value field to the button label you want to click.
- Finds the matching button from the previous
choicetrace by its label - Sends the complete button request (including path type and payload) back to Voiceflow
- Handles the button click as if a user clicked it in a real conversation
choice trace type with buttons. The value must match the label field in one of the button’s payload.
Example workflow:
Validation types
Contains
The contains validation type is the simplest one. It just checks if the response returned by the Voiceflow agent contains the value specified in thevalue field. To use this type you have to set the type field to contains and the value field to the value you want to check:
Equals
The equals validation type is a little bit more complex. It checks if the response returned by the Voiceflow agent is equal to the value specified in thevalue field. To use this type you have to set the type field to equals and the value field to the value you want to check:
Regexp
The regexp validation type is the most complex one. It checks if the response returned by the Voiceflow agent matches the regexp specified in thevalue field. To use this type you have to set the type field to regexp and the value field to the regular expression you want to check:
TraceType
The traceType validation type checks if the response returned by the Voiceflow agent has the trace type specified in thevalue field. To use this type you have to set the type field to traceType and the value field to the trace type you want to check:
Similarity
The similarity validation type checks if the response returned by the Voiceflow agent is similar to the values specified in thevalues field. To use this type you have to set the type field to similarity and the values field to the values you want to check:
similarityConfig field to specify the similarity configuration. The provider field specifies the similarity provider you want to use. The model field specifies the model you want to use. The temperature field specifies the temperature you want to use. The top_k field specifies the top k you want to use. The top_p field specifies the top p you want to use. The similarityThreshold field specifies the similarity threshold you want to use.
The only provider available for now is openai.
For LLM Providers authentication please check the Authentication page.
Variable
The variable validation type checks if a variable in the Voiceflow agent has the expected value. To use this type you have to set thetype field to variable, the value field to the expected value, and provide a variableConfig object with the variable details:
variableConfig object accepts the following properties:
name: (Required) The name of the variable to validatejsonPath: (Optional) A JSONPath expression to extract nested values from JSON/object variables
JSON Schema
voiceflow-cli also has a jsonschema file, which you can use to have bettereditor support:
yml config files by adding acomment like the following: