Harrison/tools exp (#372)

This commit is contained in:
Harrison Chase
2022-12-18 21:51:23 -05:00
committed by GitHub
parent e7b625fe03
commit cf98f219f9
35 changed files with 1033 additions and 376 deletions

View File

@@ -1,7 +1,5 @@
"""Test functionality of Python REPL."""
import pytest
from langchain.python import PythonREPL
@@ -22,8 +20,8 @@ def test_python_repl_no_previous_variables() -> None:
"""Test that it does not have access to variables created outside the scope."""
foo = 3 # noqa: F841
repl = PythonREPL()
with pytest.raises(NameError):
repl.run("print(foo)")
output = repl.run("print(foo)")
assert output == "name 'foo' is not defined"
def test_python_repl_pass_in_locals() -> None: