fix: patch bug in inner thoughts unpacker (#2311)

This commit is contained in:
Charles Packer
2024-12-22 21:04:29 -08:00
committed by GitHub
parent 69bace2937
commit c95157daf8
6 changed files with 59 additions and 80 deletions

View File

@@ -237,8 +237,8 @@ class Agent(BaseAgent):
)
function_response, updated_agent_state = sandbox_run_result.func_return, sandbox_run_result.agent_state
assert orig_memory_str == self.agent_state.memory.compile(), "Memory should not be modified in a sandbox tool"
self.update_memory_if_change(updated_agent_state.memory)
if updated_agent_state is not None:
self.update_memory_if_change(updated_agent_state.memory)
except Exception as e:
# Need to catch error here, or else trunction wont happen
# TODO: modify to function execution error
@@ -251,7 +251,7 @@ class Agent(BaseAgent):
def _get_ai_reply(
self,
message_sequence: List[Message],
function_call: str = "auto",
function_call: Optional[str] = None,
first_message: bool = False,
stream: bool = False, # TODO move to config?
empty_response_retry_limit: int = 3,