mirror of
https://github.com/microsoft/autogen.git
synced 2025-10-03 20:15:49 +00:00
Improve update context condition checking rule (#2883)
Co-authored-by: Chi Wang <wang.chi@microsoft.com>
This commit is contained in:
parent
a0787aced3
commit
11b8c767ca
@ -81,6 +81,7 @@ Context is: {input_context}
|
||||
"""
|
||||
|
||||
HASH_LENGTH = int(os.environ.get("HASH_LENGTH", 8))
|
||||
UPDATE_CONTEXT_IN_PROMPT = "you should reply exactly `UPDATE CONTEXT`"
|
||||
|
||||
|
||||
class RetrieveUserProxyAgent(UserProxyAgent):
|
||||
@ -471,7 +472,7 @@ class RetrieveUserProxyAgent(UserProxyAgent):
|
||||
message = message.get("content", "")
|
||||
elif not isinstance(message, str):
|
||||
message = ""
|
||||
update_context_case1 = "UPDATE CONTEXT" in message[-20:].upper() or "UPDATE CONTEXT" in message[:20].upper()
|
||||
update_context_case1 = "UPDATE CONTEXT" in message.upper() and UPDATE_CONTEXT_IN_PROMPT not in message
|
||||
update_context_case2 = self.customized_answer_prefix and self.customized_answer_prefix not in message.upper()
|
||||
return update_context_case1, update_context_case2
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user