diff --git a/python/.gitignore b/python/.gitignore new file mode 100644 index 000000000..1fcb1529f --- /dev/null +++ b/python/.gitignore @@ -0,0 +1 @@ +out diff --git a/python/bench/__main__.py b/python/bench/__main__.py index c3e206af9..22d49ee9e 100644 --- a/python/bench/__main__.py +++ b/python/bench/__main__.py @@ -31,10 +31,10 @@ def __init__(self): 10_000, ), ( - "dumps_class_nested_py_branch_and_leaf_200x150", + "dumps_class_nested_py_branch_and_leaf_200x400", lambda x: _dumps_json({"input": x}), create_nested_instance( - 200, 150, branch_constructor=MyClass, leaf_constructor=MyClass + 200, 400, branch_constructor=MyClass, leaf_constructor=MyClass ), ), ( @@ -43,19 +43,14 @@ def __init__(self): create_nested_instance(50, 100, leaf_constructor=MyClass), ), ( - "dumps_class_nested_py_leaf_200x400", + "dumps_class_nested_py_leaf_100x200", lambda x: _dumps_json({"input": x}), - create_nested_instance(200, 400, leaf_constructor=MyClass), + create_nested_instance(100, 200, leaf_constructor=MyClass), ), ( - "dumps_dataclass_nested_200x150", + "dumps_dataclass_nested_50x100", lambda x: _dumps_json({"input": x}), - create_nested_instance(200, 150), - ), - ( - "dumps_pydantic_nested_200x400", - lambda x: _dumps_json({"input": x}), - create_nested_instance(200, 400, branch_constructor=DeeplyNestedModel), + create_nested_instance(50, 100), ), ( "dumps_pydantic_nested_50x100", @@ -63,9 +58,9 @@ def __init__(self): create_nested_instance(50, 100, branch_constructor=DeeplyNestedModel), ), ( - "dumps_pydanticv1_nested_200x150", + "dumps_pydanticv1_nested_50x100", lambda x: _dumps_json({"input": x}), - create_nested_instance(200, 150, branch_constructor=DeeplyNestedModelV1), + create_nested_instance(50, 100, branch_constructor=DeeplyNestedModelV1), ), ) diff --git a/python/bench/create_run_tree.py b/python/bench/create_run_tree.py index 29cc84f44..8d4022381 100644 --- a/python/bench/create_run_tree.py +++ b/python/bench/create_run_tree.py @@ -1,7 +1,10 @@ +import os from unittest.mock import patch from langsmith import RunTree +os.environ["LANGSMITH_API_KEY"] = "fake" + def create_run_trees(N: int): with patch("langsmith.client.requests.Session", autospec=True):