from agent.api_outter import vector_similarity_search,execute_reg import agent.core.dao as dao async def test_bm25(): phrase = "职业:民宿服务; 投向:民宿服务; 用途:经营民宿" result = await execute_reg(None,None,phrase) print('to here 1') print(result) # step2: 向量检索 if not result or len(result) == 0: result = vector_similarity_search(phrase) print('to here 2') print(result) # step3: LLM 打标 if result: tags = dao.query_dict(""" select id,tag_nm as tag_name,tag_code, tag_path,category_id,tag_prompt from aitag_tag_info where id in %s """, (tuple(result),)) print('to here 3') print(tags) import asyncio asyncio.run(test_bm25())