mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Merge branch 'fibug/quick_think_output_message_tag' into 'mgx_ops'
解决了在 quick answer 时,输出额外标签的问题 See merge request pub/MetaGPT!333
This commit is contained in:
commit
e8b1e5a438
1 changed files with 3 additions and 0 deletions
|
|
@ -299,6 +299,9 @@ class RoleZero(Role):
|
|||
self.llm.format_msg(memory),
|
||||
system_msgs=[QUICK_RESPONSE_SYSTEM_PROMPT.format(role_info=self._get_prefix())],
|
||||
)
|
||||
# If the answer contains the substring '[Message] from A to B:', remove it.
|
||||
pattern = r"\[Message\] from .+? to .+?:\s*"
|
||||
answer = re.sub(pattern, "", answer, count=1)
|
||||
if "command_name" in answer:
|
||||
# an actual TASK intent misclassified as QUICK, correct it here, FIXME: a better way is to classify it correctly in the first place
|
||||
answer = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue