Merge pull request #766 from iorisa/feature/agentstore/v0.6

feat: Integrating with the agent store
This commit is contained in:
Guess 2024-01-17 14:45:13 +08:00 committed by GitHub
commit 4e3e5f8811
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 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

@ -494,6 +494,7 @@ class Role(SerializationMixin, is_polymorphic_base=True):
async def think(self) -> Action:
"""The exported `think` function"""
await self._observe()
await self._think()
return self.rc.todo

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.4",
version="0.6.5",
description="The Multi-Agent Framework",
long_description=long_description,
long_description_content_type="text/markdown",