### Install Temporal Packages (Go) Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/temporal Install the required packages for Temporal integration using go get. ```bash go get github.com/braintrustdata/braintrust-sdk-go go get go.temporal.io/sdk go get go.temporal.io/contrib/opentelemetry ``` -------------------------------- ### Install Dependencies and Run Development Server Source: https://www.braintrust.dev/docs/cookbook/recipes/VercelAISDKTracing Install project dependencies using npm and start the development server. Ensure the application is accessible at http://localhost:3000. ```bash npm install npm run dev ``` -------------------------------- ### Install Braintrust .NET SDK with Setup Script Source: https://www.braintrust.dev/docs/sdks/csharp/quickstart Run this command in your project directory to install the Braintrust SDK and configure tracing using an assisted setup script. This script requires a local coding agent like Claude Code or Codex. ```bash curl -fsSL https://braintrust.dev/wizard/setup.sh | sh ``` -------------------------------- ### Install Braintrust Go SDK and LangChainGo Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/langchain Install the Braintrust Go SDK and LangChainGo packages using go get. ```bash go get github.com/braintrustdata/braintrust-sdk-go go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/langchaingo go get github.com/tmc/langchaingo ``` -------------------------------- ### Quick Start: Setup ADK Integration Source: https://www.braintrust.dev/docs/sdks/python/related/adk/0.2.4 Automatically patch all Google ADK components for tracing by calling `setup_adk` with your project name. This is the primary setup function for the deprecated package. ```python from braintrust_adk import setup_adk # Automatically patch all ADK components setup_adk(project_name="my-project") ``` -------------------------------- ### Install Braintrust Genkit SDK for Go Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/firebase-genkit Install the Braintrust Genkit integration using go get. ```bash go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/genkit ``` -------------------------------- ### Install Braintrust Go SDK and Set API Key Source: https://www.braintrust.dev/docs/sdks/go/versions/0.9.0 Install the main SDK package and set your Braintrust API key as an environment variable. Get your API key from the Braintrust website. ```bash go get github.com/braintrustdata/braintrust-sdk-go export BRAINTRUST_API_KEY="your-api-key" # Get from https://www.braintrust.dev/app/settings ``` -------------------------------- ### Render Examples with Score Fields Source: https://www.braintrust.dev/docs/cookbook/recipes/AISearch Renders examples using a provided template and arguments, including score fields. Ensure the `chevron` library is installed. ```python SCORE_FIELDS = ["avg_sql_score", "avg_factuality_score"] def render_example(example: Example, args: Dict[str, Any]) -> Example: render_optional = lambda template: (chevron.render(template, args, warn=True) if template is not None else None) return Example( input=render_optional(example.input), expected=FunctionCallOutput( match=example.expected.match, filter=render_optional(example.expected.filter), sort=render_optional(example.expected.sort), explanation=render_optional(example.expected.explanation), ), ) examples = [render_example(t, {"score_fields": SCORE_FIELDS}) for t in templates] ``` -------------------------------- ### Install Go Dependencies for Orchestrion and Braintrust Source: https://www.braintrust.dev/docs/instrument/trace-llm-calls Install the Braintrust SDK, the OpenAI tracing integration, and Orchestrion using `go get`. ```bash go get github.com/braintrustdata/braintrust-sdk-go go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/openai go get github.com/openai/openai-go go install github.com/DataDog/orchestrion@latest ``` -------------------------------- ### Set up Braintrust Coding Agents Source: https://www.braintrust.dev/docs/reference/cli/quickstart Use `bt setup` to handle authentication, API key creation, and optionally install Braintrust configuration files for your coding agent. It detects project language, installs the correct SDK, instruments LLM clients, and verifies your app. ```bash bt setup # Interactive wizard with the minimal amount of questions ``` ```bash bt setup -i # Interactive wizard with all the options ``` ```bash bt setup --project 'project-name' --api-key BRAINTRUST_API_KEY --agent codex ``` -------------------------------- ### Install Braintrust Eino Integration Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/cloudwego-eino Install the Braintrust SDK for Go with Eino integration using the go get command. This is the first step to enable tracing. ```bash go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/cloudwego/eino ``` -------------------------------- ### Install Braintrust and google-adk with uv Source: https://www.braintrust.dev/docs/integrations/agent-frameworks/google Install the necessary Python packages using the `uv` package installer. ```bash uv add braintrust google-adk ``` -------------------------------- ### Install All Integrations at Once Source: https://www.braintrust.dev/docs/sdks/go/migrations/v0-3-to-v0-4 Install all available trace/contrib integration modules, including the new LangChainGo integration, using the `all` meta-module. ```bash go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/all@v0.4.0 go mod tidy ``` -------------------------------- ### Get Span Parent Object Source: https://www.braintrust.dev/docs/sdks/typescript/versions/latest Internal function to get the parent object for starting a span. ```APIDOC ## Get Span Parent Object ### Description Mainly for internal use. Returns the parent object for starting a span in a global context. It applies precedence in the following order: current span > propagated parent string > experiment > logger. ### Parameters #### options - **parent** (string) - Optional. The parent span identifier. ``` -------------------------------- ### After Upgrade: All Integrations Explicitly Source: https://www.braintrust.dev/docs/sdks/go/changelog Shows how to opt into all integrations explicitly after the upgrade by using the 'all' meta-module. ```go go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/all ``` -------------------------------- ### Create Dataset and Insert Records with Go SDK Source: https://www.braintrust.dev/docs/annotate/datasets/create This example demonstrates initializing an API client, creating a project and dataset, and then inserting records using the lower-level Go SDK methods. ```go package main import ( "context" "fmt" "log" "os" "github.com/braintrustdata/braintrust-sdk-go/api" "github.com/braintrustdata/braintrust-sdk-go/api/datasets" "github.com/braintrustdata/braintrust-sdk-go/api/projects" ) func main() { ctx := context.Background() // Initialize API client client := api.NewClient(os.Getenv("BRAINTRUST_API_KEY")) // Get or create project project, err := client.Projects().Create(ctx, projects.CreateParams{ Name: "My App", }) if err != nil { log.Fatal(err) } // Create dataset dataset, err := client.Datasets().Create(ctx, datasets.CreateParams{ ProjectID: project.ID, Name: "Customer Support", }) if err != nil { log.Fatal(err) } // Insert records with input, expected output, and metadata events := []datasets.Event{ { Input: map[string]interface{}{ "question": "How do I reset my password?", }, Expected: map[string]interface{}{ "answer": "Click 'Forgot Password' on the login page.", }, Metadata: map[string]interface{}{ "category": "authentication", "difficulty": "easy", }, }, { Input: map[string]interface{}{ "question": "What's your refund policy?", }, Expected: map[string]interface{}{ "answer": "Full refunds within 30 days of purchase.", }, Metadata: map[string]interface{}{ "category": "billing", "difficulty": "easy", }, }, { Input: map[string]interface{}{ "question": "How do I integrate your API with NextJS?", }, Expected: map[string]interface{}{ "answer": "Install the SDK and use our React hooks.", }, Metadata: map[string]interface{}{ "category": "technical", "difficulty": "medium", }, }, } err = client.Datasets().InsertEvents(ctx, dataset.ID, events) if err != nil { log.Fatal(err) } fmt.Println("Dataset created with 3 records") } ``` -------------------------------- ### Install Strands Agent and Braintrust Packages Source: https://www.braintrust.dev/docs/integrations/agent-frameworks/strands-agent Install the necessary packages for Strands agents and Braintrust. This example uses pnpm. ```bash pnpm add braintrust @strands-agents/sdk openai ``` -------------------------------- ### Clone Repo and Install Dependencies Source: https://www.braintrust.dev/docs/cookbook/recipes/ToolRAG Clone the braintrust-cookbook repository and install the necessary npm dependencies for the Tool RAG example. ```bash git clone https://github.com/braintrustdata/braintrust-cookbook.git cd braintrust-cookbook/examples/ToolRAG/tool-rag npm install ``` -------------------------------- ### Bootstrap Example App with create-next-app Source: https://www.braintrust.dev/docs/cookbook/recipes/OTEL-logging Use create-next-app to bootstrap the Vercel AI SDK preview roundtrips example. This command initializes a new Next.js project with the specified example. ```bash npx create-next-app --example https://github.com/vercel-labs/ai-sdk-preview-roundtrips ai-sdk-preview-roundtrips-example ``` -------------------------------- ### Create Project with CLI Source: https://www.braintrust.dev/docs/admin/projects Use the `bt` CLI to create a new project. ```bash bt projects create my-project ``` -------------------------------- ### Install Dependencies Source: https://www.braintrust.dev/docs/cookbook/recipes/ClassifyingNewsArticles Install the necessary Python libraries for Braintrust, OpenAI, datasets, and autoevals. This is a prerequisite for running the classification examples. ```python %pip install -U braintrust openai datasets autoevals ``` -------------------------------- ### Create Next.js App with Vercel AI SDK Tracing Example Source: https://www.braintrust.dev/docs/cookbook/recipes/VercelAISDKTracing Use npx to download a complete weather application example locally. This command sets up a Next.js project pre-configured for Vercel AI SDK tracing. ```bash npx create-next-app@latest --example https://github.com/braintrustdata/braintrust-cookbook/tree/main/examples/VercelAISDKTracing/complete-weather-app vercel-ai-sdk-tracing && cd vercel-ai-sdk-tracing ``` -------------------------------- ### Run Setup Script for Project Configuration Source: https://www.braintrust.dev/docs/integrations/developer-tools/claude-code Execute the setup script provided by the plugin to interactively configure a project directory for Braintrust tracing. ```bash ~/.claude/plugins/marketplaces/braintrust-claude-plugin/plugins/trace-claude-code/setup.sh ``` -------------------------------- ### Clone Repo and Install Dependencies Source: https://www.braintrust.dev/docs/cookbook/recipes/ToolOCR Clone the Braintrust cookbook repository, navigate to the ToolOCR example directory, and install project dependencies. ```bash git clone https://github.com/braintrustdata/braintrust-cookbook.git cd braintrust-cookbook/examples/ToolOCR/tool-ocr pip install ``` -------------------------------- ### Install Braintrust and Pytest Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/pytest Install Braintrust alongside pytest using pip. This is the initial setup step for using Braintrust with pytest. ```bash pip install braintrust pytest ``` -------------------------------- ### Run `bt setup` with CA Certificate Flag Source: https://www.braintrust.dev/docs/kb/cli-auth-fails-for-self-hosted-deployments-with-tls-errors Execute the `bt setup` command, providing your API key, agent identifier, and the path to your CA certificate bundle. This ensures secure communication when TLS is intercepted. ```bash bt setup --api-key "$BRAINTRUST_API_KEY" --agent --ca-cert "$BRAINTRUST_CA_CERT" ``` -------------------------------- ### Example Project Description with Custom Instructions Source: https://www.braintrust.dev/docs/kb/how-to-save-custom-instructions-for Use this example to structure your project description with custom instructions for Loop. It includes formatting for traceIDs, desired metrics, data grouping, timestamp format, and anomaly highlighting. ```text Project: Customer Support AI Assistant Custom Instructions for Loop: - When creating reports with traceIDs, format them as clickable URLs using this structure: https://app.braintrust.dev/project/[project_id]/traces/[trace_id] - Always include p50, p95, and p99 latency metrics in performance reports - Group feedback data by sentiment (positive, neutral, negative) by default - Use ISO 8601 format for all timestamps - Highlight any anomalies or significant changes in metrics compared to the previous period ``` -------------------------------- ### Clone Repository and Install Dependencies Source: https://www.braintrust.dev/docs/cookbook/recipes/FindingProductionIssues Clone the Braintrust cookbook repository and install the required Python packages for the customer support bot example. ```bash git clone https://github.com/braintrustdata/braintrust-cookbook.git cd braintrust-cookbook/examples/FindingProductionIssues/customer-support-bot pip install -r requirements.txt ``` -------------------------------- ### Before Upgrade: Single Dependency Source: https://www.braintrust.dev/docs/sdks/go/changelog Illustrates the previous dependency structure where a single 'go get' command pulled in all integrations transitively. ```go go get github.com/braintrustdata/braintrust-sdk-go ``` -------------------------------- ### Install Braintrust and Pydantic AI Source: https://www.braintrust.dev/docs/integrations/agent-frameworks/pydantic-ai Install the necessary libraries using pip. This is the initial setup step for using Braintrust with Pydantic AI. ```bash pip install braintrust pydantic-ai ``` -------------------------------- ### Log User Feedback to Dataset (Python) Source: https://www.braintrust.dev/docs/annotate/datasets/create Initialize a dataset and log user examples with metadata in Python. This is useful for tracking user feedback and creating datasets from application interactions. ```python import braintrust class MyApplication: def init_app(self): self.dataset = braintrust.init_dataset(project="My App", name="logs") def log_user_example(self, input, expected, user_id, thumbs_up): if self.dataset: self.dataset.insert( input=input, expected=expected, metadata={"user_id": user_id, "thumbs_up": thumbs_up}, ) ``` -------------------------------- ### Clone Repo and Install Dependencies Source: https://www.braintrust.dev/docs/cookbook/recipes/Realtime Clone the Braintrust cookbook repository, navigate to the realtime-rag example directory, and install project dependencies using npm. ```bash git clone https://github.com/braintrustdata/braintrust-cookbook.git cd braintrust-cookbook/examples/Realtime/realtime-rag npm install ``` -------------------------------- ### Clone Cookbook and Install Dependencies Source: https://www.braintrust.dev/docs/cookbook/recipes/HuggingFaceAgentTraces Clone the Braintrust cookbook repository and install the necessary Python dependencies for the Hugging Face agent traces example. ```bash git clone https://github.com/braintrustdata/braintrust-cookbook.git cd braintrust-cookbook/examples/HuggingFaceAgentTraces pip install -r requirements.txt ``` -------------------------------- ### Install Instructor, Braintrust, and OpenAI SDK Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/instructor Install the necessary Python packages for Instructor, Braintrust, and OpenAI integration. ```bash pip install braintrust instructor openai ``` -------------------------------- ### Install Mastra and Braintrust Exporter Source: https://www.braintrust.dev/docs/integrations/agent-frameworks/mastra Install the necessary Mastra packages along with the Braintrust exporter and the Braintrust SDK. This setup is required to enable observability. ```bash # pnpm pnpm add @mastra/core @mastra/braintrust @mastra/observability braintrust # npm npm install @mastra/core @mastra/braintrust @mastra/observability braintrust ``` -------------------------------- ### Initialize environment and libraries Source: https://www.braintrust.dev/docs/cookbook/recipes/EvalionVoiceAgentEval Import required libraries and configure API credentials from environment variables. ```python import os import asyncio import json import time import uuid from typing import Any, Dict, List, Optional import httpx import nest_asyncio from braintrust import init_dataset, EvalAsync, Score # Uncomment to hardcode your API keys # os.environ["BRAINTRUST_API_KEY"] = "YOUR_BRAINTRUST_API_KEY" # os.environ["EVALION_API_TOKEN"] = "YOUR_EVALION_API_TOKEN" # os.environ["EVALION_PROJECT_ID"] = "YOUR_EVALION_PROJECT_ID" # os.environ["EVALION_PERSONA_ID"] = "YOUR_EVALION_PERSONA_ID" BRAINTRUST_API_KEY = os.getenv("BRAINTRUST_API_KEY", "") EVALION_API_TOKEN = os.getenv("EVALION_API_TOKEN", "") EVALION_PROJECT_ID = os.getenv("EVALION_PROJECT_ID", "") EVALION_PERSONA_ID = os.getenv("EVALION_PERSONA_ID", "") nest_asyncio.apply() ``` -------------------------------- ### Install Additional Go Tracing Integrations Source: https://www.braintrust.dev/docs/instrument/trace-llm-calls Install specific Braintrust tracing integrations for other providers or use the `all` meta-module to install all available integrations. ```bash go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/anthropic go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/bedrockruntime go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/genai go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/genkit go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/adk go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/cloudwego/eino go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/langchaingo go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/github.com/sashabaranov/go-openai ``` ```bash go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/all ``` -------------------------------- ### Verify Build Setup Source: https://www.braintrust.dev/docs/sdks/typescript/migrations/v1-to-v2 Run the project build command to ensure the migration was successful and check for Zod-related type errors. ```bash npm run build ``` -------------------------------- ### Run Test Setup API Source: https://www.braintrust.dev/docs/cookbook/recipes/EvalionVoiceAgentEval Initiates the preparation and execution of a test setup. ```APIDOC ## POST /test-setup-runs/{test_setup_run_id}/run ### Description Prepares and runs a test setup. This is a two-step process: first, the setup is prepared, and then it is executed. The endpoint returns the test setup run ID. ### Method POST ### Endpoint /test-setup-runs/{test_setup_run_id}/run ### Parameters #### Path Parameters - **test_setup_run_id** (string) - Required - The ID of the test setup run. #### Request Body - **project_id** (string) - Required - The ID of the project for which the test setup is being run. ### Response #### Success Response (200) - **test_setup_run_id** (string) - The ID of the test setup run. #### Response Example ```json { "test_setup_run_id": "tsrun_789" } ``` ``` -------------------------------- ### After Upgrade: Separate Dependencies Source: https://www.braintrust.dev/docs/sdks/go/changelog Demonstrates the new dependency structure after the upgrade, requiring separate 'go get' commands for the root SDK and specific integrations. ```go go get github.com/braintrustdata/braintrust-sdk-go go get github.com/braintrustdata/braintrust-sdk-go/trace/contrib/openai ``` -------------------------------- ### Setup Agent Skills Source: https://www.braintrust.dev/docs/reference/cli/setup Writes agent-specific skill files to help your agent use Braintrust. Use `--local` for agent-specific installs or `--global` for broader application. Specify the agent and workflow for targeted setup. ```bash bt setup skills --local --agent claude --workflow evaluate ``` ```bash bt setup skills --global --agent codex --agent cursor ``` -------------------------------- ### Braintrust.Get Source: https://www.braintrust.dev/docs/sdks/csharp/api-reference Gets the global Braintrust instance, creating it on the first call. This is the entry point to the SDK for configuration and OpenTelemetry pipeline setup. ```APIDOC ## Braintrust.Get ### Description Gets the global `Braintrust` instance, creating it on the first call and returning that same instance afterward. This is your entry point to the SDK: it reads configuration and sets up the OpenTelemetry pipeline that exports spans to Braintrust. Call `Get()` with no arguments to configure from environment variables, which is the most common setup. To configure it in code, build a `BraintrustConfig` and pass it to `Get(config)`. ### Method `Get()` ### Overloads * **`Get()`**: reads `BraintrustConfig.FromEnvironment()` and auto-manages OpenTelemetry. * **`Get(BraintrustConfig config, bool autoManageOpenTelemetry = true)`**: uses the supplied config. Set `autoManageOpenTelemetry` to `false` to attach Braintrust to an OpenTelemetry pipeline you manage yourself. * **`Of(BraintrustConfig config, bool autoManageOpenTelemetry = true)`**: creates a new, non-global instance. ### Returns `Braintrust` ``` -------------------------------- ### Run LangChainGo Tracing Example Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/langchain Execute the Go application to generate traces for LangChainGo LLM interactions. This command assumes the Go file is saved as trace-langchain.go. ```bash go run trace-langchain.go ``` -------------------------------- ### Run LangSmith Evaluation Redirected to Braintrust Source: https://www.braintrust.dev/docs/integrations/sdk-integrations/langsmith Execute evaluations using LangSmith's `client.evaluate()` method, which is automatically redirected to Braintrust due to the prior setup. This example demonstrates creating a dataset, adding examples, and running the evaluation with custom evaluators. ```python import os # Setup Braintrust wrapper BEFORE importing from langsmith from braintrust.wrappers.langsmith_wrapper import setup_langsmith setup_langsmith( project_name="langsmith-integration", api_key=os.environ.get("BRAINTRUST_API_KEY"), ) # Now import and use LangSmith as usual - these are patched to use Braintrust from langsmith import Client, traceable # Define a target function (the function being evaluated) # LangSmith requires the parameter to be named 'inputs' (or 'attachments'/'metadata') def multiply(inputs: dict, **kwargs) -> int: """Multiply two numbers. Args: inputs: Dictionary with 'x' and 'y' keys **kwargs: Additional arguments (e.g., langsmith_extra from LangSmith) """ return inputs["x"] * inputs["y"] # Define LangSmith-style evaluators # LangSmith evaluators use signature: (inputs, outputs, reference_outputs) -> bool | dict # When target returns a plain value, LangSmith wraps it as {"output": value} def exact_match_evaluator(inputs: dict, outputs: dict, reference_outputs: dict) -> dict: """ LangSmith-style evaluator that checks for exact match. """ expected = reference_outputs["output"] actual = outputs["output"] return { "key": "exact_match", "score": 1.0 if actual == expected else 0.0, } def range_evaluator(inputs: dict, outputs: dict, reference_outputs: dict) -> dict: """ LangSmith-style evaluator that checks if result is in expected range. """ actual = outputs["output"] expected = reference_outputs["output"] # Check if within 10% of expected if expected == 0: score = 1.0 if actual == 0 else 0.0 else: diff = abs(actual - expected) / abs(expected) score = 1.0 if diff <= 0.1 else 0.0 return { "key": "within_range", "score": score, "metadata": {"actual": actual, "expected": expected}, } def main(): print("LangSmith to Braintrust Evaluation Example") print("=" * 50) print() # Create a LangSmith client (patched to use Braintrust) client = Client() # Create a dataset in LangSmith (proper LangSmith API usage) dataset_name = "multiply-dataset-example" # Try to get or create the dataset try: dataset = client.read_dataset(dataset_name=dataset_name) print(f"Using existing dataset: {dataset_name}") except Exception: # Create new dataset if it doesn't exist dataset = client.create_dataset(dataset_name=dataset_name, description="Multiplication test dataset") print(f"Created new dataset: {dataset_name}") # Create examples in the dataset (proper LangSmith API) client.create_examples( dataset_id=dataset.id, examples=[ {"inputs": {"x": 2, "y": 3}, "outputs": {"output": 6}}, {"inputs": {"x": 5, "y": 5}, "outputs": {"output": 25}}, {"inputs": {"x": 10, "y": 0}, "outputs": {"output": 0}}, {"inputs": {"x": 7, "y": 8}, "outputs": {"output": 56}}, ], ) print(f"Created {4} examples in dataset") print() print("Running evaluation...") print() # Run evaluation using LangSmith's API (redirects to Braintrust) # Pass the dataset name - this is valid LangSmith API usage client.evaluate( multiply, # Target function data=dataset_name, # Dataset name (valid LangSmith API) evaluators=[exact_match_evaluator, range_evaluator], experiment_prefix="multiply-test", description="Testing multiplication function", metadata={"version": "1.0", "migrated_from": "langsmith"}, ) print() print("=" * 50) print("✓ Evaluation completed!") print("Check Braintrust to see the experiment results.") if __name__ == "__main__": main() ``` -------------------------------- ### Initialize OpenAI Client and Create Fine-Tuning File Source: https://www.braintrust.dev/docs/cookbook/recipes/AISearch Configures the OpenAI client and uploads training data as a file for fine-tuning. ```python sync_client = openai.OpenAI( api_key=os.environ.get("OPENAI_API_KEY", ""), base_url="https://api.openai.com/v1", ) file_string = "\n".join(json.dumps(messages) for messages in all_expected_messages) file = sync_client.files.create( file=io.BytesIO(file_string.encode()), purpose="fine-tune" ) ``` -------------------------------- ### Install Go SDK Source: https://www.braintrust.dev/docs/sdks/go/install-and-instrument Add the Braintrust Go SDK to your project using the go get command. Requires Go 1.25 or later. ```go go get github.com/braintrustdata/braintrust-sdk-go ``` -------------------------------- ### List and View Projects using CLI Source: https://www.braintrust.dev/docs/admin/projects Use the `bt` CLI to list all projects or view details for a specific project. `bt projects view` opens the project in your browser. ```bash bt projects list bt projects view my-project ``` -------------------------------- ### Start a Claude Code Session Source: https://www.braintrust.dev/docs/integrations/developer-tools/claude-code Initiate a Claude Code session from the command line. The installed plugin will automatically begin tracing the session. ```bash claude ``` -------------------------------- ### Example Release Notes Output Source: https://www.braintrust.dev/docs/cookbook/recipes/ReleaseNotes An example of the markdown-formatted release notes generated by the AI, summarizing various commits and noting version bumps. ```markdown Release Notes: - Show --verbose warning at the end of the error list (#50): Users were reporting that the `--verbose` flag is lost if it's at the beginning of the list of errors. This change simply prints the clarification at the end (and adds it to python). - Small fixes (#51): - Change built-in examples to use Eval framework. - Use `evaluator` instead of `_evals[evalName]` to access metadata. The latter is not set if you're running Evals directly in a script. - Python eval framework: parallelize non-async components. (#53): Fixes BRA-661. Please note that there were multiple version bumps and autoevals bumps. ``` -------------------------------- ### Check Current Helm Chart Version Source: https://www.braintrust.dev/docs/admin/self-hosting/upgrade/v2 Use this command to list installed Helm charts in the 'braintrust' namespace to determine your starting point for the upgrade. ```bash helm list -n braintrust ``` -------------------------------- ### init Source: https://www.braintrust.dev/docs/sdks/typescript/versions/latest Logs in and initializes a new experiment in a specified project. If the project does not exist, it will be created. ```APIDOC ## init ### Description Logs in and initializes a new experiment in a specified project. If the project does not exist, it will be created. ### Method Not applicable (SDK function) ### Endpoint Not applicable (SDK function) ### Parameters #### Options - **project** (string) - Required - The project to initialize the experiment in. - **apiKey** (string) - Optional - The API key to use. Defaults to `BRAINTRUST_API_KEY` environment variable or `.env.braintrust` file. - **appUrl** (string) - Optional - The URL of the Braintrust App. Defaults to `https://www.braintrust.dev`. - **debugLogLevel** (false | DebugLogLevel) - Optional - Controls internal Braintrust SDK troubleshooting output. Can be set to `"error"`, `"warn"`, `"info"`, or `"debug"`. Defaults to silent unless `BRAINTRUST_DEBUG_LOG_LEVEL` is set. - **disableSpanCache** (boolean) - Optional - If true, disables the local span cache. Defaults to false. - **fetch** (Object) - Optional - A custom fetch implementation to use. - **noExitFlush** (boolean) - Optional - If true, the SDK will not install an event handler to flush pending writes on the `beforeExit` event. Defaults to false. - **onFlushError** (Object) - Optional - A function to call if there’s an error in the background flusher. - **orgName** (string) - Optional - The name of a specific organization to connect to. - **forceLogin** (boolean) - Optional - Forces login. - **baseExperiment** (string) - Optional - The base experiment to use. - **baseExperimentId** (string) - Optional - The ID of the base experiment to use. - **dataset** (AnyDataset | DatasetRef) - Optional - The dataset to associate with the experiment. - **description** (string) - Optional - A description for the experiment. - **experiment** (string) - Optional - The name of the experiment. - **gitMetadataSettings** (GitMetadataSettings) - Optional - Settings for Git metadata. - **isPublic** (boolean) - Optional - Whether the experiment is public. - **metadata** (Record) - Optional - Metadata for the experiment. - **parameters** (ParametersRef | RemoteEvalParameters) - Optional - Parameters for the experiment. - **projectId** (string) - Optional - The ID of the project. - **repoInfo** (RepoInfo) - Optional - Repository information. - **setCurrent** (boolean) - Optional - Whether to set this experiment as the current one. - **state** (BraintrustState) - Optional - The state of the experiment. - **tags** (string[]) - Optional - Tags for the experiment. - **update** (boolean) - Optional - Whether to update an existing experiment. ```