feat: 检索测试

This commit is contained in:
李如威 2025-12-19 14:06:46 +08:00
parent cf9d972e00
commit eb73101ddb
1 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,6 @@ from src.pipeline.core import llm, es, nodes
@pytest.mark.asyncio
async def test_embedding():
return
await llm.init_client()
await es.init_client()
@ -24,7 +23,8 @@ async def test_embedding():
chunkNode = nodes.ChunkDocumentsNode()
embeddingNode = nodes.EmbeddingDocumentsNode()
writeToESNode = nodes.WriteDocumentsToESNode()
readNode >> chunkNode >> embeddingNode >> writeToESNode
readNode >> chunkNode >> embeddingNode
# >> writeToESNode
flow = AsyncFlow(readNode)
await flow.run_async(shared)
@ -44,6 +44,7 @@ async def test_search():
shared = {
"text": "那座山盛产金属矿物",
"index": "test_kb",
"results": [], # [{es_id, doc_id, title, type, created_at, score, content}]
}
embeddingNode = nodes.EmbeddingNode()