Changelog
View SourceAll notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
0.3.0 - 2025-01-12
Added
BRAINTRUST_API_URLenvironment variable support for self-hosted deployments (#28)- Allows configuring
base_urlvia environment variable, similar toBRAINTRUST_API_KEY - Configuration precedence: runtime opts > process config > app config > env var > default
- Allows configuring
0.2.0 - 2025-01-10
Added
Braintrust.LangChainCallbacksmodule for LangChain integration (#25)LangChainCallbacks.handler/1- Basic callback handler for logging LLM interactionsLangChainCallbacks.streaming_handler/1- Streaming-aware handler with TTFT metrics- Automatic logging to Braintrust with input/output/metrics/metadata
- OpenAI message format support for "Try prompt" UI button
- Token usage tracking (input_tokens, output_tokens, total_tokens)
- Time-to-first-token and streaming duration metrics
- Error handling and retry tracking callbacks
- Tool execution logging support
- LangChain as optional dependency (
:langchain ~> 0.4) - 680+ lines of comprehensive tests for LangChain callbacks
- LangChain integration documentation in README with usage examples
Fixed
- Documentation warnings for
Braintrust.Functionreferences in CHANGELOG
0.1.0 - 2025-01-10
Added
- Cursor-based pagination with Stream support (#9)
Braintrust.Paginationmodule for lazy and eager paginationClient.get_stream/3for streaming paginated API resultsClient.get_all/3for eager loading of all paginated results- Duplicate filtering support via
:unique_byoption Braintrust.Projectresource module with full CRUD operations (#11)Project.list/1for listing all projects with filtering optionsProject.stream/1for memory-efficient lazy pagination through projectsProject.get/2for retrieving a project by IDProject.create/2for creating new projects (idempotent)Project.update/3for updating project propertiesProject.delete/2for soft-deleting projects- DateTime parsing for
created_atanddeleted_atfields - Comprehensive test suite with 15 tests covering all operations
Braintrust.Experimentmodule with full CRUD operations (#13)Experiment.list/1,Experiment.stream/1- List experiments with paginationExperiment.get/2- Get experiment by IDExperiment.create/2- Create new experimentExperiment.update/3- Update experimentExperiment.delete/2- Delete experiment (soft delete)
- Experiment-specific operations (#13)
Experiment.insert/3- Insert evaluation eventsExperiment.fetch/3,Experiment.fetch_stream/3- Fetch events with paginationExperiment.feedback/3- Add scores and comments to eventsExperiment.summarize/2- Get aggregated experiment metrics
- Internal Resource helper module to eliminate code duplication between resource modules
- Shared test helpers for pagination testing
Braintrust.Datasetmodule with full CRUD operations (#14)Dataset.list/1,Dataset.stream/1- List datasets with paginationDataset.get/2- Get dataset by IDDataset.create/2- Create new dataset (idempotent)Dataset.update/3- Update datasetDataset.delete/2- Delete dataset (soft delete)
- Dataset-specific operations (#14)
Dataset.insert/3- Insert test records with versioningDataset.fetch/3,Dataset.fetch_stream/3- Fetch records with paginationDataset.feedback/3- Add scores and comments to recordsDataset.summarize/2- Get dataset summary statistics
- 24 comprehensive tests for Dataset module
dataset_namefilter support in Resource module- Refactored test helpers (
empty_events_stub/1,error_on_first_page_stub/1) to eliminate code duplication Braintrust.Spanstruct for representing traces in Braintrust (#15)- Core fields:
id,span_id,root_span_id,span_parentsfor DAG trace structure - Data fields:
input,output,expected,error - Scoring fields:
scores(normalized 0-1),metrics(raw numbers) - Metadata fields:
metadata,tags,created_at Span.to_map/1for converting to API-ready maps (removes nil values)
- Core fields:
Braintrust.Logmodule for production observability (#15)Log.insert/3- Insert production logs/traces (write-only API)- Accepts both raw maps and
%Braintrust.Span{}structs - Supports batching multiple events in a single request
- OpenAI message format recommended for best UI integration
- Enhanced
Experiment.insert/3to accept%Braintrust.Span{}structs (#15) - Enhanced
Dataset.insert/3to accept%Braintrust.Span{}structs (#15) - 23 comprehensive tests for Span and Log modules
- 4 additional tests for Span support in Experiment and Dataset modules
Braintrust.Promptmodule with full CRUD operations (#16)Prompt.list/1,Prompt.stream/1- List prompts with paginationPrompt.get/2- Get prompt by ID with version/xact_id supportPrompt.create/2- Create new prompt (idempotent)Prompt.update/3- Update prompt (creates new version)Prompt.delete/2- Delete prompt (soft delete)
- Version-controlled prompt management with template variables (#16)
- Support for OpenAI-compatible message format with
{{variable}}syntax prompt_nameandslugfilter parameters in Resource module- 21 comprehensive tests for Prompt module
Braintrust.Functionmodule with full CRUD operations (#17)Braintrust.Function.list/1,Braintrust.Function.stream/1- List functions with pagination and filteringBraintrust.Function.get/2- Get function by ID with version/xact_id supportBraintrust.Function.create/2- Create new function (idempotent)Braintrust.Function.update/3- Update function (may create new version)Braintrust.Function.delete/2- Delete function (soft delete)
- Support for tools, scorers, and prompt-type functions (#17)
- Polymorphic
function_datafield for different function implementations function_nameandfunction_typefilter parameters in Resource module- 21 comprehensive tests for Function module
Changed
- Updated README to reflect Projects API as implemented
- Increased coverage requirement from 80% to 90%
- Updated module documentation to remove "(coming soon)" from Project resource
- Updated README with Experiments examples and API coverage table
- Refactored Project and Experiment modules to use shared Resource helpers
- Updated README with Datasets examples and marked as implemented in API coverage table
- Updated main Braintrust module documentation to reflect Dataset availability
- Updated README with Logs examples and marked as implemented in API coverage table
- Enhanced insert operations across Experiment and Dataset modules to accept Span structs while maintaining backward compatibility
- Updated README with comprehensive Prompts examples
- Updated main module documentation to reflect Prompt availability
- Marked Prompts as implemented in API coverage table
- Updated README with Functions examples and usage patterns
- Marked Functions as implemented in API coverage table
- Updated work-in-progress notice to reflect Functions availability
0.0.1 - 2025-01-07
Added
- Initial placeholder release to reserve package name on hex.pm
- Basic project structure