Controller Module¶
pipelines.rest_api.controller.document ¶
delete_documents ¶
This endpoint allows you to delete documents contained in your document store. You can filter the documents to delete by metadata (like the document's name), or provide an empty JSON object to clear the document store.
Example of filters:
'{"filters": {{"name": ["some", "more"], "category": ["only_one"]}}'
To get all documents you should provide an empty dict, like:
'{"filters": {}}'
Source code in pipelines/rest_api/controller/document.py
get_documents ¶
This endpoint allows you to retrieve documents contained in your document store. You can filter the documents to delete by metadata (like the document's name), or provide an empty JSON object to clear the document store.
Example of filters:
'{"filters": {{"name": ["some", "more"], "category": ["only_one"]}}'
To get all documents you should provide an empty dict, like:
'{"filters": {}}'
Source code in pipelines/rest_api/controller/document.py
pipelines.rest_api.controller.feedback ¶
delete_feedback ¶
This endpoint allows the API user to delete all the
feedback that has been sumbitted through the
POST /feedback endpoint
Source code in pipelines/rest_api/controller/feedback.py
export_feedback ¶
export_feedback(context_size: int = 100000, full_document_context: bool = True, only_positive_labels: bool = False)
This endpoint returns JSON output in the SQuAD format for question/answer pairs
that were marked as "relevant" by user feedback through the POST /feedback endpoint.
The context_size param can be used to limit response size for large documents.
Source code in pipelines/rest_api/controller/feedback.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 | |
get_feedback ¶
This endpoint allows the API user to retrieve all the feedback that has been submitted
through the POST /feedback endpoint.
Source code in pipelines/rest_api/controller/feedback.py
get_feedback_metrics ¶
This endpoint returns basic accuracy metrics based on user feedback, e.g., the ratio of correct answers or correctly identified documents. You can filter the output by document or label.
Example:
curl --location --request POST 'http://127.0.0.1:8000/eval-doc-qa-feedback' --header 'Content-Type: application/json' --data-raw '{ "filters": {"document_id": ["XRR3xnEBCYVTkbTystOB"]} }'
Source code in pipelines/rest_api/controller/feedback.py
post_feedback ¶
This endpoint allows the API user to submit feedback on an answer for a particular query.
For example, the user can send feedback on whether the answer was correct and whether the right snippet was identified as the answer.
Information submitted through this endpoint is used to train the underlying QA model.
Source code in pipelines/rest_api/controller/feedback.py
pipelines.rest_api.controller.file_upload ¶
upload_file ¶
upload_file(files: List[UploadFile] = File(...), meta: Optional[str] = Form('null'), fileconverter_params: FileConverterParams = Depends(FileConverterParams.as_form), preprocessor_params: PreprocessorParams = Depends(PreprocessorParams.as_form))
You can use this endpoint to upload a file for indexing
Source code in pipelines/rest_api/controller/file_upload.py
upload_qa_file ¶
upload_qa_file(files: List[UploadFile] = File(...), meta: Optional[str] = Form('null'), fileconverter_params: FileConverterParams = Depends(FileConverterParams.as_form))
You can use this endpoint to upload a file for indexing
Source code in pipelines/rest_api/controller/file_upload.py
pipelines.rest_api.controller.router ¶
pipelines.rest_api.controller.search ¶
chatfile_query ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.
Source code in pipelines/rest_api/controller/search.py
check_status ¶
This endpoint can be used during startup to understand if the server is ready to take any requests, or is still loading.
The recommended approach is to call this endpoint with a short timeout, like 500ms, and in case of no reply, consider the server busy.
Source code in pipelines/rest_api/controller/search.py
pipelines_version ¶
query ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.
Source code in pipelines/rest_api/controller/search.py
query_documents ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.
Source code in pipelines/rest_api/controller/search.py
query_images ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.
Source code in pipelines/rest_api/controller/search.py
query_images_for_retrieval ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.
Source code in pipelines/rest_api/controller/search.py
query_qa_pairs ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.
Source code in pipelines/rest_api/controller/search.py
senta_file ¶
This endpoint receives the question as a string and allows the requester to set additional parameters that will be passed on to the pipelines pipeline.