Merge branch 'refactor/backend-architecture' into development

This commit is contained in:
yangshilin
2026-03-18 17:18:23 +08:00
parent 2070a03d35
commit 48b70e1350
266 changed files with 12386 additions and 9690 deletions

10
api/app/ports/reranker.py Normal file
View File

@@ -0,0 +1,10 @@
"""Reranker port — 可选,二期 cross-encoder rerank 能力契约。"""
from typing import Protocol, runtime_checkable
@runtime_checkable
class Reranker(Protocol):
async def rerank(self, query: str, documents: list[str]) -> list[float]:
"""Score documents against a query, return relevance scores."""
...