Help us shape the future of Go! Take the 2026 Go Developer Survey

usage

package
v0.3.12 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package usage adds the headers LangSmith uses to count CLI usage: the CLI version, the command name as typed (never its arguments), and the coding agent running the CLI, if any.

Index

Constants

View Source
const (
	CommandHeader = "X-LangSmith-CLI-Command"
	AgentHeader   = "X-LangSmith-CLI-Agent"
)

Variables

This section is empty.

Functions

func Apply

func Apply(h http.Header)

Apply sets the usage headers on an outgoing LangSmith API request.

func Option

func Option() option.RequestOption

Option applies the usage headers to every request an SDK client sends.

func SetCommand

func SetCommand(cmd *cobra.Command)

SetCommand records the running command and detects the calling agent.

func SetVersion

func SetVersion(version string)

SetVersion sets the CLI version reported in the User-Agent.

func WrapDefaultTransport

func WrapDefaultTransport() (restore func())

WrapDefaultTransport tags requests sent through http.DefaultTransport, which the SDK uses by default, until restore is called. The SDK keeps a wrapped transport as-is, so the clone carries the SDK's response header timeout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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