def collect(self, doc_id: str, field_name: str, field_content: Any, field_type: Optional[FieldType] = None) -> Any:
        """
        Collect tensor field content from the document if it is a tensor field.

        Args:
            doc_id: document id
            field_name: name of the field
            field_content: content of the field
            field_type: type of field, only present for structured index
        Returns:
            The field content
        """
        if field_name not in self._tensor_fields and field_name not in self._multimodal_sub_field_reverse_map:
            # not tensor fields, no need to collect
            return field_content

        if self.is_custom_tensor_field(field_name):
            return self._collect_custom_vector_field(doc_id, field_name, field_content)

        if self.is_multimodal_field(field_name):
            raise AddDocumentsError(
                f"Field {field_name} is a multimodal combination field and cannot be assigned a value."
            )

        if not isinstance(field_content, str):
            raise AddDocumentsError(
                f'Invalid type {type(field_content)} for tensor field {field_name}'
            )

        field = TensorField(
            doc_id=doc_id,
            field_name=field_name,
            field_content=field_content,
            field_type=field_type,
            is_top_level_tensor_field=field_name in self._tensor_fields,
            is_multimodal_subfield=field_name in self._multimodal_sub_field_reverse_map
        )
        self._tensor_field_map[doc_id][field_name] = field
        return field_content

        Collect tensor field content from the document if it is a tensor field.

        Args:
            doc_id: document id
            field_name: name of the field
            field_content: content of the field
            field_type: type of field, only present for structured index
        Returns:
            The field content
        
src/marqo/core/inference/tensor_fields_container.py