Test Your Pipeline in Playground
Time to test your pipeline!
About This Task
You can run queries with your pipeline and check whether the responses match the quality you expect. You can also use the Playground to collect feedback from users; they can add feedback to each response. You can then check this feedback on the Pipeline details page. For more information, see Collect User Feedback.
Upload Files
You can upload files directly in Playground. If the workspace doesn’t contain any files, the pipeline runs only on the files you upload. If the workspace already has files, the pipeline uses both the workspace files and the ones you uploaded. The files are there only for the search session when you uploaded them.
To support file uploads in Playground, the pipeline must include a FilesInput
component connected to DeepsetFileDownloader
. We also recommend adding Converters and PreProcessors that can handle the types of files you plan to upload, just like you would in an index. Without them, the uploaded files won’t be preprocessed.
For more information, see:
Pipeline Templates
If you're using a pipeline built with one of our templates, all the necessary components are there.
Pipeline Output Type
You can indicate the output type of your pipeline in pipeline YAML to make sure Playground displays the results in the best possible way. Add piepline_output_type
to the YAML and set it to one of these values:
chat
generative
extractive
document
For details, see Set Pipeline Output Type.
Prerequisites
- If you're asking your colleague to test your pipeline, have a look at Guidelines for Onboarding Your Users.
- You must have a deployed, active pipeline.
- If you're planning to upload files:
- Add
FilesInput
at the beginning of your pipeline and connect it toDeepsetFileDownloader
. - To preprocess the uploaded files, add appropriate Converters and Preprocessors to your pipeline.
- Add
Run Queries in the UI
-
Log in to deepset AI Platform.
-
Click Playground.
-
Choose the pipeline and filters that you want to use.
Note: Filters are available only if the files have metadata. You can add metadata to your files when you're uploading them. These metadata then act as filters at search time. -
To upload files, click the paperclip icon in the Search field.
-
To test different settings, use the Configuration option to change component parameters for the query you're asking. Use the format
{ "component_name": { "parameter_name": "parameter_value" }}
. This is useful for trying out different parameter values or testingConditionalRouter
routes.For example, you can change the retriever's
top_k
value, like this:
-
Type your query and click Search.
Check Sources
Expand the Sources (1) section below the search result to view the documents and files it's based on. Click the More actions button (2) next to an answer to view the prompt that was used to generate it:
-
Check the logs generated for the query by clicking the debug icon:
Run Queries with the REST API
Use the Search API endpoint. Follow the step-by-step code explanation:
Or follow these steps:
- Go to the Search endpoint documentation page.
- Enter the necessary parameters:
- Type the name of the pipeline to use for the search.
- Type the workspace name containing the pipeline you want to use in your target app.
- Optionally, add filters. (You can use metadata from your documents as filters to narrow the search. For more information, see Add Search Filters.)
- Optionally, specify any runtime parameters.
- Type the queries.
- In the Bearer field, paste the API key you previously generated.
- Choose the programming language that you want to use and copy the code.
Here's an example request:
curl --request POST \
--url https://api.cloud.deepset.ai/api/v1/workspaces/WORKSPACE_NAME/pipelines/PIPELINE_NAME/search \
--header 'accept: application/json' \
--header 'authorization: Bearer api_eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI4NDU4ZGIyOC1kMTZlLTRkMzAtYTY2OS1lMDg1MDllNDY4YWV8NjQzY2Y5YTlmNzExNDg0MmUwNzk5ZDQ3IiwiZXhwIjoxNzA2Njg2MDUyLCJhdWQiOlsiaHR0cHM6Ly9hcGkuY2xvdWQuZGVlcHNldC5haSJdfQ.wh4_62gBcpfPVwYvrxlLtia7_YRaMpMx00EXWGP18IM' \
--header 'content-type: application/json' \
--data '
{
"debug": true,
"filters": {
"field": "meta.field_name",
"operator": "<operator>",
"value": "field_value"
},
"params": {
"param1": "value1",
"param2": "value2"
},
"queries": [
"my query"
]
}
'
See also Use Your Pipeline in Your Target App and Productionizing Your Pipeline.
What's Next
You can open or download each document containing the answer. To do that, hover over the More Actions icon next to the document name.
You can also give feedback for each answer using the thumbs-up and thumbs-down icons. This will let the pipeline creator know how the pipeline is doing.
As the pipeline creator, you can then analyze the feedback on the Pipeline Details page. Click the pipeline name to open it.
Updated 5 days ago