feat(api): update API spec from langfuse/langfuse 25e6ad9 #1428
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Important
Update API spec to add input/output schema validation fields and refine metadata type in dataset and score request classes.
input_schemaandexpected_output_schematoDatasetindataset.pyfor input and output validation.input_schemaandexpected_output_schematoCreateDatasetRequestincreate_dataset_request.pyfor input and output validation.metadatatype totyping.Dict[str, typing.Any]inCreateScoreRequestincreate_score_request.pyfor more specific typing.This description was created by
for 1edfd8b. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Updated On: 2025-11-06 17:35:58 UTC
Greptile Summary
This PR adds JSON Schema validation support for datasets and improves type safety for score metadata.
Key Changes:
input_schemaandexpected_output_schemaoptional fields toDatasetandCreateDatasetRequestfor validating dataset item inputs and expected outputsallow_population_by_field_nameandpopulate_by_nameto pydantic Config inCreateDatasetRequestto support both snake_case and camelCase field namesmetadatatype inCreateScoreRequestfromtyping.Anytotyping.Dict[str, typing.Any]for better type safetyImpact:
Confidence Score: 5/5
Important Files Changed
File Analysis
input_schemaandexpected_output_schemafields for JSON Schema validationtyping.Anytotyping.Dict[str, typing.Any]Sequence Diagram
sequenceDiagram participant Client participant CreateDatasetRequest participant Dataset participant API Client->>CreateDatasetRequest: Create dataset with schemas Note over CreateDatasetRequest: inputSchema (optional)<br/>expectedOutputSchema (optional)<br/>name, description, metadata CreateDatasetRequest->>API: POST /datasets Note over API: Validate schema fields<br/>Apply to new & existing items API->>Dataset: Return dataset object Note over Dataset: Contains inputSchema<br/>expectedOutputSchema<br/>for validation Dataset->>Client: Dataset with schemas Client->>API: Create/Update dataset items Note over API: Validate items against<br/>inputSchema & expectedOutputSchema API->>Client: Validated items