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-23 12:23:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-langsmith (Old) and /work/SRC/openSUSE:Factory/.python-langsmith.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-langsmith" Mon Nov 23 12:23:35 2026 rev:45 rq:1399729 version:0.16.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-langsmith/python-langsmith.changes 2026-11-20 14:50:47.199690528 +0100 +++ /work/SRC/openSUSE:Factory/.python-langsmith.new.1340718/python-langsmith.changes 2026-11-23 12:26:56.814652488 +0100 @@ -1,0 +2,15 @@ +Sun Nov 22 09:39:04 UTC 2026 - Martin Pluskal <[email protected]> + +- Update to 0.16.0: + * Workspace secrets: cursor-paginated listing (breaking + change) + * SDK tracing_context can skip copying the parent tags + and metadata + * Feedback: delete feedback from Go + * Run-rules: return backfill_id on create, list every + outcomes page in backfill logs + * Robin: keep Terminal-Bench verifiers alive through a + dropped connection + * No new runtime dependencies + +------------------------------------------------------------------- Old: ---- langsmith-0.15.1.tar.gz New: ---- langsmith-0.16.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-langsmith.spec ++++++ --- /var/tmp/diff_new_pack.e5u4Uk/_old 2026-11-23 12:26:58.105706830 +0100 +++ /var/tmp/diff_new_pack.e5u4Uk/_new 2026-11-23 12:26:58.108706956 +0100 @@ -17,7 +17,7 @@ Name: python-langsmith -Version: 0.15.1 +Version: 0.16.0 Release: 0 Summary: Client library for the LangSmith LLM tracing and evaluation platform License: MIT ++++++ langsmith-0.15.1.tar.gz -> langsmith-0.16.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/.release-please-manifest.json new/langsmith-0.16.0/.release-please-manifest.json --- old/langsmith-0.15.1/.release-please-manifest.json 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/.release-please-manifest.json 2020-02-02 01:00:00.000000000 +0100 @@ -1,3 +1,3 @@ { - ".": "0.15.1" + ".": "0.16.0" } \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/CHANGELOG.md new/langsmith-0.16.0/CHANGELOG.md --- old/langsmith-0.15.1/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/CHANGELOG.md 2020-02-02 01:00:00.000000000 +0100 @@ -1,5 +1,24 @@ # Changelog +## [0.16.0](https://github.com/langchain-ai/langsmith-python/compare/v0.15.1...v0.16.0) (2026-11-21) + + +### ⚠ BREAKING CHANGES + +* add cursor-paginated workspace secrets listing + +### Features + +* add cursor-paginated workspace secrets listing ([9707eec](https://github.com/langchain-ai/langsmith-python/commit/9707eec8967680287b4b491202fb7a135f4acffc)) +* **feedback:** delete feedback from Go ([5015724](https://github.com/langchain-ai/langsmith-python/commit/501572413bb2669a5a10eaeb2c42781749220d97)) +* **sdk:** Let tracing_context Skip Copying the Parent's Tags and Metadata ([1cd8712](https://github.com/langchain-ai/langsmith-python/commit/1cd8712955f446888856a4c38c08fc5808687678)) + + +### Bug Fixes + +* **robin:** keep Terminal-Bench verifiers running through a dropped connection ([b1e64c2](https://github.com/langchain-ai/langsmith-python/commit/b1e64c2cf4b93176f39985ddfba771be96e68520)) +* **run-rules:** return backfill_id on create and list every outcomes page in backfill logs ([5f4b65a](https://github.com/langchain-ai/langsmith-python/commit/5f4b65ad8e433de8e6cdff0ef570980b63ad8b00)) + ## [0.15.1](https://github.com/langchain-ai/langsmith-python/compare/v0.15.0...v0.15.1) (2026-11-20) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/PKG-INFO new/langsmith-0.16.0/PKG-INFO --- old/langsmith-0.15.1/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/PKG-INFO 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.5 Name: langsmith -Version: 0.15.1 +Version: 0.16.0 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.15.1/api.md new/langsmith-0.16.0/api.md --- old/langsmith-0.15.1/api.md 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/api.md 2020-02-02 01:00:00.000000000 +0100 @@ -397,6 +397,9 @@ ```python from langsmith.types.annotation_queues import ( + AnnotationQueueItemAgreementState, + AnnotationQueueItemAnswer, + AnnotationQueueItemKeyReviews, ItemCreateResponse, ItemUpdateResponse, ItemListResponse, @@ -404,6 +407,7 @@ ItemDeleteAllResponse, ItemRetrieveCountResponse, ItemRetrievePlacementResponse, + ItemRetrieveReviewsResponse, ItemSetFinalResponse, ) ``` @@ -418,7 +422,9 @@ - <code title="post /api/v1/platform/annotation-queues/{queue_id}/items/delete">client.annotation_queues.items.<a href="./src/langsmith/resources/annotation_queues/items.py">delete_all</a>(queue_id, \*\*<a href="src/langsmith/types/annotation_queues/item_delete_all_params.py">params</a>) -> <a href="./src/langsmith/types/annotation_queues/item_delete_all_response.py">ItemDeleteAllResponse</a></code> - <code title="get /api/v1/platform/annotation-queues/{queue_id}/items/count">client.annotation_queues.items.<a href="./src/langsmith/resources/annotation_queues/items.py">retrieve_count</a>(queue_id, \*\*<a href="src/langsmith/types/annotation_queues/item_retrieve_count_params.py">params</a>) -> <a href="./src/langsmith/types/annotation_queues/item_retrieve_count_response.py">ItemRetrieveCountResponse</a></code> - <code title="get /api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/placement">client.annotation_queues.items.<a href="./src/langsmith/resources/annotation_queues/items.py">retrieve_placement</a>(item_id, \*, queue_id) -> <a href="./src/langsmith/types/annotation_queues/item_retrieve_placement_response.py">ItemRetrievePlacementResponse</a></code> +- <code title="get /api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/reviews">client.annotation_queues.items.<a href="./src/langsmith/resources/annotation_queues/items.py">retrieve_reviews</a>(item_id, \*, queue_id) -> <a href="./src/langsmith/types/annotation_queues/item_retrieve_reviews_response.py">ItemRetrieveReviewsResponse</a></code> - <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> # PromptWebhooks @@ -454,12 +460,12 @@ Types: ```python -from langsmith.types import WorkspaceSecret, WorkspaceSecretListResponse +from langsmith.types import WorkspaceSecret ``` Methods: -- <code title="get /api/v1/workspaces/current/secrets">client.workspace_secrets.<a href="./src/langsmith/resources/workspace_secrets.py">list</a>(\*\*<a href="src/langsmith/types/workspace_secret_list_params.py">params</a>) -> <a href="./src/langsmith/types/workspace_secret_list_response.py">WorkspaceSecretListResponse</a></code> +- <code title="get /api/v2/workspaces/current/secrets">client.workspace_secrets.<a href="./src/langsmith/resources/workspace_secrets.py">list</a>(\*\*<a href="src/langsmith/types/workspace_secret_list_params.py">params</a>) -> <a href="./src/langsmith/types/workspace_secret.py">SyncItemsCursorGetPagination[WorkspaceSecret]</a></code> - <code title="delete /api/v1/workspaces/current/secrets/{key}">client.workspace_secrets.<a href="./src/langsmith/resources/workspace_secrets.py">delete</a>(key) -> None</code> - <code title="put /api/v1/workspaces/current/secrets/{key}">client.workspace_secrets.<a href="./src/langsmith/resources/workspace_secrets.py">upsert</a>(key, \*\*<a href="src/langsmith/types/workspace_secret_upsert_params.py">params</a>) -> <a href="./src/langsmith/types/workspace_secret.py">WorkspaceSecret</a></code> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/pyproject.toml new/langsmith-0.16.0/pyproject.toml --- old/langsmith-0.15.1/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/pyproject.toml 2020-02-02 01:00:00.000000000 +0100 @@ -1,6 +1,6 @@ [project] name = "langsmith" -version = "0.15.1" +version = "0.16.0" 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.15.1/src/langsmith/_version.py new/langsmith-0.16.0/src/langsmith/_version.py --- old/langsmith-0.15.1/src/langsmith/_version.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/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.15.1" # x-release-please-version +__version__ = "0.16.0" # x-release-please-version diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/resources/annotation_queues/items.py new/langsmith-0.16.0/src/langsmith/resources/annotation_queues/items.py --- old/langsmith-0.15.1/src/langsmith/resources/annotation_queues/items.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/resources/annotation_queues/items.py 2020-02-02 01:00:00.000000000 +0100 @@ -25,6 +25,7 @@ item_update_params, item_set_final_params, item_delete_all_params, + item_set_review_params, item_create_status_params, item_retrieve_count_params, ) @@ -35,7 +36,9 @@ from ...types.annotation_queues.item_delete_all_response import ItemDeleteAllResponse from ...types.annotation_queues.item_create_status_response import ItemCreateStatusResponse from ...types.annotation_queues.item_retrieve_count_response import ItemRetrieveCountResponse +from ...types.annotation_queues.item_retrieve_reviews_response import ItemRetrieveReviewsResponse from ...types.annotation_queues.item_retrieve_placement_response import ItemRetrievePlacementResponse +from ...types.annotation_queues.annotation_queue_item_key_reviews import AnnotationQueueItemKeyReviews __all__ = ["ItemsResource", "AsyncItemsResource"] @@ -501,6 +504,49 @@ cast_to=ItemRetrievePlacementResponse, ) + def retrieve_reviews( + self, + item_id: str, + *, + queue_id: str, + # 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, + ) -> ItemRetrieveReviewsResponse: + """ + For each rubric key: whether the reviewers agreed, the final if one is set, and + each reviewer's answer. Reviewers are listed in the order they completed the + item. Their name and email are empty when the caller cannot see other workspace + members. Returns 404 unless the item is completed. + + Args: + 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}") + if not item_id: + raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") + return self._get( + path_template( + "/api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/reviews", + queue_id=queue_id, + item_id=item_id, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ItemRetrieveReviewsResponse, + ) + def set_final( self, key: str, @@ -559,6 +605,65 @@ cast_to=ItemSetFinalResponse, ) + def set_review( + self, + key: str, + *, + queue_id: str, + item_id: str, + score: float | Omit = omit, + value: str | Omit = omit, + values: SequenceNotStr[str] | 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, + ) -> AnnotationQueueItemKeyReviews: + """Replace your own answer on one rubric key and update the item's agreement. + + Only + a reviewer who completed the item can edit their answer. Multi-select keys take + a list of category labels in values; free-text keys take text in value. An empty + body clears your answer. + + Args: + 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}") + if not item_id: + raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") + if not key: + raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") + return self._put( + path_template( + "/api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/reviews/{key}", + queue_id=queue_id, + item_id=item_id, + key=key, + ), + body=maybe_transform( + { + "score": score, + "value": value, + "values": values, + }, + item_set_review_params.ItemSetReviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AnnotationQueueItemKeyReviews, + ) + class AsyncItemsResource(AsyncAPIResource): @cached_property @@ -1021,6 +1126,49 @@ cast_to=ItemRetrievePlacementResponse, ) + async def retrieve_reviews( + self, + item_id: str, + *, + queue_id: str, + # 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, + ) -> ItemRetrieveReviewsResponse: + """ + For each rubric key: whether the reviewers agreed, the final if one is set, and + each reviewer's answer. Reviewers are listed in the order they completed the + item. Their name and email are empty when the caller cannot see other workspace + members. Returns 404 unless the item is completed. + + Args: + 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}") + if not item_id: + raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") + return await self._get( + path_template( + "/api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/reviews", + queue_id=queue_id, + item_id=item_id, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=ItemRetrieveReviewsResponse, + ) + async def set_final( self, key: str, @@ -1079,6 +1227,65 @@ cast_to=ItemSetFinalResponse, ) + async def set_review( + self, + key: str, + *, + queue_id: str, + item_id: str, + score: float | Omit = omit, + value: str | Omit = omit, + values: SequenceNotStr[str] | 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, + ) -> AnnotationQueueItemKeyReviews: + """Replace your own answer on one rubric key and update the item's agreement. + + Only + a reviewer who completed the item can edit their answer. Multi-select keys take + a list of category labels in values; free-text keys take text in value. An empty + body clears your answer. + + Args: + 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}") + if not item_id: + raise ValueError(f"Expected a non-empty value for `item_id` but received {item_id!r}") + if not key: + raise ValueError(f"Expected a non-empty value for `key` but received {key!r}") + return await self._put( + path_template( + "/api/v1/platform/annotation-queues/{queue_id}/items/{item_id}/reviews/{key}", + queue_id=queue_id, + item_id=item_id, + key=key, + ), + body=await async_maybe_transform( + { + "score": score, + "value": value, + "values": values, + }, + item_set_review_params.ItemSetReviewParams, + ), + options=make_request_options( + extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + ), + cast_to=AnnotationQueueItemKeyReviews, + ) + class ItemsResourceWithRawResponse: def __init__(self, items: ItemsResource) -> None: @@ -1108,9 +1315,15 @@ self.retrieve_placement = to_raw_response_wrapper( items.retrieve_placement, ) + self.retrieve_reviews = to_raw_response_wrapper( + items.retrieve_reviews, + ) self.set_final = to_raw_response_wrapper( items.set_final, ) + self.set_review = to_raw_response_wrapper( + items.set_review, + ) class AsyncItemsResourceWithRawResponse: @@ -1141,9 +1354,15 @@ self.retrieve_placement = async_to_raw_response_wrapper( items.retrieve_placement, ) + self.retrieve_reviews = async_to_raw_response_wrapper( + items.retrieve_reviews, + ) self.set_final = async_to_raw_response_wrapper( items.set_final, ) + self.set_review = async_to_raw_response_wrapper( + items.set_review, + ) class ItemsResourceWithStreamingResponse: @@ -1174,9 +1393,15 @@ self.retrieve_placement = to_streamed_response_wrapper( items.retrieve_placement, ) + self.retrieve_reviews = to_streamed_response_wrapper( + items.retrieve_reviews, + ) self.set_final = to_streamed_response_wrapper( items.set_final, ) + self.set_review = to_streamed_response_wrapper( + items.set_review, + ) class AsyncItemsResourceWithStreamingResponse: @@ -1207,6 +1432,12 @@ self.retrieve_placement = async_to_streamed_response_wrapper( items.retrieve_placement, ) + self.retrieve_reviews = async_to_streamed_response_wrapper( + items.retrieve_reviews, + ) self.set_final = async_to_streamed_response_wrapper( items.set_final, ) + self.set_review = async_to_streamed_response_wrapper( + items.set_review, + ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/resources/workspace_secrets.py new/langsmith-0.16.0/src/langsmith/resources/workspace_secrets.py --- old/langsmith-0.15.1/src/langsmith/resources/workspace_secrets.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/resources/workspace_secrets.py 2020-02-02 01:00:00.000000000 +0100 @@ -16,9 +16,9 @@ async_to_raw_response_wrapper, async_to_streamed_response_wrapper, ) -from .._base_client import make_request_options +from ..pagination import SyncItemsCursorGetPagination, AsyncItemsCursorGetPagination +from .._base_client import AsyncPaginator, make_request_options from ..types.workspace_secret import WorkspaceSecret -from ..types.workspace_secret_list_response import WorkspaceSecretListResponse __all__ = ["WorkspaceSecretsResource", "AsyncWorkspaceSecretsResource"] @@ -46,20 +46,30 @@ def list( self, *, + cursor: str | Omit = omit, include_configs: bool | 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, - ) -> WorkspaceSecretListResponse: - """List the current workspace's secret keys. + ) -> SyncItemsCursorGetPagination[WorkspaceSecret]: + """List the current workspace's secret keys in ascending key order. - Values are never returned. + Secret values + are never returned. Set include_configs to include allowed hosts and header + configuration. Pass next_cursor as cursor to retrieve the next page, keeping + include_configs unchanged. Pagination reflects the current secrets on each + request, rather than a snapshot. Args: - include_configs: If true, include the hosts each secret may be sent to. + cursor: Opaque cursor from a previous response + + include_configs: Include the hosts each secret may be sent to + + page_size: Number of secrets per page extra_headers: Send extra headers @@ -69,18 +79,24 @@ timeout: Override the client-level default timeout for this request, in seconds """ - return self._get( - "/api/v1/workspaces/current/secrets", + return self._get_api_list( + "/api/v2/workspaces/current/secrets", + page=SyncItemsCursorGetPagination[WorkspaceSecret], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, query=maybe_transform( - {"include_configs": include_configs}, workspace_secret_list_params.WorkspaceSecretListParams + { + "cursor": cursor, + "include_configs": include_configs, + "page_size": page_size, + }, + workspace_secret_list_params.WorkspaceSecretListParams, ), ), - cast_to=WorkspaceSecretListResponse, + model=WorkspaceSecret, ) def delete( @@ -192,23 +208,33 @@ """ return AsyncWorkspaceSecretsResourceWithStreamingResponse(self) - async def list( + def list( self, *, + cursor: str | Omit = omit, include_configs: bool | 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, - ) -> WorkspaceSecretListResponse: - """List the current workspace's secret keys. + ) -> AsyncPaginator[WorkspaceSecret, AsyncItemsCursorGetPagination[WorkspaceSecret]]: + """List the current workspace's secret keys in ascending key order. - Values are never returned. + Secret values + are never returned. Set include_configs to include allowed hosts and header + configuration. Pass next_cursor as cursor to retrieve the next page, keeping + include_configs unchanged. Pagination reflects the current secrets on each + request, rather than a snapshot. Args: - include_configs: If true, include the hosts each secret may be sent to. + cursor: Opaque cursor from a previous response + + include_configs: Include the hosts each secret may be sent to + + page_size: Number of secrets per page extra_headers: Send extra headers @@ -218,18 +244,24 @@ timeout: Override the client-level default timeout for this request, in seconds """ - return await self._get( - "/api/v1/workspaces/current/secrets", + return self._get_api_list( + "/api/v2/workspaces/current/secrets", + page=AsyncItemsCursorGetPagination[WorkspaceSecret], options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout, - query=await async_maybe_transform( - {"include_configs": include_configs}, workspace_secret_list_params.WorkspaceSecretListParams + query=maybe_transform( + { + "cursor": cursor, + "include_configs": include_configs, + "page_size": page_size, + }, + workspace_secret_list_params.WorkspaceSecretListParams, ), ), - cast_to=WorkspaceSecretListResponse, + model=WorkspaceSecret, ) async def delete( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/run_helpers.py new/langsmith-0.16.0/src/langsmith/run_helpers.py --- old/langsmith-0.15.1/src/langsmith/run_helpers.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/run_helpers.py 2020-02-02 01:00:00.000000000 +0100 @@ -180,6 +180,7 @@ client: Optional[ls_client.Client] = None, replicas: Optional[Sequence[Union[WriteReplica, str]]] = None, distributed_parent_id: Optional[str] = None, + inherit_parent_tags_and_metadata: bool = True, **kwargs: Any, ) -> Generator[None, None, None]: """Set the tracing context for a block of code. @@ -205,6 +206,7 @@ Example: `[{"api_url": "https://api.example.com", "auth": {"api_key": "key"}, "project_name": "proj"}]` or `[{"project_name": "my_experiment", "updates": {"reference_example_id": None}}]` distributed_parent_id: The distributed parent ID for distributed tracing. Defaults to None. + inherit_parent_tags_and_metadata: Whether runs in this block also get the parent run's tags and metadata. Defaults to True. """ if kwargs: # warn @@ -230,9 +232,10 @@ ) distributed_parent_id_to_use = distributed_parent_id if distributed_parent_id_to_use is None and parent_run is not None: - # TODO(angus): decide if we want to merge tags and metadata - tags = sorted(set(tags or []) | set(parent_run.tags or [])) - metadata = {**parent_run.metadata, **(metadata or {})} + if inherit_parent_tags_and_metadata: + # TODO(angus): decide if we want to merge tags and metadata + tags = sorted(set(tags or []) | set(parent_run.tags or [])) + metadata = {**parent_run.metadata, **(metadata or {})} distributed_parent_id_to_use = parent_run.id # type: ignore[assignment] enabled = enabled if enabled is not None else current_context.get("enabled") _set_tracing_context( @@ -248,10 +251,17 @@ "distributed_parent_id": distributed_parent_id_to_use, } ) + previous_unmerged_parent_ids = run_trees._UNMERGED_PARENT_IDS.get() + if parent_run is not None: + if not inherit_parent_tags_and_metadata: + run_trees._UNMERGED_PARENT_IDS.set(previous_unmerged_parent_ids | {parent_run.id}) + elif distributed_parent_id is None: + run_trees._UNMERGED_PARENT_IDS.set(previous_unmerged_parent_ids - {parent_run.id}) try: yield finally: _set_tracing_context(current_context) + run_trees._UNMERGED_PARENT_IDS.set(previous_unmerged_parent_ids) # Alias for backwards compatibility diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/run_trees.py new/langsmith-0.16.0/src/langsmith/run_trees.py --- old/langsmith-0.15.1/src/langsmith/run_trees.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/run_trees.py 2020-02-02 01:00:00.000000000 +0100 @@ -206,6 +206,8 @@ _DISTRIBUTED_PARENT_ID = contextvars.ContextVar[Optional[str]]("_DISTRIBUTED_PARENT_ID", default=None) +_UNMERGED_PARENT_IDS = contextvars.ContextVar[frozenset[UUID]]("_UNMERGED_PARENT_IDS", default=frozenset()) + _SENTINEL = cast(None, object()) @@ -740,6 +742,8 @@ child_extra = {} child_meta = {} parent_meta = (self.extra or {}).get("metadata") or {} + if self.id in _UNMERGED_PARENT_IDS.get(): + parent_meta = {} child_extra["metadata"] = {**parent_meta, **child_meta} # upfront resolution of start_time so run_id can be derived from it. child_start_time = start_time or datetime.now(timezone.utc) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/sandbox/_models.py new/langsmith-0.16.0/src/langsmith/sandbox/_models.py --- old/langsmith-0.15.1/src/langsmith/sandbox/_models.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/sandbox/_models.py 2020-02-02 01:00:00.000000000 +0100 @@ -3,6 +3,7 @@ from __future__ import annotations import logging +import time from collections.abc import AsyncIterator, Awaitable, Callable, Iterator from dataclasses import dataclass, field from datetime import datetime, timezone @@ -92,6 +93,34 @@ return False +def _log_command_reconnect( + command_id: Optional[str], + attempt: int, + max_attempts: int, + elapsed: float, + error: SandboxConnectionError, + delay: float, +) -> None: + """Log a command stream disconnect before attempting to reattach.""" + closed = error.__cause__ + close_info = ( + f" (close received: {getattr(closed, 'rcvd', None)}; sent: {getattr(closed, 'sent', None)})" + if closed is not None and (hasattr(closed, "rcvd") or hasattr(closed, "sent")) + else "" + ) + logger.warning( + "Sandbox command %s lost its connection %.1fs in; reattaching (attempt %d/%d, delay %.1fs). %s: %s%s", + command_id, + elapsed, + attempt, + max_attempts, + delay, + type(error).__name__, + error, + close_info, + ) + + class _StreamEndedBeforeStarted(SandboxOperationError): """A command WebSocket closed before the guest sent its 'started' frame. @@ -971,6 +1000,7 @@ self._last_stdout_offset = stdout_offset self._last_stderr_offset = stderr_offset self._reconnect_attempts = 0 + self._started_at = time.monotonic() # New executions (command_id=""): eager_start reads "started" message. # Reconnections (command_id set): the "started" message is the server's @@ -1071,7 +1101,6 @@ - After kill(): no reconnect, error propagates """ add_sandbox_metadata(self._sandbox.id) - import time self._reconnect_attempts = 0 while True: @@ -1102,11 +1131,23 @@ ) from e is_hot_reload = isinstance(e, SandboxServerReloadError) - if not is_hot_reload: - delay = min( + delay = ( + 0.0 + if is_hot_reload + else min( self._BACKOFF_BASE * (2 ** (self._reconnect_attempts - 1)), self._BACKOFF_MAX, ) + ) + _log_command_reconnect( + self._command_id, + self._reconnect_attempts, + self.MAX_AUTO_RECONNECTS, + time.monotonic() - self._started_at, + e, + delay, + ) + if delay: time.sleep(delay) assert self._command_id is not None @@ -1267,6 +1308,7 @@ self._last_stdout_offset = stdout_offset self._last_stderr_offset = stderr_offset self._reconnect_attempts = 0 + self._started_at = time.monotonic() # New executions (command_id=""): _ensure_started reads "started". # Reconnections (command_id set): the "started" message is the server's @@ -1390,11 +1432,23 @@ ) from e is_hot_reload = isinstance(e, SandboxServerReloadError) - if not is_hot_reload: - delay = min( + delay = ( + 0.0 + if is_hot_reload + else min( self._BACKOFF_BASE * (2 ** (self._reconnect_attempts - 1)), self._BACKOFF_MAX, ) + ) + _log_command_reconnect( + self._command_id, + self._reconnect_attempts, + self.MAX_AUTO_RECONNECTS, + time.monotonic() - self._started_at, + e, + delay, + ) + if delay: await asyncio.sleep(delay) assert self._command_id is not None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/__init__.py new/langsmith-0.16.0/src/langsmith/types/__init__.py --- old/langsmith-0.15.1/src/langsmith/types/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -120,7 +120,6 @@ from .online_evaluator_delete_params import OnlineEvaluatorDeleteParams as OnlineEvaluatorDeleteParams from .online_evaluator_update_params import OnlineEvaluatorUpdateParams as OnlineEvaluatorUpdateParams from .product_feedback_create_params import ProductFeedbackCreateParams as ProductFeedbackCreateParams -from .workspace_secret_list_response import WorkspaceSecretListResponse as WorkspaceSecretListResponse from .workspace_secret_upsert_params import WorkspaceSecretUpsertParams as WorkspaceSecretUpsertParams from .bulk_delete_evaluators_response import BulkDeleteEvaluatorsResponse as BulkDeleteEvaluatorsResponse from .e_prompt_optimization_algorithm import EPromptOptimizationAlgorithm as EPromptOptimizationAlgorithm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/__init__.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/__init__.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/__init__.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/__init__.py 2020-02-02 01:00:00.000000000 +0100 @@ -16,6 +16,7 @@ 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 .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 @@ -23,5 +24,11 @@ from .item_retrieve_count_params import ItemRetrieveCountParams as ItemRetrieveCountParams from .run_create_by_key_response import RunCreateByKeyResponse as RunCreateByKeyResponse from .item_create_status_response import ItemCreateStatusResponse as ItemCreateStatusResponse +from .annotation_queue_item_answer import AnnotationQueueItemAnswer as AnnotationQueueItemAnswer from .item_retrieve_count_response import ItemRetrieveCountResponse as ItemRetrieveCountResponse +from .item_retrieve_reviews_response import ItemRetrieveReviewsResponse as ItemRetrieveReviewsResponse from .item_retrieve_placement_response import ItemRetrievePlacementResponse as ItemRetrievePlacementResponse +from .annotation_queue_item_key_reviews import AnnotationQueueItemKeyReviews as AnnotationQueueItemKeyReviews +from .annotation_queue_item_agreement_state import ( + AnnotationQueueItemAgreementState as AnnotationQueueItemAgreementState, +) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/annotation_queue_item_agreement_state.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/annotation_queue_item_agreement_state.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/annotation_queue_item_agreement_state.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/annotation_queue_item_agreement_state.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,7 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing_extensions import Literal, TypeAlias + +__all__ = ["AnnotationQueueItemAgreementState"] + +AnnotationQueueItemAgreementState: TypeAlias = Literal["agreed", "disagreed", "none"] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/annotation_queue_item_answer.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/annotation_queue_item_answer.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/annotation_queue_item_answer.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/annotation_queue_item_answer.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ..._models import BaseModel + +__all__ = ["AnnotationQueueItemAnswer"] + + +class AnnotationQueueItemAnswer(BaseModel): + score: Optional[float] = None + + scores: Optional[List[float]] = None + + value: Optional[str] = None + + values: Optional[List[str]] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/annotation_queue_item_key_reviews.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/annotation_queue_item_key_reviews.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/annotation_queue_item_key_reviews.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/annotation_queue_item_key_reviews.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,34 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel +from .annotation_queue_item_answer import AnnotationQueueItemAnswer +from .annotation_queue_item_agreement_state import AnnotationQueueItemAgreementState + +__all__ = ["AnnotationQueueItemKeyReviews", "Review"] + + +class Review(BaseModel): + answer: Optional[AnnotationQueueItemAnswer] = None + + ls_user_id: Optional[str] = None + + +class AnnotationQueueItemKeyReviews(BaseModel): + answer: Optional[AnnotationQueueItemAnswer] = None + + final: Optional[AnnotationQueueItemAnswer] = None + + final_set_at: Optional[datetime] = None + + final_set_by: Optional[str] = None + + has_final: Optional[bool] = None + + key: Optional[str] = None + + reviews: Optional[List[Review]] = None + + state: Optional[AnnotationQueueItemAgreementState] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_list_response.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_list_response.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_list_response.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_list_response.py 2020-02-02 01:00:00.000000000 +0100 @@ -4,26 +4,18 @@ from typing_extensions import Literal from ..._models import BaseModel +from .annotation_queue_item_answer import AnnotationQueueItemAnswer +from .annotation_queue_item_agreement_state import AnnotationQueueItemAgreementState -__all__ = ["ItemListResponse", "KeyAgreements", "KeyAgreementsAnswer"] - - -class KeyAgreementsAnswer(BaseModel): - score: Optional[float] = None - - scores: Optional[List[float]] = None - - value: Optional[str] = None - - values: Optional[List[str]] = None +__all__ = ["ItemListResponse", "KeyAgreements"] class KeyAgreements(BaseModel): - answer: Optional[KeyAgreementsAnswer] = None + answer: Optional[AnnotationQueueItemAnswer] = None has_final: Optional[bool] = None - state: Optional[Literal["agreed", "disagreed", "none"]] = None + state: Optional[AnnotationQueueItemAgreementState] = None class ItemListResponse(BaseModel): @@ -31,7 +23,7 @@ added_at: Optional[str] = None - agreement_state: Optional[Literal["agreed", "disagreed", "none"]] = None + agreement_state: Optional[AnnotationQueueItemAgreementState] = None """Whether the item's reviewers agreed across its rubric keys.""" assigned_to: Optional[List[str]] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_retrieve_reviews_response.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_retrieve_reviews_response.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_retrieve_reviews_response.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_retrieve_reviews_response.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from datetime import datetime + +from ..._models import BaseModel +from .annotation_queue_item_key_reviews import AnnotationQueueItemKeyReviews + +__all__ = ["ItemRetrieveReviewsResponse", "Reviewer"] + + +class Reviewer(BaseModel): + completed_at: Optional[datetime] = None + + email: Optional[str] = None + + identity_id: Optional[str] = None + + ls_user_id: Optional[str] = None + + name: Optional[str] = None + + +class ItemRetrieveReviewsResponse(BaseModel): + keys: Optional[List[AnnotationQueueItemKeyReviews]] = None + + reviewers: Optional[List[Reviewer]] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_set_final_response.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_set_final_response.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_set_final_response.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_set_final_response.py 2020-02-02 01:00:00.000000000 +0100 @@ -1,38 +1,19 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import List, Optional +from typing import Optional from datetime import datetime -from typing_extensions import Literal from ..._models import BaseModel +from .annotation_queue_item_answer import AnnotationQueueItemAnswer +from .annotation_queue_item_agreement_state import AnnotationQueueItemAgreementState -__all__ = ["ItemSetFinalResponse", "Answer", "Final"] - - -class Answer(BaseModel): - score: Optional[float] = None - - scores: Optional[List[float]] = None - - value: Optional[str] = None - - values: Optional[List[str]] = None - - -class Final(BaseModel): - score: Optional[float] = None - - scores: Optional[List[float]] = None - - value: Optional[str] = None - - values: Optional[List[str]] = None +__all__ = ["ItemSetFinalResponse"] class ItemSetFinalResponse(BaseModel): - answer: Optional[Answer] = None + answer: Optional[AnnotationQueueItemAnswer] = None - final: Optional[Final] = None + final: Optional[AnnotationQueueItemAnswer] = None final_set_at: Optional[datetime] = None @@ -42,4 +23,4 @@ key: Optional[str] = None - state: Optional[Literal["agreed", "disagreed", "none"]] = None + state: Optional[AnnotationQueueItemAgreementState] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_set_review_params.py new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_set_review_params.py --- old/langsmith-0.15.1/src/langsmith/types/annotation_queues/item_set_review_params.py 1970-01-01 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/annotation_queues/item_set_review_params.py 2020-02-02 01:00:00.000000000 +0100 @@ -0,0 +1,21 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +from ..._types import SequenceNotStr + +__all__ = ["ItemSetReviewParams"] + + +class ItemSetReviewParams(TypedDict, total=False): + queue_id: Required[str] + + item_id: Required[str] + + score: float + + value: str + + values: SequenceNotStr[str] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/evaluator_top_level.py new/langsmith-0.16.0/src/langsmith/types/evaluator_top_level.py --- old/langsmith-0.15.1/src/langsmith/types/evaluator_top_level.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/evaluator_top_level.py 2020-02-02 01:00:00.000000000 +0100 @@ -21,6 +21,11 @@ prompt: Optional[List[List[object]]] = None schema_: Optional[Dict[str, object]] = FieldInfo(alias="schema", default=None) + """Output schema for the evaluator's feedback. + + Not accepted for decision-model (TypeSafe or OpenAI Decisions) evaluators, whose + schema comes from their questions. + """ template_format: Optional[str] = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/workspace_secret_list_params.py new/langsmith-0.16.0/src/langsmith/types/workspace_secret_list_params.py --- old/langsmith-0.15.1/src/langsmith/types/workspace_secret_list_params.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/workspace_secret_list_params.py 2020-02-02 01:00:00.000000000 +0100 @@ -8,5 +8,11 @@ class WorkspaceSecretListParams(TypedDict, total=False): + cursor: str + """Opaque cursor from a previous response""" + include_configs: bool - """If true, include the hosts each secret may be sent to.""" + """Include the hosts each secret may be sent to""" + + page_size: int + """Number of secrets per page""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/src/langsmith/types/workspace_secret_list_response.py new/langsmith-0.16.0/src/langsmith/types/workspace_secret_list_response.py --- old/langsmith-0.15.1/src/langsmith/types/workspace_secret_list_response.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/src/langsmith/types/workspace_secret_list_response.py 1970-01-01 01:00:00.000000000 +0100 @@ -1,10 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List -from typing_extensions import TypeAlias - -from .workspace_secret import WorkspaceSecret - -__all__ = ["WorkspaceSecretListResponse"] - -WorkspaceSecretListResponse: TypeAlias = List[WorkspaceSecret] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/tests/api_resources/annotation_queues/test_items.py new/langsmith-0.16.0/tests/api_resources/annotation_queues/test_items.py --- old/langsmith-0.15.1/tests/api_resources/annotation_queues/test_items.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/tests/api_resources/annotation_queues/test_items.py 2020-02-02 01:00:00.000000000 +0100 @@ -19,6 +19,8 @@ ItemDeleteAllResponse, ItemCreateStatusResponse, ItemRetrieveCountResponse, + ItemRetrieveReviewsResponse, + AnnotationQueueItemKeyReviews, ItemRetrievePlacementResponse, ) @@ -506,6 +508,59 @@ @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize + def test_method_retrieve_reviews(self, client: Langsmith) -> None: + item = client.annotation_queues.items.retrieve_reviews( + item_id="item_id", + queue_id="queue_id", + ) + assert_matches_type(ItemRetrieveReviewsResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_retrieve_reviews(self, client: Langsmith) -> None: + + response = client.annotation_queues.items.with_raw_response.retrieve_reviews( + item_id="item_id", + queue_id="queue_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = response.parse() + assert_matches_type(ItemRetrieveReviewsResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_retrieve_reviews(self, client: Langsmith) -> None: + with client.annotation_queues.items.with_streaming_response.retrieve_reviews( + item_id="item_id", + queue_id="queue_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = response.parse() + assert_matches_type(ItemRetrieveReviewsResponse, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_retrieve_reviews(self, client: Langsmith) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): + client.annotation_queues.items.with_raw_response.retrieve_reviews( + item_id="item_id", + queue_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `item_id` but received ''"): + client.annotation_queues.items.with_raw_response.retrieve_reviews( + item_id="", + queue_id="queue_id", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize def test_method_set_final(self, client: Langsmith) -> None: item = client.annotation_queues.items.set_final( key="key", @@ -582,6 +637,84 @@ item_id="item_id", ) + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_set_review(self, client: Langsmith) -> None: + item = client.annotation_queues.items.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + ) + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_method_set_review_with_all_params(self, client: Langsmith) -> None: + item = client.annotation_queues.items.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + score=0, + value="value", + values=["string"], + ) + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_raw_response_set_review(self, client: Langsmith) -> None: + + response = client.annotation_queues.items.with_raw_response.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = response.parse() + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_streaming_response_set_review(self, client: Langsmith) -> None: + with client.annotation_queues.items.with_streaming_response.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = response.parse() + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + def test_path_params_set_review(self, client: Langsmith) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `queue_id` but received ''"): + client.annotation_queues.items.with_raw_response.set_review( + key="key", + queue_id="", + item_id="item_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `item_id` but received ''"): + client.annotation_queues.items.with_raw_response.set_review( + key="key", + queue_id="queue_id", + item_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + client.annotation_queues.items.with_raw_response.set_review( + key="", + queue_id="queue_id", + item_id="item_id", + ) + class TestAsyncItems: parametrize = pytest.mark.parametrize( @@ -1066,6 +1199,59 @@ @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize + async def test_method_retrieve_reviews(self, async_client: AsyncLangsmith) -> None: + item = await async_client.annotation_queues.items.retrieve_reviews( + item_id="item_id", + queue_id="queue_id", + ) + assert_matches_type(ItemRetrieveReviewsResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_retrieve_reviews(self, async_client: AsyncLangsmith) -> None: + + response = await async_client.annotation_queues.items.with_raw_response.retrieve_reviews( + item_id="item_id", + queue_id="queue_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = await response.parse() + assert_matches_type(ItemRetrieveReviewsResponse, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_retrieve_reviews(self, async_client: AsyncLangsmith) -> None: + async with async_client.annotation_queues.items.with_streaming_response.retrieve_reviews( + item_id="item_id", + queue_id="queue_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = await response.parse() + assert_matches_type(ItemRetrieveReviewsResponse, item, 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_retrieve_reviews(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.items.with_raw_response.retrieve_reviews( + item_id="item_id", + queue_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `item_id` but received ''"): + await async_client.annotation_queues.items.with_raw_response.retrieve_reviews( + item_id="", + queue_id="queue_id", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize async def test_method_set_final(self, async_client: AsyncLangsmith) -> None: item = await async_client.annotation_queues.items.set_final( key="key", @@ -1140,4 +1326,82 @@ key="", queue_id="queue_id", item_id="item_id", + ) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_set_review(self, async_client: AsyncLangsmith) -> None: + item = await async_client.annotation_queues.items.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + ) + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_method_set_review_with_all_params(self, async_client: AsyncLangsmith) -> None: + item = await async_client.annotation_queues.items.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + score=0, + value="value", + values=["string"], + ) + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_raw_response_set_review(self, async_client: AsyncLangsmith) -> None: + + response = await async_client.annotation_queues.items.with_raw_response.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + item = await response.parse() + assert_matches_type(AnnotationQueueItemKeyReviews, item, path=["response"]) + + @pytest.mark.skip(reason="Mock server tests are disabled") + @parametrize + async def test_streaming_response_set_review(self, async_client: AsyncLangsmith) -> None: + async with async_client.annotation_queues.items.with_streaming_response.set_review( + key="key", + queue_id="queue_id", + item_id="item_id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + item = await response.parse() + assert_matches_type(AnnotationQueueItemKeyReviews, item, 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_set_review(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.items.with_raw_response.set_review( + key="key", + queue_id="", + item_id="item_id", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `item_id` but received ''"): + await async_client.annotation_queues.items.with_raw_response.set_review( + key="key", + queue_id="queue_id", + item_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `key` but received ''"): + await async_client.annotation_queues.items.with_raw_response.set_review( + key="", + queue_id="queue_id", + item_id="item_id", ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/tests/api_resources/test_workspace_secrets.py new/langsmith-0.16.0/tests/api_resources/test_workspace_secrets.py --- old/langsmith-0.15.1/tests/api_resources/test_workspace_secrets.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/tests/api_resources/test_workspace_secrets.py 2020-02-02 01:00:00.000000000 +0100 @@ -9,10 +9,8 @@ from langsmith import Langsmith, AsyncLangsmith from tests.utils import assert_matches_type -from langsmith.types import ( - WorkspaceSecret, - WorkspaceSecretListResponse, -) +from langsmith.types import WorkspaceSecret +from langsmith.pagination import SyncItemsCursorGetPagination, AsyncItemsCursorGetPagination base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -24,15 +22,17 @@ @parametrize def test_method_list(self, client: Langsmith) -> None: workspace_secret = client.workspace_secrets.list() - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(SyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize def test_method_list_with_all_params(self, client: Langsmith) -> None: workspace_secret = client.workspace_secrets.list( + cursor="cursor", include_configs=True, + page_size=1, ) - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(SyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -43,7 +43,7 @@ assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" workspace_secret = response.parse() - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(SyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -53,7 +53,7 @@ assert response.http_request.headers.get("X-Stainless-Lang") == "python" workspace_secret = response.parse() - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(SyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) assert cast(Any, response.is_closed) is True @@ -169,15 +169,17 @@ @parametrize async def test_method_list(self, async_client: AsyncLangsmith) -> None: workspace_secret = await async_client.workspace_secrets.list() - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(AsyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, 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: workspace_secret = await async_client.workspace_secrets.list( + cursor="cursor", include_configs=True, + page_size=1, ) - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(AsyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -188,7 +190,7 @@ assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" workspace_secret = await response.parse() - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(AsyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) @pytest.mark.skip(reason="Mock server tests are disabled") @parametrize @@ -198,7 +200,7 @@ assert response.http_request.headers.get("X-Stainless-Lang") == "python" workspace_secret = await response.parse() - assert_matches_type(WorkspaceSecretListResponse, workspace_secret, path=["response"]) + assert_matches_type(AsyncItemsCursorGetPagination[WorkspaceSecret], workspace_secret, path=["response"]) assert cast(Any, response.is_closed) is True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/langsmith-0.15.1/tests/unit_tests/test_run_helpers.py new/langsmith-0.16.0/tests/unit_tests/test_run_helpers.py --- old/langsmith-0.15.1/tests/unit_tests/test_run_helpers.py 2020-02-02 01:00:00.000000000 +0100 +++ new/langsmith-0.16.0/tests/unit_tests/test_run_helpers.py 2020-02-02 01:00:00.000000000 +0100 @@ -41,6 +41,7 @@ _processing_failed, as_runnable, get_current_run_tree, + get_tracing_context, is_traceable_function, trace, traceable, @@ -2627,6 +2628,57 @@ assert seen["parent_run_id"] == upstream.id [email protected]( + ("inherit_kwargs", "expected_tags", "expected_metadata"), + [ + ({}, ["call", "step"], {"step_only": True}), + ({"inherit_parent_tags_and_metadata": False}, ["call"], {}), + ], +) +def test_tracing_context_inherit_parent_tags_and_metadata_controls_what_runs_get( + inherit_kwargs: dict[str, bool], expected_tags: list[str], expected_metadata: dict[str, Any] +): + step = RunTree(name="step", run_type="chain", tags=["step"], extra={"metadata": {"step_only": True}}) + other = RunTree(name="other", run_type="chain") + seen = {} + + def labels(run: RunTree) -> dict[str, Any]: + return {key: run.metadata[key] for key in ("step_only", "label", "call_only") if key in run.metadata} + + @traceable(run_type="llm", name="call", metadata={"call_only": True}) + def call(): + call_run = get_current_run_tree() + seen["call"] = labels(call_run) + seen["call_child"] = labels(call_run.create_child(name="call_child", run_type="chain")) + + with tracing_context(enabled="local"): + with tracing_context(parent=step, tags=["call"], metadata={"label": "call"}, **inherit_kwargs): + context = get_tracing_context() + call() + with trace(name="block", run_type="chain") as block: + seen["block"] = labels(block) + with tracing_context(parent=step): + seen["step_child_merged_again"] = labels(step.create_child(name="again", run_type="chain")) + with tracing_context(**get_tracing_context()): + seen["step_child_restored"] = labels(step.create_child(name="restored", run_type="chain")) + seen["step_child"] = labels(step.create_child(name="step_child", run_type="chain")) + with tracing_context(parent=other, inherit_parent_tags_and_metadata=False): + seen["step_child_beside_other"] = labels(step.create_child(name="beside", run_type="chain")) + seen["after"] = labels(step.create_child(name="after", run_type="chain")) + + assert context["tags"] == expected_tags + assert seen == { + "call": {**expected_metadata, "label": "call", "call_only": True}, + "call_child": {**expected_metadata, "label": "call", "call_only": True}, + "block": {**expected_metadata, "label": "call"}, + "step_child": expected_metadata, + "step_child_beside_other": expected_metadata, + "step_child_restored": expected_metadata, + "step_child_merged_again": {"step_only": True}, + "after": {"step_only": True}, + } + + def _clean_agent_addressing_env(monkeypatch: pytest.MonkeyPatch, **values: str) -> None: for name in ( "LANGSMITH_AGENT_ID",
