Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-langsmith for openSUSE:Factory checked in at 2026-11-26 15:53:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-langsmith (Old) and /work/SRC/openSUSE:Factory/.python-langsmith.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-langsmith" Thu Nov 26 15:53:40 2026 rev:47 rq:1400528 version:0.16.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-langsmith/python-langsmith.changes 2026-11-24 12:47:14.234345163 +0100 +++ /work/SRC/openSUSE:Factory/.python-langsmith.new.1340718/python-langsmith.changes 2026-11-26 15:53:59.094222543 +0100 @@ -1,0 +2,16 @@ +Wed Nov 25 09:40:52 UTC 2026 - Martin Pluskal <[email protected]> + +- Update to 0.16.2: + * Annotation queues: list a queue's reviewers + with their progress + * SDK: keep only span context for ended OTel + spans + * SDK: log Gemini model turns with the assistant + role in wrapper inputs + * No new runtime dependencies +- Refresh langsmith-python314-iscoroutinefunction.patch + for the new sources. +- Point URL at the new langsmith-python repo; the SDK + moved out of langsmith-sdk. + +------------------------------------------------------------------- Old: ---- langsmith-0.16.1.tar.gz New: ---- langsmith-0.16.2.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-langsmith.spec ++++++ --- /var/tmp/diff_new_pack.5D9UBg/_old 2026-11-26 15:53:59.961259376 +0100 +++ /var/tmp/diff_new_pack.5D9UBg/_new 2026-11-26 15:53:59.965259546 +0100 @@ -17,11 +17,11 @@ Name: python-langsmith -Version: 0.16.1 +Version: 0.16.2 Release: 0 Summary: Client library for the LangSmith LLM tracing and evaluation platform License: MIT -URL: https://github.com/langchain-ai/langsmith-sdk +URL: https://github.com/langchain-ai/langsmith-python Source: https://files.pythonhosted.org/packages/source/l/langsmith/langsmith-%{version}.tar.gz # PATCH-FIX-UPSTREAM langsmith-python314-iscoroutinefunction.patch [email protected] -- use inspect.iscoroutinefunction(), the asyncio alias is deprecated in Python 3.14, gh#langchain-ai/langsmith-sdk#3347 Patch0: langsmith-python314-iscoroutinefunction.patch @@ -112,7 +112,7 @@ # git-only bench), plus fragile -k deselects (concurrency, wall-clock, races). %pytest tests/unit_tests -p no:langsmith_plugin --ignore tests/unit_tests/wrappers --ignore tests/unit_tests/sandbox --ignore tests/unit_tests/cli --ignore tests/unit_tests/evaluation --ignore tests/unit_tests/test_async_client.py --ignore tests/unit_tests/test_client.py --ignore tests/unit_tests/test_run_helpers.py --ignore tests/unit_tests/test_hybrid_tracing.py --ignore tests/unit_tests/test_background_thread.py -k 'not test_client_gc and not test_git_info and not test_as_runnable and not test_admission_under_concurrency and not test_extract_string_nodes_scales_linearly and not test_langchain_tool_attributes_reach_otel_spans and not test_refresh_failure_keeps_stale and not test_app_loop_does_not_back_off' -%files %{python_files} +%files %python_files %doc README.md %{python_sitelib}/langsmith %{python_sitelib}/langsmith-%{version}.dist-info ++++++ langsmith-0.16.1.tar.gz -> langsmith-0.16.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/.release-please-manifest.json new/langsmith-0.16.2/.release-please-manifest.json --- old/langsmith-0.16.1/.release-please-manifest.json 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/.release-please-manifest.json 2020-02-02 01:00:00.000000000 +0100 @@ -1,3 +1,3 @@ { - ".": "0.16.1" + ".": "0.16.2" } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/CHANGELOG.md new/langsmith-0.16.2/CHANGELOG.md --- old/langsmith-0.16.1/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,18 @@ # Changelog +## [0.16.2](https://github.com/langchain-ai/langsmith-python/compare/v0.16.1...v0.16.2) (2026-11-24) + + +### Features + +* **annotation-queues:** list a queue's reviewers with their progress ([73c5164](https://github.com/langchain-ai/langsmith-python/commit/73c516406db2b26ef436194ff4051d66488161f8)) + + +### Bug Fixes + +* **sdk:** keep only span context for ended OTel spans ([5857a07](https://github.com/langchain-ai/langsmith-python/commit/5857a07a9467a07cc429cafae1da2312c4f52218)) +* **sdk:** log Gemini model turns with the assistant role in wrapper inputs ([35bb388](https://github.com/langchain-ai/langsmith-python/commit/35bb388ac3133c84dff259d1dd2272707f817555)) + ## [0.16.1](https://github.com/langchain-ai/langsmith-python/compare/v0.16.0...v0.16.1) (2026-11-23) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/PKG-INFO new/langsmith-0.16.2/PKG-INFO --- old/langsmith-0.16.1/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.5 Name: langsmith -Version: 0.16.1 +Version: 0.16.2 Summary: Client library to connect to the LangSmith Observability and Evaluation Platform. Project-URL: Homepage, https://github.com/langchain-ai/langsmith-python Project-URL: Repository, https://github.com/langchain-ai/langsmith-python diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/api.md new/langsmith-0.16.2/api.md --- old/langsmith-0.16.1/api.md 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/api.md 2020-02-02 01:00:00.000000000 +0100 @@ -426,6 +426,18 @@ - <code title="put /api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/finals/{key}">client.annotation_queues.items.<a href="./src/langsmith/resources/annotation_queues/items.py">set_final</a>(key, \*, queue_id, item_id, \*\*<a href="src/langsmith/types/annotation_queues/item_set_final_params.py">params</a>) -> <a href="./src/langsmith/types/annotation_queues/item_set_final_response.py">ItemSetFinalResponse</a></code> - <code title="put /api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/reviews/{key}">client.annotation_queues.items.<a href="./src/langsmith/resources/annotation_queues/items.py">set_review</a>(key, \*, queue_id, item_id, \*\*<a href="src/langsmith/types/annotation_queues/item_set_review_params.py">params</a>) -> <a href="./src/langsmith/types/annotation_queues/annotation_queue_item_key_reviews.py">AnnotationQueueItemKeyReviews</a></code> +## Reviewers + +Types: + +```python +from langsmith.types.annotation_queues import ReviewerListResponse +``` + +Methods: + +- <code title="get /api/v1/platform/annotation-queues/{queue_id}/reviewers">client.annotation_queues.reviewers.<a href="./src/langsmith/resources/annotation_queues/reviewers.py">list</a>(queue_id, \*\*<a href="src/langsmith/types/annotation_queues/reviewer_list_params.py">params</a>) -> <a href="./src/langsmith/types/annotation_queues/reviewer_list_response.py">SyncItemsCursorGetPagination[ReviewerListResponse]</a></code> + # PromptWebhooks Types: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/pyproject.toml new/langsmith-0.16.2/pyproject.toml --- old/langsmith-0.16.1/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ [project] name = "langsmith" -version = "0.16.1" +version = "0.16.2" description = "Client library to connect to the LangSmith Observability and Evaluation Platform." dynamic = ["readme"] license = "MIT" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/_internal/otel/_otel_exporter.py new/langsmith-0.16.2/src/langsmith/_internal/otel/_otel_exporter.py --- old/langsmith-0.16.1/src/langsmith/_internal/otel/_otel_exporter.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/_internal/otel/_otel_exporter.py 2020-02-02 01:00:00.000000000 +0100 @@ -8,6 +8,7 @@ import time import uuid import warnings +from collections import OrderedDict from dataclasses import dataclass from typing import TYPE_CHECKING, Any, Optional @@ -127,14 +128,17 @@ @dataclass class _SpanInfo: - """Metadata tracked for each in-flight OTEL span.""" + """Metadata tracked for each in-flight or recently ended OTEL span. + + ``created_at`` is a ``time.monotonic()`` reading from when the run's start or end was stored. + """ span: Any created_at: float class _ThreadSafeSpanInfoStore: - """Thread-safe registry of in-flight span metadata. + """Thread-safe registry of in-flight and recently ended span metadata. The OTEL exporter is shared across concurrent background tracing workers (autoscaled sub-threads, the hybrid-mode executor). All reads and writes of @@ -151,33 +155,41 @@ def __init__(self) -> None: self._lock = threading.Lock() - self._spans: dict[uuid.UUID, _SpanInfo] = {} + self._spans: OrderedDict[uuid.UUID, _SpanInfo] = OrderedDict() def get(self, span_id: uuid.UUID) -> Optional[_SpanInfo]: with self._lock: return self._spans.get(span_id) def set(self, span_id: uuid.UUID, span: Any, created_at: Optional[float] = None) -> None: - info = _SpanInfo( - span=span, - created_at=created_at if created_at is not None else time.time(), - ) with self._lock: - self._spans[span_id] = info + # Read the clock under the lock so insertion order matches timestamp order. + self._spans[span_id] = _SpanInfo( + span=span, + created_at=created_at if created_at is not None else time.monotonic(), + ) + self._spans.move_to_end(span_id) def pop(self, span_id: uuid.UUID) -> Optional[_SpanInfo]: with self._lock: return self._spans.pop(span_id, None) - def stale_ids(self, cutoff_time: float) -> list[uuid.UUID]: - """Return ids of spans older than ``cutoff_time``. + def pop_stale(self, cutoff_time: float) -> list[tuple[uuid.UUID, _SpanInfo]]: + """Remove and return spans older than ``cutoff_time``, oldest first. - Iterates a snapshot of the items under the lock so concurrent - insert/delete (e.g. from another batch worker) cannot raise - ``RuntimeError: dictionary changed size during iteration``. + ``set`` moves each entry to the end, so entries are ordered by ``created_at`` + and the scan stops at the first fresh one. Selection and removal share one + lock hold, so an entry refreshed by another worker is never removed. """ + stale: list[tuple[uuid.UUID, _SpanInfo]] = [] with self._lock: - return [span_id for span_id, info in list(self._spans.items()) if info.created_at < cutoff_time] + while self._spans: + span_id, info = next(iter(self._spans.items())) + if info.created_at >= cutoff_time: + break + self._spans.popitem(last=False) + stale.append((span_id, info)) + return stale def __len__(self) -> int: with self._lock: @@ -205,8 +217,9 @@ Args: tracer_provider: Optional tracer provider to use. If not provided, the global tracer provider will be used. - span_ttl_seconds: TTL for incomplete traces in seconds. If None, - uses LANGSMITH_OTEL_SPAN_TTL_SECONDS env var (default: 3600s) + span_ttl_seconds: How long a run's span info is kept after its start, or + after its end once it has ended, so later child runs can link to it. + If None, uses LANGSMITH_OTEL_SPAN_TTL_SECONDS env var (default: 3600s) """ # Set defaults from environment variables if not provided if span_ttl_seconds is None: @@ -261,6 +274,9 @@ if op.operation == "post": span = self._create_span_for_run(op, run_info, otel_context_map.get(op.id)) if span: + if run_info.get("end_time"): + # Run already ended, so store only its span context for child spans to link to. + span = self._trace.NonRecordingSpan(span.get_span_context()) self._span_info.set(op.id, span) else: self._update_span_for_run(op, run_info) @@ -416,9 +432,9 @@ span.end(end_time=end_time_utc_nano) else: span.end() - # Remove the span info from the store - self._span_info.pop(op.id) - logger.debug(f"Completed span, remaining spans: {len(self._span_info)}") + # Keep only the span context so child runs exported later can still link to it. + self._span_info.set(op.id, self._trace.NonRecordingSpan(span.get_span_context())) + logger.debug(f"Completed span, tracked spans: {len(self._span_info)}") else: # Span exists but no end_time - this is normal for ongoing operations logger.debug("Updated span (no end_time yet)") @@ -431,7 +447,7 @@ if not self._span_info: return - current_time = time.time() + current_time = time.monotonic() # Only run cleanup every 10 seconds to reduce overhead if current_time - self._last_cleanup < 10.0: @@ -440,30 +456,22 @@ self._last_cleanup = current_time cutoff_time = current_time - self._span_ttl_seconds - # Remove spans older than TTL in one pass. - stale_span_ids = self._span_info.stale_ids(cutoff_time) + stale_spans = self._span_info.pop_stale(cutoff_time) - if stale_span_ids: - logger.info(f" LangSmith OTEL Cleanup: Removing {len(stale_span_ids)} stale spans") + if stale_spans: + logger.info(f" LangSmith OTEL Cleanup: Removing {len(stale_spans)} stale spans") - for span_id in stale_span_ids: - self._remove_span(span_id) + for span_id, span_info in stale_spans: + self._end_removed_span(span_id, span_info) - def _remove_span(self, span_id: uuid.UUID) -> None: - """Remove a single span and clean up resources. + def _end_removed_span(self, span_id: uuid.UUID, span_info: _SpanInfo) -> None: + """End a span removed from the store by cleanup if it is still recording. Note: - We call `span.end()` here because spans in `_span_info` are orphaned - - they never received their patch operation and will never naturally complete. - - Ending them gracefully is better than leaving them open indefinitely. + Spans that are still recording here are orphaned - they never received + their ending patch and will never naturally complete, so we end them. + Ended runs are stored as non-recording spans and are simply dropped. """ - # Atomically claim the entry so a concurrent worker can't end the same - # span or see/use it after we've decided to remove it. - span_info = self._span_info.pop(span_id) - if span_info is None: - return - try: span = span_info.span diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/_version.py new/langsmith-0.16.2/src/langsmith/_version.py --- old/langsmith-0.16.1/src/langsmith/_version.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/_version.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "langsmith" -__version__ = "0.16.1" # x-release-please-version +__version__ = "0.16.2" # x-release-please-version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/resources/annotation_queues/__init__.py new/langsmith-0.16.2/src/langsmith/resources/annotation_queues/__init__.py --- old/langsmith-0.16.1/src/langsmith/resources/annotation_queues/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/resources/annotation_queues/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -16,6 +16,14 @@ ItemsResourceWithStreamingResponse, AsyncItemsResourceWithStreamingResponse, ) +from .reviewers import ( + ReviewersResource, + AsyncReviewersResource, + ReviewersResourceWithRawResponse, + AsyncReviewersResourceWithRawResponse, + ReviewersResourceWithStreamingResponse, + AsyncReviewersResourceWithStreamingResponse, +) from .annotation_queues import ( AnnotationQueuesResource, AsyncAnnotationQueuesResource, @@ -38,6 +46,12 @@ "AsyncItemsResourceWithRawResponse", "ItemsResourceWithStreamingResponse", "AsyncItemsResourceWithStreamingResponse", + "ReviewersResource", + "AsyncReviewersResource", + "ReviewersResourceWithRawResponse", + "AsyncReviewersResourceWithRawResponse", + "ReviewersResourceWithStreamingResponse", + "AsyncReviewersResourceWithStreamingResponse", "AnnotationQueuesResource", "AsyncAnnotationQueuesResource", "AnnotationQueuesResourceWithRawResponse", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/resources/annotation_queues/annotation_queues.py new/langsmith-0.16.2/src/langsmith/resources/annotation_queues/annotation_queues.py --- old/langsmith-0.16.1/src/langsmith/resources/annotation_queues/annotation_queues.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/resources/annotation_queues/annotation_queues.py 2020-02-02 01:00:00.000000000 +0100 @@ -38,6 +38,14 @@ from ..._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given from ..._utils import path_template, maybe_transform, async_maybe_transform from ..._compat import cached_property +from .reviewers import ( + ReviewersResource, + AsyncReviewersResource, + ReviewersResourceWithRawResponse, + AsyncReviewersResourceWithRawResponse, + ReviewersResourceWithStreamingResponse, + AsyncReviewersResourceWithStreamingResponse, +) from ..._resource import SyncAPIResource, AsyncAPIResource from ..._response import ( to_raw_response_wrapper, @@ -70,6 +78,10 @@ return ItemsResource(self._client) @cached_property + def reviewers(self) -> ReviewersResource: + return ReviewersResource(self._client) + + @cached_property def with_raw_response(self) -> AnnotationQueuesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return @@ -725,6 +737,10 @@ return AsyncItemsResource(self._client) @cached_property + def reviewers(self) -> AsyncReviewersResource: + return AsyncReviewersResource(self._client) + + @cached_property def with_raw_response(self) -> AsyncAnnotationQueuesResourceWithRawResponse: """ This property can be used as a prefix for any HTTP method call to return @@ -1435,6 +1451,10 @@ def items(self) -> ItemsResourceWithRawResponse: return ItemsResourceWithRawResponse(self._annotation_queues.items) + @cached_property + def reviewers(self) -> ReviewersResourceWithRawResponse: + return ReviewersResourceWithRawResponse(self._annotation_queues.reviewers) + class AsyncAnnotationQueuesResourceWithRawResponse: def __init__(self, annotation_queues: AsyncAnnotationQueuesResource) -> None: @@ -1498,6 +1518,10 @@ def items(self) -> AsyncItemsResourceWithRawResponse: return AsyncItemsResourceWithRawResponse(self._annotation_queues.items) + @cached_property + def reviewers(self) -> AsyncReviewersResourceWithRawResponse: + return AsyncReviewersResourceWithRawResponse(self._annotation_queues.reviewers) + class AnnotationQueuesResourceWithStreamingResponse: def __init__(self, annotation_queues: AnnotationQueuesResource) -> None: @@ -1561,6 +1585,10 @@ def items(self) -> ItemsResourceWithStreamingResponse: return ItemsResourceWithStreamingResponse(self._annotation_queues.items) + @cached_property + def reviewers(self) -> ReviewersResourceWithStreamingResponse: + return ReviewersResourceWithStreamingResponse(self._annotation_queues.reviewers) + class AsyncAnnotationQueuesResourceWithStreamingResponse: def __init__(self, annotation_queues: AsyncAnnotationQueuesResource) -> None: @@ -1623,3 +1651,7 @@ @cached_property def items(self) -> AsyncItemsResourceWithStreamingResponse: return AsyncItemsResourceWithStreamingResponse(self._annotation_queues.items) + + @cached_property + def reviewers(self) -> AsyncReviewersResourceWithStreamingResponse: + return AsyncReviewersResourceWithStreamingResponse(self._annotation_queues.reviewers) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/resources/annotation_queues/reviewers.py new/langsmith-0.16.2/src/langsmith/resources/annotation_queues/reviewers.py --- old/langsmith-0.16.1/src/langsmith/resources/annotation_queues/reviewers.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/resources/annotation_queues/reviewers.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,209 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from ..._httpx import httpx +from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ..._utils import path_template, maybe_transform +from ..._compat import cached_property +from ..._resource import SyncAPIResource, AsyncAPIResource +from ..._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ...pagination import SyncItemsCursorGetPagination, AsyncItemsCursorGetPagination +from ..._base_client import AsyncPaginator, make_request_options +from ...types.annotation_queues import reviewer_list_params +from ...types.annotation_queues.reviewer_list_response import ReviewerListResponse + +__all__ = ["ReviewersResource", "AsyncReviewersResource"] + + +class ReviewersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> ReviewersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/langchain-ai/langsmith-python#accessing-raw-response-data-eg-headers + """ + return ReviewersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> ReviewersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/langchain-ai/langsmith-python#with_streaming_response + """ + return ReviewersResourceWithStreamingResponse(self) + + def list( + self, + queue_id: str, + *, + cursor: str | Omit = omit, + page_size: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> SyncItemsCursorGetPagination[ReviewerListResponse]: + """ + List a queue's reviewers with how many reviews each has waiting, how many they + have completed, and when they last completed one. Includes everyone on the + queue's roster and anyone else who has reviewed on the queue, such as people + removed from the roster; is_on_roster tells them apart. name and email are left + out when a reviewer cannot be looked up. Only single queues are supported, and + the endpoint returns 501 unless multi-reviewer is on for the workspace. + + Args: + cursor: Opaque pagination cursor + + page_size: Page size (max 100) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not queue_id: + raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") + return self._get_api_list( + path_template("/api/v1/platform/annotation-queues/{queue_id}/reviewers", queue_id=queue_id), + page=SyncItemsCursorGetPagination[ReviewerListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "page_size": page_size, + }, + reviewer_list_params.ReviewerListParams, + ), + ), + model=ReviewerListResponse, + ) + + +class AsyncReviewersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncReviewersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/langchain-ai/langsmith-python#accessing-raw-response-data-eg-headers + """ + return AsyncReviewersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncReviewersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/langchain-ai/langsmith-python#with_streaming_response + """ + return AsyncReviewersResourceWithStreamingResponse(self) + + def list( + self, + queue_id: str, + *, + cursor: str | Omit = omit, + page_size: int | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> AsyncPaginator[ReviewerListResponse, AsyncItemsCursorGetPagination[ReviewerListResponse]]: + """ + List a queue's reviewers with how many reviews each has waiting, how many they + have completed, and when they last completed one. Includes everyone on the + queue's roster and anyone else who has reviewed on the queue, such as people + removed from the roster; is_on_roster tells them apart. name and email are left + out when a reviewer cannot be looked up. Only single queues are supported, and + the endpoint returns 501 unless multi-reviewer is on for the workspace. + + Args: + cursor: Opaque pagination cursor + + page_size: Page size (max 100) + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not queue_id: + raise ValueError(f"Expected a non-empty value for `queue_id` but received {queue_id!r}") + return self._get_api_list( + path_template("/api/v1/platform/annotation-queues/{queue_id}/reviewers", queue_id=queue_id), + page=AsyncItemsCursorGetPagination[ReviewerListResponse], + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "cursor": cursor, + "page_size": page_size, + }, + reviewer_list_params.ReviewerListParams, + ), + ), + model=ReviewerListResponse, + ) + + +class ReviewersResourceWithRawResponse: + def __init__(self, reviewers: ReviewersResource) -> None: + self._reviewers = reviewers + + self.list = to_raw_response_wrapper( + reviewers.list, + ) + + +class AsyncReviewersResourceWithRawResponse: + def __init__(self, reviewers: AsyncReviewersResource) -> None: + self._reviewers = reviewers + + self.list = async_to_raw_response_wrapper( + reviewers.list, + ) + + +class ReviewersResourceWithStreamingResponse: + def __init__(self, reviewers: ReviewersResource) -> None: + self._reviewers = reviewers + + self.list = to_streamed_response_wrapper( + reviewers.list, + ) + + +class AsyncReviewersResourceWithStreamingResponse: + def __init__(self, reviewers: AsyncReviewersResource) -> None: + self._reviewers = reviewers + + self.list = async_to_streamed_response_wrapper( + reviewers.list, + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/types/annotation_queues/__init__.py new/langsmith-0.16.2/src/langsmith/types/annotation_queues/__init__.py --- old/langsmith-0.16.1/src/langsmith/types/annotation_queues/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/types/annotation_queues/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -13,10 +13,12 @@ from .run_create_response import RunCreateResponse as RunCreateResponse from .item_create_response import ItemCreateResponse as ItemCreateResponse from .item_update_response import ItemUpdateResponse as ItemUpdateResponse +from .reviewer_list_params import ReviewerListParams as ReviewerListParams from .item_set_final_params import ItemSetFinalParams as ItemSetFinalParams from .run_delete_all_params import RunDeleteAllParams as RunDeleteAllParams from .item_delete_all_params import ItemDeleteAllParams as ItemDeleteAllParams from .item_set_review_params import ItemSetReviewParams as ItemSetReviewParams +from .reviewer_list_response import ReviewerListResponse as ReviewerListResponse from .item_set_final_response import ItemSetFinalResponse as ItemSetFinalResponse from .item_delete_all_response import ItemDeleteAllResponse as ItemDeleteAllResponse from .run_create_by_key_params import RunCreateByKeyParams as RunCreateByKeyParams diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/types/annotation_queues/reviewer_list_params.py new/langsmith-0.16.2/src/langsmith/types/annotation_queues/reviewer_list_params.py --- old/langsmith-0.16.1/src/langsmith/types/annotation_queues/reviewer_list_params.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/types/annotation_queues/reviewer_list_params.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,15 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import TypedDict + +__all__ = ["ReviewerListParams"] + + +class ReviewerListParams(TypedDict, total=False): + cursor: str + """Opaque pagination cursor""" + + page_size: int + """Page size (max 100)""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/types/annotation_queues/reviewer_list_response.py new/langsmith-0.16.2/src/langsmith/types/annotation_queues/reviewer_list_response.py --- old/langsmith-0.16.1/src/langsmith/types/annotation_queues/reviewer_list_response.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/types/annotation_queues/reviewer_list_response.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from datetime import datetime + +from ..._models import BaseModel + +__all__ = ["ReviewerListResponse"] + + +class ReviewerListResponse(BaseModel): + completed_count: Optional[int] = None + + email: Optional[str] = None + + identity_id: Optional[str] = None + + is_on_roster: Optional[bool] = None + + last_active_at: Optional[datetime] = None + + name: Optional[str] = None + + pending_count: Optional[int] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/src/langsmith/wrappers/_gemini.py new/langsmith-0.16.2/src/langsmith/wrappers/_gemini.py --- old/langsmith-0.16.1/src/langsmith/wrappers/_gemini.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/src/langsmith/wrappers/_gemini.py 2020-02-02 01:00:00.000000000 +0100 @@ -92,6 +92,8 @@ if not isinstance(content, dict): continue role = content.get("role", "user") + if role == "model": + role = "assistant" raw_parts = content.get("parts", []) text_parts: list[str] = [] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/tests/api_resources/annotation_queues/test_reviewers.py new/langsmith-0.16.2/tests/api_resources/annotation_queues/test_reviewers.py --- old/langsmith-0.16.1/tests/api_resources/annotation_queues/test_reviewers.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/tests/api_resources/annotation_queues/test_reviewers.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,131 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from langsmith import Langsmith, AsyncLangsmith +from tests.utils import assert_matches_type +from langsmith.pagination import SyncItemsCursorGetPagination, AsyncItemsCursorGetPagination +from langsmith.types.annotation_queues import ReviewerListResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestReviewers: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list(self, client: Langsmith) -> None: + reviewer = client.annotation_queues.reviewers.list( + queue_id="queue_id", + ) + assert_matches_type(SyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_list_with_all_params(self, client: Langsmith) -> None: + reviewer = client.annotation_queues.reviewers.list( + queue_id="queue_id", + cursor="cursor", + page_size=0, + ) + assert_matches_type(SyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_list(self, client: Langsmith) -> None: + + response = client.annotation_queues.reviewers.with_raw_response.list( + queue_id="queue_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + reviewer = response.parse() + assert_matches_type(SyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_list(self, client: Langsmith) -> None: + with client.annotation_queues.reviewers.with_streaming_response.list( + queue_id="queue_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + reviewer = response.parse() + assert_matches_type(SyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_list(self, client: Langsmith) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): + client.annotation_queues.reviewers.with_raw_response.list( + queue_id="", + ) + + +class TestAsyncReviewers: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list(self, async_client: AsyncLangsmith) -> None: + reviewer = await async_client.annotation_queues.reviewers.list( + queue_id="queue_id", + ) + assert_matches_type(AsyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncLangsmith) -> None: + reviewer = await async_client.annotation_queues.reviewers.list( + queue_id="queue_id", + cursor="cursor", + page_size=0, + ) + assert_matches_type(AsyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_list(self, async_client: AsyncLangsmith) -> None: + + response = await async_client.annotation_queues.reviewers.with_raw_response.list( + queue_id="queue_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + reviewer = await response.parse() + assert_matches_type(AsyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_list(self, async_client: AsyncLangsmith) -> None: + async with async_client.annotation_queues.reviewers.with_streaming_response.list( + queue_id="queue_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + reviewer = await response.parse() + assert_matches_type(AsyncItemsCursorGetPagination[ReviewerListResponse], reviewer, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_path_params_list(self, async_client: AsyncLangsmith) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): + await async_client.annotation_queues.reviewers.with_raw_response.list( + queue_id="", + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/tests/unit_tests/test_otel_exporter.py new/langsmith-0.16.2/tests/unit_tests/test_otel_exporter.py --- old/langsmith-0.16.1/tests/unit_tests/test_otel_exporter.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/tests/unit_tests/test_otel_exporter.py 2020-02-02 01:00:00.000000000 +0100 @@ -40,8 +40,8 @@ stale_id = uuid.uuid4() fresh_id = uuid.uuid4() - exporter._span_info.set(stale_id, stale_span, created_at=time.time() - 2) - exporter._span_info.set(fresh_id, fresh_span, created_at=time.time()) + exporter._span_info.set(stale_id, stale_span, created_at=time.monotonic() - 2) + exporter._span_info.set(fresh_id, fresh_span, created_at=time.monotonic()) exporter._last_cleanup = 0.0 # Force cleanup exporter._cleanup_stale_spans() @@ -53,6 +53,28 @@ fresh_span.end.assert_not_called() +def test_cleanup_keeps_span_refreshed_while_cleanup_ends_others(): + """An entry another worker refreshes while cleanup is ending stale spans is kept.""" + with patch("langsmith._internal.otel._otel_exporter._import_otel_exporter") as mock_import: + mock_import.return_value = (MagicMock(),) * 8 + + exporter = OTELExporter(span_ttl_seconds=1) + first_id, second_id = uuid.uuid4(), uuid.uuid4() + refreshed_span = MagicMock() + first_span = MagicMock() + first_span.end.side_effect = lambda: exporter._span_info.set(second_id, refreshed_span) + + exporter._span_info.set(first_id, first_span, created_at=time.monotonic() - 3) + exporter._span_info.set(second_id, MagicMock(), created_at=time.monotonic() - 2) + exporter._last_cleanup = 0.0 # Force cleanup + + exporter._cleanup_stale_spans() + + first_span.end.assert_called_once() + assert exporter._span_info.get(first_id) is None + assert exporter._span_info.get(second_id).span is refreshed_span + + def test_cleanup_periodic_behavior(): """Test cleanup only runs periodically.""" with patch("langsmith._internal.otel._otel_exporter._import_otel_exporter") as mock_import: @@ -62,8 +84,8 @@ stale_span = MagicMock() stale_id = uuid.uuid4() - exporter._span_info.set(stale_id, stale_span, created_at=time.time() - 2) - exporter._last_cleanup = time.time() - 5 # Recent cleanup + exporter._span_info.set(stale_id, stale_span, created_at=time.monotonic() - 2) + exporter._last_cleanup = time.monotonic() - 5 # Recent cleanup exporter._cleanup_stale_spans() @@ -75,8 +97,7 @@ def test_cleanup_stale_spans_tolerates_concurrent_mutation(): """Cleanup plus concurrent insert/delete from other batch workers must not raise ``RuntimeError: dictionary changed size during iteration`` or any - ``KeyError``. The span info store locks all access and snapshots before - iterating. + ``KeyError``. The span info store locks all access. """ with patch("langsmith._internal.otel._otel_exporter._import_otel_exporter") as mock_import: mock_import.return_value = (MagicMock(),) * 8 @@ -88,7 +109,7 @@ stop = threading.Event() # Seed one stale span so cleanup has work to do. - exporter._span_info.set(uuid.uuid4(), MagicMock(), created_at=time.time() - 2) + exporter._span_info.set(uuid.uuid4(), MagicMock(), created_at=time.monotonic() - 2) def mutator(): while not stop.is_set(): @@ -114,6 +135,98 @@ assert not errors, f"concurrent access raised: {errors}" +def _otel_run_op(operation, run_id, trace_id, name, **fields): + from langsmith._internal._operations import serialize_run_dict + + return serialize_run_dict( + operation, + { + "id": run_id, + "trace_id": trace_id, + "name": name, + "run_type": "chain", + "start_time": "2026-01-01T00:00:00.000000Z", + **fields, + }, + ) + + [email protected] +def otel_sdk_exporter(): + from opentelemetry.sdk.trace import TracerProvider + from opentelemetry.sdk.trace.export import SimpleSpanProcessor + from opentelemetry.sdk.trace.export.in_memory_span_exporter import ( + InMemorySpanExporter, + ) + + provider = TracerProvider() + sink = InMemorySpanExporter() + provider.add_span_processor(SimpleSpanProcessor(sink)) + try: + yield provider, sink + finally: + provider.shutdown() + + [email protected]("ended_by", ["post", "patch"]) +def test_ended_span_keeps_only_its_context(otel_sdk_exporter, ended_by): + """An ended run keeps only its span context, and children exported later still link to it.""" + provider, sink = otel_sdk_exporter + exporter = OTELExporter(tracer_provider=provider) + trace_id, parent_id, child_id = uuid.uuid4(), uuid.uuid4(), uuid.uuid4() + end = {"end_time": "2026-01-01T00:00:01.000000Z", "outputs": {"output": "payload"}} + + if ended_by == "post": + exporter.export_batch([_otel_run_op("post", parent_id, trace_id, "parent", **end)], {}) + else: + exporter.export_batch([_otel_run_op("post", parent_id, trace_id, "parent")], {}) + exporter.export_batch([_otel_run_op("patch", parent_id, trace_id, "parent", **end)], {}) + + assert not hasattr(exporter._span_info.get(parent_id).span, "attributes") + + exporter.export_batch( + [_otel_run_op("post", child_id, trace_id, "child", parent_run_id=str(parent_id), **end)], + {}, + ) + spans = {span.name: span for span in sink.get_finished_spans()} + assert spans["child"].parent.span_id == spans["parent"].context.span_id + assert spans["child"].context.trace_id == spans["parent"].context.trace_id + + +def test_ended_span_info_expires_ttl_after_run_end(otel_sdk_exporter): + """Span info is kept for the TTL after a run ends, not after it starts.""" + from langsmith._internal.otel import _otel_exporter + + provider, sink = otel_sdk_exporter + clock = SimpleNamespace(now=0.0) + trace_id, parent_id, orphan_id = uuid.uuid4(), uuid.uuid4(), uuid.uuid4() + end = {"end_time": "2026-01-01T00:00:01.000000Z"} + + def export_at(now, op): + clock.now = now + exporter.export_batch([op], {}) + + with patch.object(_otel_exporter, "time", SimpleNamespace(monotonic=lambda: clock.now)): + exporter = OTELExporter(tracer_provider=provider, span_ttl_seconds=60) + export_at(0, _otel_run_op("post", parent_id, trace_id, "parent")) + export_at(0, _otel_run_op("post", orphan_id, trace_id, "orphan")) + export_at(50, _otel_run_op("patch", parent_id, trace_id, "parent", **end)) + export_at( + 75, + _otel_run_op("post", uuid.uuid4(), trace_id, "linked", parent_run_id=str(parent_id), **end), + ) + spans = {span.name: span for span in sink.get_finished_spans()} + assert "orphan" in spans + assert spans["linked"].parent.span_id == spans["parent"].context.span_id + + export_at( + 200, + _otel_run_op("post", uuid.uuid4(), trace_id, "unlinked", parent_run_id=str(parent_id), **end), + ) + spans = {span.name: span for span in sink.get_finished_spans()} + assert spans["unlinked"].parent.span_id != spans["parent"].context.span_id + + @patch("langsmith.utils.get_env_var") def test_env_var_ttl(mock_get_env_var): """Test TTL loading from environment variable with correct default.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.16.1/tests/unit_tests/wrappers/test_gemini_processing.py new/langsmith-0.16.2/tests/unit_tests/wrappers/test_gemini_processing.py --- old/langsmith-0.16.1/tests/unit_tests/wrappers/test_gemini_processing.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.2/tests/unit_tests/wrappers/test_gemini_processing.py 2020-02-02 01:00:00.000000000 +0100 @@ -82,6 +82,7 @@ inputs = { "contents": [ {"role": "user", "parts": [{"text": "What is AI?"}]}, + {"role": "model", "parts": [{"text": "Artificial intelligence."}]}, {"role": "user", "parts": [{"text": "What is computer?"}]}, ], "model": "gemini-pro", @@ -90,6 +91,7 @@ expected = { "messages": [ {"role": "user", "content": "What is AI?"}, + {"role": "assistant", "content": "Artificial intelligence."}, {"role": "user", "content": "What is computer?"}, ], "model": "gemini-pro", @@ -167,7 +169,7 @@ expected = { "messages": [ { - "role": "model", + "role": "assistant", "content": [ { "type": "function_call", @@ -710,7 +712,7 @@ result = _process_gemini_inputs(inputs) msg = result["messages"][0] - assert msg["role"] == "model" + assert msg["role"] == "assistant" assert isinstance(msg["content"], list) fc = msg["content"][0] assert fc["type"] == "function_call" ++++++ langsmith-python314-iscoroutinefunction.patch ++++++ --- /var/tmp/diff_new_pack.5D9UBg/_old 2026-11-26 15:54:00.351275945 +0100 +++ /var/tmp/diff_new_pack.5D9UBg/_new 2026-11-26 15:54:00.354276073 +0100 @@ -12,8 +12,8 @@ this is a drop-in replacement on every Python this package supports (>= 3.10). ---- langsmith-0.14.11.orig/src/langsmith/_internal/_beta_decorator.py -+++ langsmith-0.14.11/src/langsmith/_internal/_beta_decorator.py +--- a/src/langsmith/_internal/_beta_decorator.py ++++ b/src/langsmith/_internal/_beta_decorator.py @@ -1,7 +1,7 @@ -import asyncio import contextlib @@ -23,7 +23,7 @@ import warnings from collections.abc import Iterator from typing import Any, Callable -@@ -67,7 +67,7 @@ +@@ -89,7 +89,7 @@ def deprecated(message: str) -> Callable """ def decorator(func: Callable) -> Callable:
