diff --git a/python/langsmith/run_trees.py b/python/langsmith/run_trees.py index fd23426c9..0c44c697e 100644 --- a/python/langsmith/run_trees.py +++ b/python/langsmith/run_trees.py @@ -354,6 +354,7 @@ def from_runnable_config( kwargs["start_time"] = run.start_time kwargs["end_time"] = run.end_time kwargs["tags"] = sorted(set(run.tags or [] + kwargs.get("tags", []))) + kwargs["name"] = run.name extra_ = kwargs.setdefault("extra", {}) metadata_ = extra_.setdefault("metadata", {}) metadata_.update(run.metadata) diff --git a/python/poetry.lock b/python/poetry.lock index 6e1a324ec..61f76a8ee 100644 --- a/python/poetry.lock +++ b/python/poetry.lock @@ -560,13 +560,13 @@ files = [ [[package]] name = "marshmallow" -version = "3.21.3" +version = "3.22.0" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." optional = false python-versions = ">=3.8" files = [ - {file = "marshmallow-3.21.3-py3-none-any.whl", hash = "sha256:86ce7fb914aa865001a4b2092c4c2872d13bc347f3d42673272cabfdbad386f1"}, - {file = "marshmallow-3.21.3.tar.gz", hash = "sha256:4f57c5e050a54d66361e826f94fba213eb10b67b2fdb02c3e0343ce207ba1662"}, + {file = "marshmallow-3.22.0-py3-none-any.whl", hash = "sha256:71a2dce49ef901c3f97ed296ae5051135fd3febd2bf43afe0ae9a82143a494d9"}, + {file = "marshmallow-3.22.0.tar.gz", hash = "sha256:4972f529104a220bb8637d595aa4c9762afbe7f7a77d82dc58c1615d70c5823e"}, ] [package.dependencies] @@ -574,7 +574,7 @@ packaging = ">=17.0" [package.extras] dev = ["marshmallow[tests]", "pre-commit (>=3.5,<4.0)", "tox"] -docs = ["alabaster (==0.7.16)", "autodocsumm (==0.2.12)", "sphinx (==7.3.7)", "sphinx-issues (==4.1.0)", "sphinx-version-warning (==1.1.2)"] +docs = ["alabaster (==1.0.0)", "autodocsumm (==0.2.13)", "sphinx (==8.0.2)", "sphinx-issues (==4.1.0)", "sphinx-version-warning (==1.1.2)"] tests = ["pytest", "pytz", "simplejson"] [[package]] @@ -790,13 +790,13 @@ files = [ [[package]] name = "openai" -version = "1.41.1" +version = "1.42.0" description = "The official Python library for the openai API" optional = false python-versions = ">=3.7.1" files = [ - {file = "openai-1.41.1-py3-none-any.whl", hash = "sha256:56fb04105263f79559aff3ceea2e1dd16f8c5385e8238cb66cf0e6888fa8bfcf"}, - {file = "openai-1.41.1.tar.gz", hash = "sha256:e38e376efd91e0d4db071e2a6517b6b4cac1c2a6fd63efdc5ec6be10c5967c1b"}, + {file = "openai-1.42.0-py3-none-any.whl", hash = "sha256:dc91e0307033a4f94931e5d03cc3b29b9717014ad5e73f9f2051b6cb5eda4d80"}, + {file = "openai-1.42.0.tar.gz", hash = "sha256:c9d31853b4e0bc2dc8bd08003b462a006035655a701471695d0bfdc08529cde3"}, ] [package.dependencies] diff --git a/python/pyproject.toml b/python/pyproject.toml index 1e3462dc8..9258f3fc1 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "langsmith" -version = "0.1.100" +version = "0.1.101" description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform." authors = ["LangChain "] license = "MIT" diff --git a/python/tests/unit_tests/test_run_helpers.py b/python/tests/unit_tests/test_run_helpers.py index d3451e88f..15fe7af6b 100644 --- a/python/tests/unit_tests/test_run_helpers.py +++ b/python/tests/unit_tests/test_run_helpers.py @@ -1156,7 +1156,7 @@ def child(inputs: dict) -> dict: return {**stage_added["child_output"], **inputs} @RunnableLambda - def parent(inputs: dict) -> dict: + def the_parent(inputs: dict) -> dict: return { **stage_added["parent_output"], **child.invoke({**stage_added["child_input"], **inputs}), @@ -1167,12 +1167,14 @@ def parent(inputs: dict) -> dict: for stage in stage_added: current = {**current, **stage_added[stage]} expected_at_stage[stage] = current - parent_result = parent.invoke(stage_added["parent_input"], {"callbacks": [tracer]}) + parent_result = the_parent.invoke( + stage_added["parent_input"], {"callbacks": [tracer]} + ) assert parent_result == expected_at_stage["parent_output"] mock_posts = _get_calls(tracer.client, minimum=2) assert len(mock_posts) == 2 datas = [json.loads(mock_post.kwargs["data"]) for mock_post in mock_posts] - assert datas[0]["name"] == "parent" + assert datas[0]["name"] == "the_parent" assert datas[0]["inputs"] == expected_at_stage["parent_input"] assert not datas[0]["outputs"] assert datas[1]["name"] == "child" @@ -1188,10 +1190,12 @@ def parent(inputs: dict) -> dict: assert child_patch["id"] == child_uid assert child_patch["outputs"] == expected_at_stage["child_output"] assert child_patch["inputs"] == expected_at_stage["child_input"] + assert child_patch["name"] == "child" parent_patch = json.loads(mock_patches[1].kwargs["data"]) assert parent_patch["id"] == parent_uid assert parent_patch["outputs"] == expected_at_stage["parent_output"] assert parent_patch["inputs"] == expected_at_stage["parent_input"] + assert parent_patch["name"] == "the_parent" def test_trace_respects_tracing_context():