langchain/docstore/arbitrary_fn.py/DocstoreFn/search
class DocstoreFn:    def search(self, search: str) -> Document:
        r = self._lookup_fn(search)
        if isinstance(r, str):
            # NOTE: assume the search string is the source ID
            return Document(page_content=r, metadata={"source": search})
        elif isinstance(r, Document):
            return r
        raise ValueError(f"Unexpected type of document {type(r)}")