Use Your Pipeline in Your Target App
Add the search functionality to your app and configure how your search results are displayed. The search
API endpoint is all you need.
About This Task
We recommend setting the pipeline you plan to use in your app to the Production service level. This ensures the pipeline's scalability and reliability in production use cases. For more information, see Pipeline Service Levels.
Use the Search Endpoint in Your App
First, generate an API key and save it.
The easiest way is to start with the API Reference documentation. Follow this step-by-step walkthrough of the code:
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 Working with Metadata..)
- Optionally, add any runtime parameters for the pipeline components.
- 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.
You can then wrap this code in a function and modify it as needed.
Set Default Pipeline
Consider setting the default pipeline for your app. Use the Set Default Pipeline API endpoint to route all traffic to the pipeline you indicated as default. This way, when you need to tweak or change your pipeline, you can do so without any downtime. Just indicate the new default pipeline, and all traffic will be seamlessly routed to this pipeline without your users ever noticing.
Format Your Search Results
For question answering pipelines, you can highlight the answer in the document, which makes it much easier for the users to spot it. Here is an example of what it looks like:
The response for a question answering pipeline contains the exact position of the answer both in the document (offsets_in_document
) and in the context (offsets_in_context
). You can use it to format how the answers are displayed.
Integrate deepset Cloud with Your Frontend App
See Tutorial: Integrating deepset Cloud API with Your Frontend App to learn how to integrate deepset Cloud API with your UI.
Pipelines on Standby
Unused pipelines go standby after 12 hours or 30 days to save resources. The time to standby depends on the pipeline service level. Pipelines on standby get automatically activated if you start searching with them, or you can trigger it manually on the Pipelines page. When a pipeline is on standby, your data remains perfectly safe and accessible anytime. For more information, see Pipeline Service Levels.
Updated 5 months ago