Skip to content

Commit

Permalink
[Python] Add to top-level imports (#767)
Browse files Browse the repository at this point in the history
Add tracing_context, get_current_tracing_context, and
get_current_run_tree to top-level imports
  • Loading branch information
hinthornw authored Jun 6, 2024
1 parent 88ddd2a commit 679585c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
25 changes: 24 additions & 1 deletion python/langsmith/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@
from langsmith.client import Client
from langsmith.evaluation import aevaluate, evaluate
from langsmith.evaluation.evaluator import EvaluationResult, RunEvaluator
from langsmith.run_helpers import trace, traceable
from langsmith.run_helpers import (
get_current_run_tree,
get_tracing_context,
trace,
traceable,
tracing_context,
)
from langsmith.run_trees import RunTree


Expand Down Expand Up @@ -62,6 +68,20 @@ def __getattr__(name: str) -> Any:
from langsmith.evaluation import aevaluate

return aevaluate
elif name == "tracing_context":
from langsmith.run_helpers import tracing_context

return tracing_context

elif name == "get_tracing_context":
from langsmith.run_helpers import get_tracing_context

return get_tracing_context

elif name == "get_current_run_tree":
from langsmith.run_helpers import get_current_run_tree

return get_current_run_tree

elif name == "unit":
from langsmith._testing import unit
Expand All @@ -84,4 +104,7 @@ def __getattr__(name: str) -> Any:
"expect",
"evaluate",
"aevaluate",
"tracing_context",
"get_tracing_context",
"get_current_run_tree",
]
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.73"
version = "0.1.74"
description = "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform."
authors = ["LangChain <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 679585c

Please sign in to comment.