internal/

directory
v0.0.0-...-7aeed6e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: Apache-2.0

README

Internal Examples

This directory contains comprehensive examples that test all features of the Braintrust Go SDK. These examples are primarily used for:

  • SDK development and validation - Ensuring all features work correctly
  • Regression testing - Catching breaking changes during development
  • Feature coverage - Demonstrating every SDK capability

Purpose

Unlike the customer-facing examples in the parent directory, these examples are not optimized for learning. They are "kitchen sink" examples that exercise many features at once to verify SDK functionality.

Examples

Provider Kitchen Sinks

Comprehensive examples testing all features for each AI provider:

  • anthropic/ - All Anthropic features (messages, tools, streaming, citations, thinking, vision)
  • openai-v1/ - All OpenAI v1 features (chat, streaming, tools, vision)
  • openai-v2/ - All OpenAI v2 features (Responses API, reasoning, conversations)
  • genai/ - All Gemini features (text, system instruction, multi-turn, thinking, streaming, functions, safety, JSON mode, multimodal)
  • genkit/ - Genkit generation with manual middleware, config, and streaming coverage
  • langchaingo/ - All LangChainGo features (simple, multi-turn, chains, tools, agents, retriever, streaming, system prompt, temperature, max tokens, prefill, stop sequences, long context, metadata)
Specialized Testing
  • span-origin/ - SDK and instrumentation provenance, explicit environment configuration, and preserved caller context.

  • workflow-eval/ - Durable workflow tasks/scorers, provider batching, polling, webhook completion, and Redis restart

  • langchaingo-anthropic/ - LangChainGo with Anthropic provider (uses forked langchaingo)

  • functions/ - Functions API usage (loading tasks/scorers with FunctionOpts)

  • braintrust-json/ - Braintrust API key discovery from environment or .braintrust.json

  • openapi/ - Direct use of the public generated openapi client. Run go run ./examples/internal/openapi offline, or add -live with BRAINTRUST_API_KEY set to list/get a project without modifying data. Add -automation-id "<id>" with -live to fetch an existing project automation. For opt-in CRUD lifecycles, see the public API client example.

  • span-customizers/ - Completed-span export redaction using ordered customizer hooks; run go run ./examples/internal/span-customizers/main.go from the repository root with BRAINTRUST_API_KEY set.

  • rewrite/ - Manual tracing and evaluator API testing

  • email-evals/ - Realistic eval example with complex scoring

  • eval-updates/ - Testing Update option for appending to experiments

  • eval-runner/ - Remote evals under bt eval --dev, with model and prompt parameters

  • temporal/ - Temporal workflow distributed tracing (worker + client)

For Learning

If you're learning the Braintrust SDK, start with the examples in the parent directory (../). Those examples are concise, focused, and designed for customer education.

Directories

Path Synopsis
Anthropic kitchen sink - tests all the Anthropic features with minimal code
Anthropic kitchen sink - tests all the Anthropic features with minimal code
AWS Bedrock Runtime kitchen sink - exercises the full Converse feature surface.
AWS Bedrock Runtime kitchen sink - exercises the full Converse feature surface.
cloudwego
eino command
Internal golden-test example for CloudWeGo Eino tracing.
Internal golden-test example for CloudWeGo Eino tracing.
This is a realistic eval example.
This is a realistic eval example.
This example demonstrates running Braintrust evals under the bt CLI, so the Braintrust playground can trigger them against code on your own machine.
This example demonstrates running Braintrust evals under the bt CLI, so the Braintrust playground can trigger them against code on your own machine.
This example demonstrates running each eval case multiple times with TrialCount.
This example demonstrates running each eval case multiple times with TrialCount.
This example demonstrates using the Update option to append results to an existing experiment.
This example demonstrates using the Update option to append results to an existing experiment.
Package main demonstrates a comprehensive "kitchen sink" example that combines as much Braintrust SDK functionality as possible into a single executable.
Package main demonstrates a comprehensive "kitchen sink" example that combines as much Braintrust SDK functionality as possible into a single executable.
Package main runs a heavy synthetic load test that exercises the Braintrust SDK's span pipeline (including the attachment processor / uploader) without requiring any real LLM API calls.
Package main runs a heavy synthetic load test that exercises the Braintrust SDK's span pipeline (including the attachment processor / uploader) without requiring any real LLM API calls.
This example builds a generated request offline, or reads through the public generated client with -live.
This example builds a generated request offline, or reads through the public generated client with -live.
Workflow evaluation with OpenAI batches, polling or externally verified webhooks, and optional Redis persistence across process restarts.
Workflow evaluation with OpenAI batches, polling or externally verified webhooks, and optional Redis persistence across process restarts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL