From ee52482db836057fb1264e58f91368d04491e20f Mon Sep 17 00:00:00 2001 From: DJ Atha Date: Thu, 10 Aug 2023 17:29:31 -0600 Subject: [PATCH] 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 --- .../autonomous_agents/baby_agi/baby_agi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/baby_agi.py b/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/baby_agi.py index 72ed46d46e..cd4f03fb93 100644 --- a/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/baby_agi.py +++ b/libs/experimental/langchain_experimental/autonomous_agents/baby_agi/baby_agi.py @@ -145,7 +145,7 @@ class BabyAGI(Chain, BaseModel): self.print_task_result(result) # 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( texts=[result], metadatas=[{"task": task["task_name"]}],