Fix issue 7445 (#7635)

Description: updated BabyAGI examples and experimental to append the
iteration to the result id to fix error storing data to vectorstore.
Issue: 7445
Dependencies: no
Tag maintainer: @eyurtsev
This fix worked for me locally. Happy to take some feedback and iterate
on a better solution. I was considering appending a uuid instead but
didn't want to over complicate the example.

---------

Co-authored-by: Bagatur <baskaryan@gmail.com>
pull/9037/head
DJ Atha 1 year ago committed by GitHub
parent bb6fbf4c71
commit ee52482db8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -145,7 +145,7 @@ class BabyAGI(Chain, BaseModel):
self.print_task_result(result) self.print_task_result(result)
# Step 3: Store the result in Pinecone # Step 3: Store the result in Pinecone
result_id = f"result_{task['task_id']}" result_id = f"result_{task['task_id']}_{num_iters}"
self.vectorstore.add_texts( self.vectorstore.add_texts(
texts=[result], texts=[result],
metadatas=[{"task": task["task_name"]}], metadatas=[{"task": task["task_name"]}],

Loading…
Cancel
Save