Skip to content

Commit

Permalink
remove think tags
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Jan 28, 2025
1 parent b50ab81 commit 0395765
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions openhands/agenthub/codeact_agent/action_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def parse_response(self, response) -> str:
if action is None:
return ''

action = re.sub(r"<think>.*?</think>", "", action, flags=re.DOTALL)

action = action.replace(r'\_', '_') # Mistral Large gives \_ instead of _
three_backticks = '```'
if action.count(three_backticks) % 2 == 1 and '<execute_' not in action:
Expand Down

0 comments on commit 0395765

Please sign in to comment.