Former-commit-id: 0e383502c9
pull/47/head
Kye 1 year ago
parent cd321cef7d
commit c565f32304

@ -161,7 +161,7 @@ class BossNode:
def initialize_vectorstore(self): def initialize_vectorstore(self):
try: try:
embeddings_model = OpenAIEmbeddings(openai_api_key=self.openai_api_key) embeddings_model = OpenAIEmbeddings(openai_api_key=self.openai_api_key)
embedding_size = self.embedding_size embedding_size = 8192
index = faiss.IndexFlatL2(embedding_size) index = faiss.IndexFlatL2(embedding_size)
return FAISS(embeddings_model.embed_query, index, InMemoryDocstore({}), {}) return FAISS(embeddings_model.embed_query, index, InMemoryDocstore({}), {})
except Exception as e: except Exception as e:

@ -28,7 +28,7 @@ class HierarchicalSwarm:
self, self,
openai_api_key: Optional[str] = "", openai_api_key: Optional[str] = "",
use_vectorstore: Optional[bool] = True, use_vectorstore: Optional[bool] = True,
# embedding_size: Optional[int] = None,
use_async: Optional[bool] = True, use_async: Optional[bool] = True,
worker_name: Optional[str] = "Swarm Worker AI Assistant", worker_name: Optional[str] = "Swarm Worker AI Assistant",
verbose: Optional[bool] = False, verbose: Optional[bool] = False,
@ -44,7 +44,7 @@ class HierarchicalSwarm:
self.use_async = use_async self.use_async = use_async
self.worker_name = worker_name self.worker_name = worker_name
self.human_in_the_loop = human_in_the_loop self.human_in_the_loop = human_in_the_loop
# self.embedding_size = embedding_size
self.boss_prompt = boss_prompt self.boss_prompt = boss_prompt
self.temperature = temperature self.temperature = temperature
self.max_iterations = max_iterations self.max_iterations = max_iterations

Loading…
Cancel
Save