Skip to content

Commit

Permalink
Merge pull request #766 from iorisa/feature/agentstore/v0.6
Browse files Browse the repository at this point in the history
feat: Integrating with the agent store
  • Loading branch information
iorisa authored Jan 17, 2024
2 parents 7493a23 + b275f1a commit 4e3e5f8
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
6 changes: 5 additions & 1 deletion metagpt/document_store/faiss_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def _load(self) -> Optional["FaissStore"]:
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):
Expand Down
1 change: 1 addition & 0 deletions metagpt/roles/role.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ def is_idle(self) -> bool:

async def think(self) -> Action:
"""The exported `think` function"""
await self._observe()
await self._think()
return self.rc.todo

Expand Down
4 changes: 2 additions & 2 deletions metagpt/tools/moderation.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@


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 = []
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def run(self):

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",
Expand Down

0 comments on commit 4e3e5f8

Please sign in to comment.