From 666cac971fd2cfbd368dce7450572d06598c0d33 Mon Sep 17 00:00:00 2001 From: seehi <6580@pm.me> Date: Thu, 14 Mar 2024 22:41:38 +0800 Subject: [PATCH] add runtime_checkable to support 3.10 --- metagpt/rag/interface.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/metagpt/rag/interface.py b/metagpt/rag/interface.py index 726f68772..867605edc 100644 --- a/metagpt/rag/interface.py +++ b/metagpt/rag/interface.py @@ -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"""