def METHOD_NAME():
    txt_converter = TextConverter()
    text_splitter = CharacterTextSplitter(
        separator="\n", chunk_size=args.data_chunk_size, chunk_overlap=0, filters=["\n"]
    )
    if args.search_engine == "faiss":
        document_store = FAISSDocumentStore(embedding_dim=768, faiss_index_factory_str="Flat", return_embedding=True)
    else:
        document_store = BaiduElasticsearchDocumentStore(
            embedding_dim=768,
            duplicate_documents="skip",
            host=args.host,
            port=args.port,
            username=args.username,
            password=args.password,
            index=args.index_name,
            similarity="dot_prod",
            vector_type="bpack_vector",
            search_fields=["content", "meta"],
            chunk_size=args.es_chunk_size,
            thread_count=args.es_thread_count,
            queue_size=args.es_queue_size,
        )
    use_gpu = True if args.device == "gpu" else False
    retriever = ParallelRetriever(
        document_store=document_store,
        params_path=args.params_path,
        output_emb_size=None,
        max_seq_len_query=args.max_seq_len_query,
        max_seq_len_passage=args.max_seq_len_passage,
        use_gpu=use_gpu,
        batch_size=args.retriever_batch_size,
        embed_title=args.embed_title,
        url=args.url,
        num_process=args.num_process,
    )
    indexing_pipeline = Pipeline()
    indexing_pipeline.add_node(component=txt_converter, name="txt_converter", inputs=["File"])
    indexing_pipeline.add_node(component=text_splitter, name="Splitter", inputs=["txt_converter"])
    indexing_pipeline.add_node(component=retriever, name="Retriever", inputs=["Splitter"])
    indexing_pipeline.add_node(component=document_store, name="DocumentStore", inputs=["Retriever"])
    files = glob.glob(args.file_paths + "/**/*.txt", recursive=True)
    indexing_pipeline.run(file_paths=files)
    ernie_bot = ErnieBot(api_key=args.api_key, secret_key=args.secret_key)
    ranker = ErnieRanker(model_name_or_path="rocketqa-zh-dureader-cross-encoder", use_gpu=True)
    query_pipeline = Pipeline()
    query_pipeline.add_node(component=retriever, name="Retriever", inputs=["Query"])
    query_pipeline.add_node(component=ranker, name="Ranker", inputs=["Retriever"])
    query_pipeline.add_node(component=PromptTemplate("背景：{documents} 问题：{query}"), name="Template", inputs=["Ranker"])
    query_pipeline.add_node(
        component=TruncatedConversationHistory(max_length=256), name="TruncateHistory", inputs=["Template"]
    )
    query_pipeline.add_node(component=ernie_bot, name="ErnieBot", inputs=["TruncateHistory"])
    query = "高血压出现头晕，脸红的症状怎么办？"
    prediction = query_pipeline.run(query=query, params={"Retriever": {"top_k": 30}, "Ranker": {"top_k": 3}})
    print("user: {}".format(query))
    print("assistant: {}".format(prediction["result"]))