-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat:Add API endpoints for managing tracer sessions, datasets, and examples #118
Conversation
WalkthroughThe changes introduce new API endpoints and methods for managing tracer sessions, datasets, and examples within the LangSmith platform. Key additions include functionalities for creating, updating, and deleting tracer sessions and datasets, as well as querying and filtering tracer sessions. Enhanced capabilities also allow for bulk uploads and validation of examples, significantly expanding the API's features related to these core components. Changes
Possibly related PRs
Suggested reviewers
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
src/libs/LangSmith/openapi.yaml (1)
15778-15784
: Well-structured message type definitions with comprehensive coverage.The schema correctly handles polymorphic message types and includes both regular and streaming variants.
Consider grouping the regular messages and chunk messages separately for better readability:
items: oneOf: - - $ref: '#/components/schemas/AIMessage' - - $ref: '#/components/schemas/HumanMessage' - - $ref: '#/components/schemas/ChatMessage' - - $ref: '#/components/schemas/SystemMessage' - - $ref: '#/components/schemas/FunctionMessage' - - $ref: '#/components/schemas/ToolMessage' - - $ref: '#/components/schemas/AIMessageChunk' - - $ref: '#/components/schemas/HumanMessageChunk' - - $ref: '#/components/schemas/ChatMessageChunk' - - $ref: '#/components/schemas/SystemMessageChunk' + # Regular messages + - $ref: '#/components/schemas/AIMessage' + - $ref: '#/components/schemas/HumanMessage' + - $ref: '#/components/schemas/ChatMessage' + - $ref: '#/components/schemas/SystemMessage' + - $ref: '#/components/schemas/FunctionMessage' + - $ref: '#/components/schemas/ToolMessage' + # Streaming chunks + - $ref: '#/components/schemas/AIMessageChunk' + - $ref: '#/components/schemas/HumanMessageChunk' + - $ref: '#/components/schemas/ChatMessageChunk' + - $ref: '#/components/schemas/SystemMessageChunk'
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (48)
src/libs/LangSmith/Generated/JsonConverters.AIMessageChunkInputType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageChunkInputTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageChunkOutputType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageChunkOutputTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageChunkType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageChunkTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.AIMessageTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.MessagesItem.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.MessagesItem2.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.PlaygroundPromptCanvasResponseArtifactLength.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.PlaygroundPromptCanvasResponseArtifactLengthNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.PlaygroundPromptCanvasResponseMessageDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.PlaygroundPromptCanvasResponseMessageDiscriminatorTypeNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.PlaygroundPromptCanvasResponseReadingLevel.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonConverters.PlaygroundPromptCanvasResponseReadingLevelNullable.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonSerializerContext.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/JsonSerializerContextTypes.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.IPromptsClient.Canvas.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessage.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageAdditionalKwargs.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunk.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkAdditionalKwargs.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkContentVariant2Item.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkInputAdditionalKwargs.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkInputContentVariant2Item.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkInputResponseMetadata.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkOutput.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkOutputContentVariant2Item.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkOutputResponseMetadata.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkOutputType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkResponseMetadata.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageChunkType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageContentVariant2Item.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageOutput.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageOutputContentVariant2Item.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageOutputType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageResponseMetadata.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.AIMessageType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.CanvasApiV1PromptsCanvasPostResponse.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.MessagesItem.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.MessagesItem2.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.PlaygroundPromptCanvasResponse.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.PlaygroundPromptCanvasResponseArtifactLength.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.PlaygroundPromptCanvasResponseMessageDiscriminator.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.PlaygroundPromptCanvasResponseMessageDiscriminatorType.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.Models.PlaygroundPromptCanvasResponseReadingLevel.g.cs
is excluded by!**/generated/**
src/libs/LangSmith/Generated/LangSmith.PromptsClient.Canvas.g.cs
is excluded by!**/generated/**
📒 Files selected for processing (1)
src/libs/LangSmith/openapi.yaml
(4 hunks)
🔇 Additional comments (2)
src/libs/LangSmith/openapi.yaml (2)
10349-10351
: Verify AIMessage schema completeness.
The schema definition appears to be missing property definitions for the required 'content' field and potentially other important fields that an AI message should contain.
Let's check the complete schema definition:
✅ Verification successful
AIMessage schema is properly defined
The schema is complete and well-structured with:
- Required 'content' field properly defined with support for both string and array types
- Additional fields for 'additional_kwargs' and 'response_metadata'
- Type field included
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the complete AIMessage schema definition
# Expected: Should find property definitions including 'content' and other message fields
rg -A 20 "AIMessage:\n.*title: AIMessage" src/libs/LangSmith/openapi.yaml
Length of output: 267
Script:
#!/bin/bash
# Description: Verify the complete AIMessage schema definition using multiline mode
# Expected: Should find property definitions including 'content' and other message fields
rg -U -A 20 "AIMessage:\n\s+title: AIMessage" src/libs/LangSmith/openapi.yaml
Length of output: 594
10401-10403
: Verify AIMessageChunk relationship with AIMessage.
Since AIMessageChunk appears to be a streaming variant of AIMessage, consider whether they should share common schema definitions to ensure consistency.
Let's check the relationship between these schemas:
✅ Verification successful
AIMessageChunk correctly mirrors AIMessage schema structure
The verification shows that AIMessageChunk and AIMessage share identical schema structure with the same required fields and property definitions:
- Both require 'content' field
- Both have identical property definitions for content, additional_kwargs, response_metadata, and type
- Content field in both schemas supports either string or array of strings/objects
This consistency ensures proper handling of both complete messages and streaming chunks.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Compare AIMessage and AIMessageChunk schemas
# Expected: Should find similar structure with potential differences for streaming
rg -B 5 -A 20 "AIMessageChunk:\n.*title: AIMessageChunk" src/libs/LangSmith/openapi.yaml
Length of output: 282
Script:
#!/bin/bash
# Description: Compare AIMessage and AIMessageChunk schemas using multiline mode
# Expected: Should find similar structure with potential differences for streaming
rg -U -B 5 -A 20 'AIMessageChunk:.*\n.*title: AIMessageChunk' src/libs/LangSmith/openapi.yaml
# Also search for AIMessage schema for comparison
rg -U -B 5 -A 20 'AIMessage:.*\n.*title: AIMessage[^C]' src/libs/LangSmith/openapi.yaml
Length of output: 1794
@@ -7481,8 +7481,7 @@ paths: | |||
description: Successful Response | |||
content: | |||
application/json: | |||
schema: | |||
$ref: '#/components/schemas/PlaygroundPromptCanvasResponse' | |||
schema: { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty response schema should be defined explicitly.
An empty schema provides no validation or documentation value. This could lead to inconsistent API responses and poor developer experience.
Consider defining the expected response structure explicitly:
- schema: { }
+ schema:
+ type: object
+ description: "Successful response payload"
+ properties: {}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
schema: { } | |
schema: | |
type: object | |
description: "Successful response payload" | |
properties: {} |
Summary by CodeRabbit