It's evident that result == vector, which I've tested also by a simple assert in the code. Hence either result or vector should be removed.
Furthermore, Chroma's impl of add function uses exclusively a param vector, whereas Pinecone uses result (it's actually storing the vector embedding to a vector variable but that's not passed anywhere). Hence the add function should be simplified to just add(task, result, result_id).
Last, since result is always of type str the signature of add function in DefaultResultsStorage as well as PineconeResultsStorage should be then: def add(self, task: Dict, result: str, result_id: int)
Hi there,
I've been playing with BabyAGI lately, trying to provide strong types, and found out the following redundancy/inconsistency problem.
The
vector
variable in themain
function is defined as:and its only use is to be passed to the storage's
add
function asIt's evident that
result == vector
, which I've tested also by a simple assert in the code. Hence eitherresult
orvector
should be removed.Furthermore, Chroma's impl of
add
function uses exclusively a paramvector
, whereas Pinecone usesresult
(it's actually storing the vector embedding to avector
variable but that's not passed anywhere). Hence theadd
function should be simplified to justadd(task, result, result_id)
.Last, since
result
is always of typestr
the signature ofadd
function inDefaultResultsStorage
as well asPineconeResultsStorage
should be then:def add(self, task: Dict, result: str, result_id: int)