Skip to content

Commit

Permalink
Add a testing decorator (#580)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos authored Apr 9, 2024
2 parents 39de938 + 91eaf88 commit 12114cb
Show file tree
Hide file tree
Showing 5 changed files with 423 additions and 12 deletions.
12 changes: 7 additions & 5 deletions python/langsmith/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""LangSmith Client."""

from typing import TYPE_CHECKING, Any, List
from typing import TYPE_CHECKING, Any

if TYPE_CHECKING:
from langsmith._testing import unit
from langsmith.client import Client
from langsmith.evaluation.evaluator import EvaluationResult, RunEvaluator
from langsmith.run_helpers import trace, traceable
Expand Down Expand Up @@ -41,6 +42,10 @@ def __getattr__(name: str) -> Any:
from langsmith.run_helpers import traceable

return traceable
elif name == "unit":
from langsmith._testing import unit

return unit

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")

Expand All @@ -53,8 +58,5 @@ def __getattr__(name: str) -> Any:
"RunEvaluator",
"traceable",
"trace",
"unit",
]


def __dir__() -> List[str]:
return __all__
Loading

0 comments on commit 12114cb

Please sign in to comment.