def translate_add_documents_response(self, responses: Optional[FeedBatchResponse],
                                         index_name: str,
                                         unsuccessful_docs: List,
                                         add_docs_processing_time_ms: float) \
            -> MarqoAddDocumentsResponse:
        """Translate Vespa FeedBatchResponse into MarqoAddDocumentsResponse.

        Args:
            responses: The response from Vespa
            index_name: The name of the index
            unsuccessful_docs: The list of unsuccessful documents
            add_docs_processing_time_ms: The processing time of the add documents operation, in milliseconds

        Return:
            MarqoAddDocumentsResponse: The response of the add documents operation
        """

        new_items: List[MarqoAddDocumentsItem] = []
        # A None response means no documents are sent to Vespa. Probably all documents are invalid and blocked in Marqo.
        errors = responses.errors if responses is not None else True

        if responses is not None:
            for resp in responses.responses:
                doc_id = self.extract_document_id_from_vespa_id(resp)
                status, message = self.vespa_client.translate_vespa_document_response(resp.status, resp.message)
                new_item = MarqoAddDocumentsItem(id=doc_id, status=status, message=message)
                new_items.append(new_item)

        for loc, error_info in unsuccessful_docs:
            new_items.insert(loc, error_info)
            errors = True

        return MarqoAddDocumentsResponse(errors=errors, index_name=index_name, items=new_items,
                                         processingTimeMs=add_docs_processing_time_ms)
Translate Vespa FeedBatchResponse into MarqoAddDocumentsResponse.

        Args:
            responses: The response from Vespa
            index_name: The name of the index
            unsuccessful_docs: The list of unsuccessful documents
            add_docs_processing_time_ms: The processing time of the add documents operation, in milliseconds

        Return:
            MarqoAddDocumentsResponse: The response of the add documents operation
        
src/marqo/core/document/document.py