Code agent: allow function persistence between steps (#31769)

* Code agent: allow function persistence between steps
This commit is contained in:
Aymeric Roucher
2024-07-05 11:09:11 +02:00
committed by GitHub
parent eef0507f3d
commit 1556025271
5 changed files with 63 additions and 11 deletions

View File

@@ -660,7 +660,6 @@ add_one(1, 1)
"""
state = {}
result = evaluate_python_code(code, {"print": print, "range": range, "ord": ord, "chr": chr}, state=state)
print(state)
assert result == 2
# test returning None
@@ -672,5 +671,4 @@ returns_none(1)
"""
state = {}
result = evaluate_python_code(code, {"print": print, "range": range, "ord": ord, "chr": chr}, state=state)
print(state)
assert result is None