def read_file(conn: Connection, file_path: str, params: dict) -> Document:
        """
        Read a file using OracleReader
        Args:
            conn: Oracle Connection,
            file_path: Oracle Directory,
            params: ONNX file name.

        Returns:
            Plain text and metadata as Document.

        """
        metadata = {}

        try:
            import oracledb
        except ImportError as e:
            raise ImportError(
                "Unable to import oracledb, please install with "
                "`pip install -U oracledb`."
            ) from e

        try:
            oracledb.defaults.fetch_lobs = False
            cursor = conn.cursor()

            with open(file_path, "rb") as f:
                data = f.read()

            if data is None:
                return Document(text="", metadata=metadata)

            mdata = cursor.var(oracledb.DB_TYPE_CLOB)
            text = cursor.var(oracledb.DB_TYPE_CLOB)
            cursor.execute(
                """
                declare
                    input blob;
                begin
                    input := :blob;
                    :mdata := dbms_vector_chain.utl_to_text(input, json(:pref));
                    :text := dbms_vector_chain.utl_to_text(input);
                end;""",
                blob=data,
                pref=json.dumps(params),
                mdata=mdata,
                text=text,
            )
            cursor.close()

            if mdata is None:
                metadata = {}
            else:
                doc_data = str(mdata.getvalue())
                if doc_data.startswith(("<!DOCTYPE html", "<HTML>")):
                    p = ParseOracleDocMetadata()
                    p.feed(doc_data)
                    metadata = p.get_metadata()

            doc_id = OracleDocReader.generate_object_id(conn.username + "$" + file_path)
            metadata["_oid"] = doc_id
            metadata["_file"] = file_path

            if text is None:
                return Document(text="", metadata=metadata)
            else:
                return Document(text=str(text.getvalue()), metadata=metadata)

        except Exception as ex:
            print(f"An exception occurred :: {ex}")
            print(f"Skip processing {file_path}")
            cursor.close()
            return None

        Read a file using OracleReader
        Args:
            conn: Oracle Connection,
            file_path: Oracle Directory,
            params: ONNX file name.

        Returns:
            Plain text and metadata as Document.

        
llama-index-integrations/readers/llama-index-readers-oracleai/llama_index/readers/oracleai/base.py