From 5c70549a7f22db355d4f007ebfd55d0f5acd3bfd Mon Sep 17 00:00:00 2001 From: William Fu-Hinthorn <13333726+hinthornw@users.noreply.github.com> Date: Mon, 17 Jun 2024 22:27:17 -0700 Subject: [PATCH] Delay in int test --- python/langsmith/_expect.py | 6 ++++-- python/langsmith/_internal/_aiter.py | 6 ++++-- python/langsmith/_testing.py | 6 ++++-- python/langsmith/client.py | 1 - python/langsmith/evaluation/_runner.py | 3 +++ python/langsmith/run_helpers.py | 6 ++++-- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/python/langsmith/_expect.py b/python/langsmith/_expect.py index fe459e40..47bff886 100644 --- a/python/langsmith/_expect.py +++ b/python/langsmith/_expect.py @@ -413,10 +413,12 @@ def score( ## Private Methods @overload - def __call__(self, value: Any, /) -> _Matcher: ... + def __call__(self, value: Any, /) -> _Matcher: + ... @overload - def __call__(self, /, *, client: ls_client.Client) -> _Expect: ... + def __call__(self, /, *, client: ls_client.Client) -> _Expect: + ... def __call__( self, diff --git a/python/langsmith/_internal/_aiter.py b/python/langsmith/_internal/_aiter.py index aeb9d857..79292af1 100644 --- a/python/langsmith/_internal/_aiter.py +++ b/python/langsmith/_internal/_aiter.py @@ -183,10 +183,12 @@ def __len__(self) -> int: return len(self._children) @overload - def __getitem__(self, item: int) -> AsyncIterator[T]: ... + def __getitem__(self, item: int) -> AsyncIterator[T]: + ... @overload - def __getitem__(self, item: slice) -> Tuple[AsyncIterator[T], ...]: ... + def __getitem__(self, item: slice) -> Tuple[AsyncIterator[T], ...]: + ... def __getitem__( self, item: Union[int, slice] diff --git a/python/langsmith/_testing.py b/python/langsmith/_testing.py index 42cec872..a1b7a128 100644 --- a/python/langsmith/_testing.py +++ b/python/langsmith/_testing.py @@ -42,7 +42,8 @@ class SkipException(Exception): # type: ignore[no-redef] @overload def test( func: Callable, -) -> Callable: ... +) -> Callable: + ... @overload @@ -52,7 +53,8 @@ def test( output_keys: Optional[Sequence[str]] = None, client: Optional[ls_client.Client] = None, test_suite_name: Optional[str] = None, -) -> Callable[[Callable], Callable]: ... +) -> Callable[[Callable], Callable]: + ... def test(*args: Any, **kwargs: Any) -> Callable: diff --git a/python/langsmith/client.py b/python/langsmith/client.py index 746b4170..13e3eb15 100644 --- a/python/langsmith/client.py +++ b/python/langsmith/client.py @@ -1356,7 +1356,6 @@ def batch_ingest_runs( self._post_batch_ingest_runs(orjson.dumps(body_chunks)) def _post_batch_ingest_runs(self, body: bytes): - try: for api_url, api_key in self._write_api_urls.items(): self.request_with_retries( diff --git a/python/langsmith/evaluation/_runner.py b/python/langsmith/evaluation/_runner.py index ae9d983c..132124ac 100644 --- a/python/langsmith/evaluation/_runner.py +++ b/python/langsmith/evaluation/_runner.py @@ -518,6 +518,9 @@ def evaluate_comparative( View the evaluation results for experiment:... >>> results_1.wait() >>> results_2.wait() + >>> import time + ... + ... time.sleep(10) # Wait for the traces to be fully processed Finally, you would compare the two prompts directly: >>> import json diff --git a/python/langsmith/run_helpers.py b/python/langsmith/run_helpers.py index 531358cb..9d0a58c0 100644 --- a/python/langsmith/run_helpers.py +++ b/python/langsmith/run_helpers.py @@ -228,7 +228,8 @@ def __call__( @overload def traceable( func: Callable[P, R], -) -> SupportsLangsmithExtra[P, R]: ... +) -> SupportsLangsmithExtra[P, R]: + ... @overload @@ -243,7 +244,8 @@ def traceable( project_name: Optional[str] = None, process_inputs: Optional[Callable[[dict], dict]] = None, _invocation_params_fn: Optional[Callable[[dict], dict]] = None, -) -> Callable[[Callable[P, R]], SupportsLangsmithExtra[P, R]]: ... +) -> Callable[[Callable[P, R]], SupportsLangsmithExtra[P, R]]: + ... def traceable(