Skip to content

Commit 596ff65

Browse files
committed
Remove commented code and add descriptions to _generate_retrieve_user_reply
1 parent db1c9b3 commit 596ff65

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

autogen/agentchat/contrib/retrieve_user_proxy_agent.py

+5-15
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ def _generate_retrieve_user_reply(
230230
sender: Optional[Agent] = None,
231231
config: Optional[Any] = None,
232232
) -> Tuple[bool, Union[str, Dict, None]]:
233+
"""In this function, we will update the context and reset the conversation based on different conditions.
234+
We'll update the context and reset the conversation if no_update_context is False and either of the following:
235+
(1) the last message contains "UPDATE CONTEXT",
236+
(2) the last message doesn't contain "UPDATE CONTEXT" and the customized_answer_prefix is not in the message.
237+
"""
233238
if config is None:
234239
config = self
235240
if messages is None:
@@ -335,21 +340,6 @@ def run_code(self, code, **kwargs):
335340
if self._ipython is None or lang != "python":
336341
return super().run_code(code, **kwargs)
337342
else:
338-
# # capture may not work as expected
339-
# result = self._ipython.run_cell("%%capture --no-display cap\n" + code)
340-
# log = self._ipython.ev("cap.stdout")
341-
# log += self._ipython.ev("cap.stderr")
342-
# if result.result is not None:
343-
# log += str(result.result)
344-
# exitcode = 0 if result.success else 1
345-
# if result.error_before_exec is not None:
346-
# log += f"\n{result.error_before_exec}"
347-
# exitcode = 1
348-
# if result.error_in_exec is not None:
349-
# log += f"\n{result.error_in_exec}"
350-
# exitcode = 1
351-
# return exitcode, log, None
352-
353343
result = self._ipython.run_cell(code)
354344
log = str(result.result)
355345
exitcode = 0 if result.success else 1

0 commit comments

Comments
 (0)