add runtime_checkable to support 3.10

This commit is contained in:
seehi 2024-03-14 22:41:38 +08:00
parent 468e574ef0
commit 666cac971f

View file

@ -1,8 +1,9 @@
"""RAG Interfaces."""
from typing import Protocol
from typing import Protocol, runtime_checkable
@runtime_checkable
class RAGObject(Protocol):
"""Support rag add object."""
@ -16,6 +17,7 @@ class RAGObject(Protocol):
"""
@runtime_checkable
class NoEmbedding(Protocol):
"""Some retriever does not require embeddings, e.g. BM25"""