Skip to content

Conversation

@kevingosse
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings January 10, 2026 14:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR converts the Braintrust SDK from synchronous to asynchronous APIs, eliminating the sync-over-async anti-pattern and improving scalability. The changes include converting all API client methods to return Task<T>, updating the Eval framework to support async build and run operations, and migrating all tests and examples to use async/await patterns.

Changes:

  • Converted IBraintrustApiClient interface and BraintrustApiClient implementation to async methods, removing sync-over-async patterns
  • Refactored Eval<TInput, TOutput> to use async initialization in BuildAsync() and async execution in RunAsync()
  • Extracted ApiException to a separate file and moved MockBraintrustApiClient to its own test file for better organization

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/Braintrust.Sdk/Api/IBraintrustApiClient.cs Converted all method signatures to return Task for async operations
src/Braintrust.Sdk/Api/BraintrustApiClient.cs Removed sync-over-async anti-pattern, converted methods to proper async/await with ConfigureAwait(false)
src/Braintrust.Sdk/Api/ApiException.cs Extracted ApiException class to separate file for better organization
src/Braintrust.Sdk/Eval/Eval.cs Converted Build() to BuildAsync() and Run() to RunAsync(), moved async initialization from constructor to builder
src/Braintrust.Sdk/Braintrust.cs Renamed ProjectUri() to GetProjectUriAsync() and converted to async
tests/Braintrust.Sdk.Tests/Eval/MockBraintrustApiClient.cs Extracted mock client to separate file, converted to async methods
tests/Braintrust.Sdk.Tests/Eval/EvalTest.cs Updated tests to async, removed mock client definition
tests/Braintrust.Sdk.Tests/Api/BraintrustApiClientTest.cs Converted all test methods to async with proper async assertions
examples/SimpleOpenTelemetry/Program.cs Updated Main to async and converted GetProjectUriAsync() call
examples/OpenAIInstrumentation/Program.cs Updated GetProjectUriAsync() call
examples/EvalExample/Program.cs Updated Main to async and converted BuildAsync()/RunAsync() calls

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevingosse
Copy link
Contributor Author

Closed in favor of #10

@kevingosse kevingosse closed this Jan 12, 2026
@kevingosse kevingosse deleted the kgosse/async branch January 12, 2026 08:08
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