[PR #2309] feat(async-client): port missing example and dataset methods from sync client #2229

Open
opened 2026-02-15 23:17:00 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langsmith-sdk/pull/2309
Author: @sapountzis
Created: 1/26/2026
Status: 🔄 Open

Base: mainHead: feature/async-client-example-dataset-parity


📝 Commits (1)

  • 9fc2cb3 feat(async-client): port missing example and dataset methods from sync client

📊 Changes

2 files changed (+2093 additions, -91 deletions)

View changed files

📝 python/langsmith/async_client.py (+1373 -88)
📝 python/tests/unit_tests/test_async_client.py (+720 -3)

📄 Description

Summary

This PR ports all missing example and dataset-related methods from the sync Client to the async AsyncClient, achieving full API parity between the two clients.

Changes

Methods Added (22 total)

Example Methods:

  • create_llm_example - Create LLM-type examples
  • create_chat_example - Create chat-type examples
  • create_example_from_run - Create examples from existing runs
  • update_example - Update a single example
  • update_examples - Bulk update examples
  • delete_example - Delete a single example
  • delete_examples - Bulk delete examples
  • create_examples - Bulk create examples

Dataset Methods:

  • share_dataset - Create share link for dataset
  • unshare_dataset - Remove share link
  • read_dataset_shared_schema - Read shared dataset schema
  • read_shared_dataset - Read shared dataset by token
  • list_shared_examples - List examples from shared dataset
  • has_dataset - Check if dataset exists
  • diff_dataset_versions - Compare dataset versions
  • read_dataset_openai_finetuning - Export dataset for OpenAI fine-tuning
  • update_dataset_tag - Update dataset version tags
  • list_dataset_versions - List dataset versions
  • read_dataset_version - Read specific dataset version
  • clone_public_dataset - Clone public dataset
  • list_dataset_splits - List dataset splits
  • update_dataset_splits - Update dataset splits

Implementation Details

  • All methods maintain 100% functional parity with sync client
  • Proper async/await patterns throughout
  • Uses _arequest_with_retries for HTTP calls
  • Helper methods imported from sync client where appropriate
  • Simplified JSON bulk endpoint for create_examples and update_examples (multipart support can be added later)

Testing

  • Ported all related unit tests from test_client.py to test_async_client.py
  • Tests match sync client test logic exactly (100% parity)
  • Fixed TypedDict access patterns (DatasetShareSchema, UpsertExamplesResponse)
  • Fixed schema field names (tags vs tag, examples_added vs added, etc.)
  • Fixed async/await issues (_current_tenant_is_owner)

Breaking Changes

None - all additions are new methods.

Related Issues

https://github.com/langchain-ai/langsmith-sdk/issues/2307


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langsmith-sdk/pull/2309 **Author:** [@sapountzis](https://github.com/sapountzis) **Created:** 1/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feature/async-client-example-dataset-parity` --- ### 📝 Commits (1) - [`9fc2cb3`](https://github.com/langchain-ai/langsmith-sdk/commit/9fc2cb33f2642216ed4afc31dd39dd35e71a3b7a) feat(async-client): port missing example and dataset methods from sync client ### 📊 Changes **2 files changed** (+2093 additions, -91 deletions) <details> <summary>View changed files</summary> 📝 `python/langsmith/async_client.py` (+1373 -88) 📝 `python/tests/unit_tests/test_async_client.py` (+720 -3) </details> ### 📄 Description ## Summary This PR ports all missing example and dataset-related methods from the sync `Client` to the async `AsyncClient`, achieving full API parity between the two clients. ## Changes ### Methods Added (22 total) **Example Methods:** - `create_llm_example` - Create LLM-type examples - `create_chat_example` - Create chat-type examples - `create_example_from_run` - Create examples from existing runs - `update_example` - Update a single example - `update_examples` - Bulk update examples - `delete_example` - Delete a single example - `delete_examples` - Bulk delete examples - `create_examples` - Bulk create examples **Dataset Methods:** - `share_dataset` - Create share link for dataset - `unshare_dataset` - Remove share link - `read_dataset_shared_schema` - Read shared dataset schema - `read_shared_dataset` - Read shared dataset by token - `list_shared_examples` - List examples from shared dataset - `has_dataset` - Check if dataset exists - `diff_dataset_versions` - Compare dataset versions - `read_dataset_openai_finetuning` - Export dataset for OpenAI fine-tuning - `update_dataset_tag` - Update dataset version tags - `list_dataset_versions` - List dataset versions - `read_dataset_version` - Read specific dataset version - `clone_public_dataset` - Clone public dataset - `list_dataset_splits` - List dataset splits - `update_dataset_splits` - Update dataset splits ## Implementation Details - All methods maintain **100% functional parity** with sync client - Proper async/await patterns throughout - Uses `_arequest_with_retries` for HTTP calls - Helper methods imported from sync client where appropriate - Simplified JSON bulk endpoint for `create_examples` and `update_examples` (multipart support can be added later) ## Testing - Ported all related unit tests from `test_client.py` to `test_async_client.py` - Tests match sync client test logic exactly (100% parity) - Fixed TypedDict access patterns (`DatasetShareSchema`, `UpsertExamplesResponse`) - Fixed schema field names (`tags` vs `tag`, `examples_added` vs `added`, etc.) - Fixed async/await issues (`_current_tenant_is_owner`) ## Breaking Changes None - all additions are new methods. ## Related Issues https://github.com/langchain-ai/langsmith-sdk/issues/2307 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 23:17:00 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langsmith-sdk#2229