feat: 调整结构
This commit is contained in:
parent
5562641431
commit
debd807416
|
|
@ -8,11 +8,21 @@ from src.pipeline.core import llm, es, nodes, utils
|
|||
from src.pipeline.core.skills import load_skills
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_embedding():
|
||||
@pytest.fixture(scope="session")
|
||||
async def init_llm():
|
||||
await llm.init_client()
|
||||
await es.init_client()
|
||||
yield
|
||||
await llm.close_client()
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
async def init_es():
|
||||
await es.init_client()
|
||||
yield
|
||||
await es.close_client()
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_embedding(init_llm, init_es):
|
||||
logger.debug("file to es")
|
||||
|
||||
shared = {
|
||||
|
|
@ -32,12 +42,9 @@ async def test_embedding():
|
|||
|
||||
logger.debug(json.dumps([{**x, "embedding":x["embedding"][:4]} for x in shared["documents"]], indent=4, ensure_ascii=False))
|
||||
|
||||
await llm.close_client()
|
||||
await es.close_client()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_search():
|
||||
async def test_search(init_llm, init_es):
|
||||
await llm.init_client()
|
||||
await es.init_client()
|
||||
logger.debug("search from es")
|
||||
|
|
@ -73,7 +80,7 @@ async def test_search():
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_rerank():
|
||||
async def test_rerank(init_llm, init_es):
|
||||
await llm.init_client()
|
||||
await es.init_client()
|
||||
logger.debug("search from es")
|
||||
|
|
@ -113,7 +120,7 @@ async def test_rerank():
|
|||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_agent():
|
||||
async def test_agent(init_llm, init_es):
|
||||
await llm.init_client()
|
||||
await es.init_client()
|
||||
|
||||
Loading…
Reference in New Issue