Skip to content

feat:Update API Endpoints for Tracer Sessions, Datasets, and Examples#144

Merged
github-actions[bot] merged 1 commit intomainfrom
bot/update-openapi_202412030142
Dec 3, 2024
Merged

feat:Update API Endpoints for Tracer Sessions, Datasets, and Examples#144
github-actions[bot] merged 1 commit intomainfrom
bot/update-openapi_202412030142

Conversation

@HavenDV
Copy link
Contributor

@HavenDV HavenDV commented Dec 3, 2024

Summary by CodeRabbit

  • New Features
    • Introduced new API endpoints for creating, updating, and deleting tracer sessions.
    • Enhanced dataset management with features to clone, download, and perform operations on datasets.
    • Improved example management with bulk upload, update, and validation capabilities.

These updates significantly enhance the functionality and usability of the LangSmith platform for managing datasets and examples.

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2024

Walkthrough

The changes in this pull request involve significant updates to the API endpoints within the LangSmith platform, specifically focusing on tracer sessions, datasets, and examples. New methods have been introduced for creating, updating, and deleting tracer sessions, alongside enhancements to dataset functionalities such as cloning and format downloads. Additionally, the example API has been improved to support bulk uploads and validations, thereby expanding the platform's capabilities in managing and utilizing datasets and examples.

Changes

File Path Change Summary
src/libs/LangSmith/openapi.yaml - Added methods for creating, updating, and deleting tracer sessions, datasets, and examples.
- Enhanced dataset API with cloning, downloading, and search capabilities.
- Improved example API with bulk upload and validation functionalities.

Possibly related PRs

Suggested reviewers

  • github-actions

🐇 In the meadow, I hop with glee,
New endpoints bloom, as bright as can be!
Tracer sessions, datasets, all in a row,
With examples to share, watch our platform grow!
So let’s celebrate, with a joyful cheer,
For changes that bring us all good cheer! 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot enabled auto-merge December 3, 2024 01:42
@coderabbitai coderabbitai bot changed the title feat:@coderabbitai feat:Update API Endpoints for Tracer Sessions, Datasets, and Examples Dec 3, 2024
@github-actions github-actions bot merged commit 98a0448 into main Dec 3, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 76f6674 and 3fb2883.

⛔ Files ignored due to path filters (6)
  • src/libs/LangSmith/Generated/LangSmith.DatasetsClient.DownloadDatasetJsonl.g.cs is excluded by !**/generated/**
  • src/libs/LangSmith/Generated/LangSmith.IDatasetsClient.DownloadDatasetJsonl.g.cs is excluded by !**/generated/**
  • src/libs/LangSmith/Generated/LangSmith.IPublicClient.ReadSharedDatasetTracerSessionsBulk.g.cs is excluded by !**/generated/**
  • src/libs/LangSmith/Generated/LangSmith.Models.DownloadDatasetJsonlApiV1DatasetsDatasetIdJsonlGetResponse.Json.g.cs is excluded by !**/generated/**
  • src/libs/LangSmith/Generated/LangSmith.Models.DownloadDatasetJsonlApiV1DatasetsDatasetIdJsonlGetResponse.g.cs is excluded by !**/generated/**
  • src/libs/LangSmith/Generated/LangSmith.PublicClient.ReadSharedDatasetTracerSessionsBulk.g.cs is excluded by !**/generated/**
📒 Files selected for processing (1)
  • src/libs/LangSmith/openapi.yaml (2 hunks)

Comment on lines +5467 to +5498
/api/v1/public/datasets/sessions-bulk:
get:
tags:
- public
summary: Read Shared Dataset Tracer Sessions Bulk
description: Get sessions from multiple datasets using share tokens.
operationId: read_shared_dataset_tracer_sessions_bulk_api_v1_public_datasets_sessions_bulk_get
parameters:
- name: share_tokens
in: query
required: true
schema:
title: Share Tokens
type: array
items:
type: string
responses:
'200':
description: Successful Response
content:
application/json:
schema:
title: Response Read Shared Dataset Tracer Sessions Bulk Api V1 Public Datasets Sessions Bulk Get
type: array
items:
$ref: '#/components/schemas/TracerSession'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

🛠️ Refactor suggestion

Based on the search results showing array size limits and bulk endpoints, I can now provide the final response:

Add size limits to share_tokens parameter in bulk sessions endpoint

The codebase shows consistent use of array size limits across different endpoints:

  • Most array parameters have defined limits ranging from 2 to 50 items
  • No bulk endpoints accept unlimited array inputs

Add the following limit to align with existing patterns:

          schema:
            title: Share Tokens
            type: array
+           maxItems: 50  # Aligned with similar bulk endpoints
            items:
              type: string
🔗 Analysis chain

Review bulk dataset tracer sessions endpoint implementation

The bulk sessions endpoint is well-structured but could benefit from additional documentation and validation:

  1. The description explains the purpose but doesn't specify the response format
  2. The share_tokens array has no size limits which could impact performance

Consider adding:

  1. Response schema details in the description
  2. Maximum array size limit for share_tokens parameter:
          schema:
            title: Share Tokens
            type: array
+           maxItems: 100  # Or appropriate limit
            items:
              type: string

Run the following script to check for consistent array size limits across similar bulk endpoints:


Let me search for more context about bulk endpoints to make a well-informed decision.


Let me try a different search pattern to find bulk endpoints.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check array size limits in bulk endpoints
rg -A 5 "maxItems:" 

Length of output: 1380


Script:

#!/bin/bash
# Search for bulk endpoints and their array parameters
rg -B 2 -A 10 "bulk.*get:" src/libs/LangSmith/openapi.yaml

Length of output: 60


Script:

#!/bin/bash
# Search for endpoints with 'bulk' in their path
rg -B 2 -A 10 "/.*bulk" src/libs/LangSmith/openapi.yaml

Length of output: 3367

Comment on lines +3061 to +3100
'/api/v1/datasets/{dataset_id}/jsonl':
get:
tags:
- datasets
summary: Download Dataset Jsonl
description: Download a dataset as CSV format.
operationId: download_dataset_jsonl_api_v1_datasets__dataset_id__jsonl_get
parameters:
- name: dataset_id
in: path
required: true
schema:
title: Dataset Id
type: string
format: uuid
- name: as_of
in: query
description: 'Only modifications made on or before this time are included. If None, the latest version of the dataset is used.'
schema:
title: As Of
type: string
description: 'Only modifications made on or before this time are included. If None, the latest version of the dataset is used.'
format: date-time
nullable: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: { }
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
security:
- ApiKey: [ ]
- TenantId: [ ]
- BearerAuth: [ ]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Review JSONL download endpoint implementation

The JSONL download endpoint appears to have a documentation inconsistency:

  1. The description states "Download a dataset as CSV format" but the endpoint is for JSONL format
  2. The endpoint path indicates JSONL format ('/jsonl')

Update the endpoint description to correctly reflect JSONL format:

-      description: Download a dataset as CSV format.
+      description: Download a dataset as JSONL format.

Additionally, consider:

  1. Adding response content type specification for JSONL
  2. Documenting the JSONL file structure in the description

Committable suggestion skipped: line range outside the PR's diff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant