Open
Description
Describe the bug
The code running will fail if LLM put triple backtisk ``` in Thoughts:
May related to #201
Code to reproduce the error
from smolagents import parse_code_blobs, fix_final_answer_code
code_action = fix_final_answer_code(parse_code_blobs("""
Thought:
xxxxxxxxxxxxxxx
```
invalid code
```
Code:
```
print("valid code")
```"""))
assert "invalid code" not in code_action
Error logs (if any)
None
Expected behavior
should be print("valid code")
Packages version:
smolagents==1.13.0
Additional context
If code block caontins nested backtisk, it will also fail.
ex.
final_anwser("""
``` nested ```
""")