Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
__init__.py204 linesDownload Raw Back to langsmith
1"""LangSmith Client."""2 3from typing import TYPE_CHECKING, Any4 5if TYPE_CHECKING:6    from langsmith._expect import expect7    from langsmith.async_client import AsyncClient8    from langsmith.client import Client, TracingMode9    from langsmith.evaluation import (10        aevaluate,11        aevaluate_existing,12        evaluate,13        evaluate_existing,14    )15    from langsmith.evaluation.evaluator import EvaluationResult, RunEvaluator16    from langsmith.prompt_cache import AsyncPromptCache, PromptCache17    from langsmith.run_helpers import (18        get_current_run_tree,19        get_tracing_context,20        set_run_metadata,21        trace,22        traceable,23        tracing_context,24    )25    from langsmith.run_trees import RunTree, configure26    from langsmith.testing._internal import test, unit27    from langsmith.utils import ContextThreadPoolExecutor28    from langsmith.uuid import uuid7, uuid7_from_datetime29 30# Avoid calling into importlib on every call to __version__31 32__version__ = "0.8.3"33version = __version__  # for backwards compatibility34 35 36def __getattr__(name: str) -> Any:37    if name == "__version__":38        return version39    elif name == "Client":40        from langsmith.client import Client41 42        return Client43    elif name == "TracingMode":44        from langsmith.client import TracingMode45 46        return TracingMode47    elif name == "AsyncClient":48        from langsmith.async_client import AsyncClient49 50        return AsyncClient51    elif name == "RunTree":52        from langsmith.run_trees import RunTree53 54        return RunTree55    elif name == "EvaluationResult":56        from langsmith.evaluation.evaluator import EvaluationResult57 58        return EvaluationResult59    elif name == "RunEvaluator":60        from langsmith.evaluation.evaluator import RunEvaluator61 62        return RunEvaluator63    elif name == "trace":64        from langsmith.run_helpers import trace65 66        return trace67    elif name == "traceable":68        from langsmith.run_helpers import traceable69 70        return traceable71 72    elif name == "test":73        from langsmith.testing._internal import test74 75        return test76 77    elif name == "expect":78        from langsmith._expect import expect79 80        return expect81    elif name == "evaluate":82        from langsmith.evaluation import evaluate83 84        return evaluate85 86    elif name == "evaluate_existing":87        from langsmith.evaluation import evaluate_existing88 89        return evaluate_existing90    elif name == "aevaluate":91        from langsmith.evaluation import aevaluate92 93        return aevaluate94    elif name == "aevaluate_existing":95        from langsmith.evaluation import aevaluate_existing96 97        return aevaluate_existing98    elif name == "tracing_context":99        from langsmith.run_helpers import tracing_context100 101        return tracing_context102 103    elif name == "get_tracing_context":104        from langsmith.run_helpers import get_tracing_context105 106        return get_tracing_context107    elif name == "get_current_run_tree":108        from langsmith.run_helpers import get_current_run_tree109 110        return get_current_run_tree111    elif name == "set_run_metadata":112        from langsmith.run_helpers import set_run_metadata113 114        return set_run_metadata115 116    elif name == "unit":117        from langsmith.testing._internal import unit118 119        return unit120    elif name == "ContextThreadPoolExecutor":121        from langsmith.utils import ContextThreadPoolExecutor122 123        return ContextThreadPoolExecutor124    elif name == "configure":125        from langsmith.run_trees import configure126 127        return configure128    elif name == "uuid7":129        from langsmith.uuid import uuid7130 131        return uuid7132    elif name == "uuid7_from_datetime":133        from langsmith.uuid import uuid7_from_datetime134 135        return uuid7_from_datetime136    elif name == "PromptCache":137        from langsmith.prompt_cache import PromptCache138 139        return PromptCache140    elif name == "AsyncPromptCache":141        from langsmith.prompt_cache import AsyncPromptCache142 143        return AsyncPromptCache144    elif name == "Cache":145        from langsmith.prompt_cache import Cache146 147        return Cache148    elif name == "AsyncCache":149        from langsmith.prompt_cache import AsyncCache150 151        return AsyncCache152    elif name == "configure_global_prompt_cache":153        from langsmith.prompt_cache import configure_global_prompt_cache154 155        return configure_global_prompt_cache156 157    elif name == "configure_global_async_prompt_cache":158        from langsmith.prompt_cache import configure_global_async_prompt_cache159 160        return configure_global_async_prompt_cache161 162    elif name == "set_runtime_overrides":163        from langsmith._runtime_overrides import set_runtime_overrides164 165        return set_runtime_overrides166 167    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")168 169 170__all__ = [171    "Client",172    "AsyncClient",173    "TracingMode",174    "PromptCache",175    "AsyncPromptCache",176    "Cache",177    "AsyncCache",178    "configure_global_prompt_cache",179    "configure_global_async_prompt_cache",180    "RunTree",181    "configure",182    "__version__",183    "EvaluationResult",184    "RunEvaluator",185    "anonymizer",186    "traceable",187    "trace",188    "unit",189    "test",190    "expect",191    "evaluate",192    "evaluate_existing",193    "aevaluate_existing",194    "aevaluate",195    "tracing_context",196    "get_tracing_context",197    "get_current_run_tree",198    "set_run_metadata",199    "ContextThreadPoolExecutor",200    "uuid7",201    "uuid7_from_datetime",202    "set_runtime_overrides",203]204 
codekingpro/portable-devtools · Team Ai