πͺ’ Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.
TypeScript analyticsautogenevaluationlangchainlarge-language-modelsllama-indexllmllm-evaluationllm-observabilityllmopsmonitoringobservabilityopen-sourceopenaiplaygroundprompt-engineeringprompt-managementself-hostedycombinator
Score Interfaces
This directory contains all type definitions, schemas, and validation logic for Langfuse scores.
Structure
interfaces/
βββ api/ # API-specific schemas and validations
β βββ v1/ # Legacy API types (trace-focused)
β β βββ endpoints.ts # Endpoint types and schemas
β β βββ schemas.ts # Type definitions
β β βββ validation.ts # Validation logic
β βββ v2/ # Current API types (supports traces, sessions)
β β βββ endpoints.ts # Endpoint types and schemas
β β βββ schemas.ts # Type definitions
β β βββ validation.ts # Validation logic
β βββ shared.ts # Common schemas used across API versions
βββ application/ # Internal application logic
β βββ validation.ts # Validation functions for application layers
βββ ingestion/ # Types for data ingestion
β βββ validation.ts # Validation for ingestion endpoints
βββ ui/ # Simplified types for UI components
β βββ types.ts # UI-specific type definitions
βββ index.ts # Exports all interfaces
API Versioning
We have added a new v2 api and will continue to support the v1 api for the foreseeable future. POST and DELETE APIs will continue to support all score types (trace, session, dataset run) across v1 and v2.
For GET APIs:
- V1 API: Requires
traceId, ONLY supports trace-level scores - V2 API: Makes
traceIdoptional, addssessionIdanddatasetRunIdsupport, supports all score types (trace, session, run) - Both versions maintain compatibility for existing clients
Usage Guide
When building API endpoints:
- New endpoints: Use types from
api/v2/schemas.ts - Legacy compatibility: Use types from
api/v1/schemas.ts - Validation: Use validators from the corresponding
validation.tsfiles
When building UI components:
Use the simplified types from ui/types.ts which are optimized for frontend use:
import { ScoreSimplified, LastUserScore } from "../interfaces/ui/types";
When working with internal application logic:
Use the validation functions from application/validation.ts:
import {
validateDbScore,
filterAndValidateDbScoreList,
} from "../interfaces/application/validation";
Type Flow
Client β PostScoresBody β Validation β API response (APIScoreV2) β UI (ScoreSimplified or ScoreDomain)