Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate name #934

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions python/langsmith/run_trees.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions python/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <support@langchain.dev>"]
license = "MIT"
Expand Down
10 changes: 7 additions & 3 deletions python/tests/unit_tests/test_run_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand All @@ -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"
Expand All @@ -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():
Expand Down
Loading