From 0c3704dffdf24c1dc23cf5d91017a267a75fae47 Mon Sep 17 00:00:00 2001 From: Felix Ocker Date: Mon, 9 Sep 2024 20:31:49 +0200 Subject: [PATCH] fix(DfsTulip): use copy instead of deepcopy to keep references to other nodes intact --- src/tulip_agent/tulip_agent.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tulip_agent/tulip_agent.py b/src/tulip_agent/tulip_agent.py index b7d0063..e714f99 100644 --- a/src/tulip_agent/tulip_agent.py +++ b/src/tulip_agent/tulip_agent.py @@ -35,7 +35,6 @@ import json import logging from abc import ABC -from copy import deepcopy from typing import Optional from openai.types.chat.chat_completion_message_tool_call import ( @@ -1310,7 +1309,7 @@ def recurse( paraphrased_description = ( self._get_response(msgs=messages).choices[0].message.content ) - task.paraphrased_variants.append(deepcopy(task)) + task.paraphrased_variants.append(copy.copy(task)) task.description = paraphrased_description return self.recurse(task=task, recursion_level=recursion_level) elif len(task.generated_tools) == 0: