feat: +ver

feat: Moderation + llm arg

feat: +log
This commit is contained in:
莘权 马 2024-01-10 21:13:36 +08:00
parent 0788080e20
commit 29d8326c06
4 changed files with 9 additions and 5 deletions

View file

@ -40,7 +40,11 @@ class FaissStore(LocalStore):
return FAISS.load_local(self.raw_data_path.parent, self.embedding, self.fname)
def _write(self, docs, metadatas):
store = FAISS.from_texts(docs, self.embedding, metadatas=metadatas)
try:
store = FAISS.from_texts(docs, self.embedding, metadatas=metadatas)
except Exception as e:
logger.error(f"Failed to write. error: {e}")
raise e
return store
def persist(self):

View file

@ -11,8 +11,8 @@ from metagpt.llm import LLM
class Moderation:
def __init__(self):
self.llm = LLM()
def __init__(self, llm=None):
self.llm = llm or LLM()
def handle_moderation_results(self, results):
resp = []

View file

@ -14,7 +14,7 @@ lancedb==0.4.0
langchain==0.0.352
loguru==0.6.0
meilisearch==0.21.0
numpy==1.24.3
numpy>=1.24.3
openai==1.6.0
openpyxl
beautifulsoup4==4.12.2

View file

@ -57,7 +57,7 @@ extras_require["dev"] = (["pylint~=3.0.3", "black~=23.3.0", "isort~=5.12.0", "pr
setup(
name="metagpt",
version="0.6.3",
version="0.6.4",
description="The Multi-Agent Framework",
long_description=long_description,
long_description_content_type="text/markdown",