mirror of
https://github.com/langchain-ai/langgraph-codeact.git
synced 2026-07-18 18:34:31 -04:00
【BUG】Does not support extracting multiple Python code blocks from response.content #3
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @HamaWhiteGG on GitHub (Mar 27, 2025).
In math_example.py, I received multi blocks of python code in response.content, for example:
I need to solve this problem step by step.
First, I'll find where the baseball lands when hit by the batter. Then, I'll calculate where the ball lands after being thrown by the outfielder. Finally, I'll determine the distance between the original batting position and the final landing position.
Let's start by finding where the ball first lands:
Now, let's calculate the trajectory of the ball thrown by the outfielder:
Let's see the results of these calculations to find the final distance.
but the call_model only extract the first python code.
code = response.content.split("```")[1]@vbarda commented on GitHub (Mar 31, 2025):
@HamaWhiteGG thanks for reporting - will add support for detecting multiple code blocks
@vbarda commented on GitHub (Apr 5, 2025):
Fixed in 0.1.1