First, generate an API key and save it.
The easiest way is to start with the API Reference documentation:
- Go to the Search documentation page.
- Enter the necessary parameters:
- Type the name of the pipeline to use for search.
- Optionally, add filters.
- Type the queries.
- In the Bearer field, paste the API key you previously generated.
- Choose the programing language that you want to use and copy the code.
You can then wrap this code in a function and modify it as needed.
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.
Updated about 1 month ago