Documentation
¶
Index ¶
Constants ¶
const ( ConfigFileEnv = "LANGSMITH_CONFIG_FILE" DefaultAPIURL = "https://api.smith.langchain.com" )
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns the LangSmith CLI config path.
func MaskSecret ¶
MaskSecret returns a redacted value suitable for CLI output.
Types ¶
type Config ¶
type Config struct {
CurrentProfile string `json:"current_profile,omitempty"`
Profiles map[string]Profile `json:"profiles,omitempty"`
}
Config is the on-disk LangSmith CLI config.
func (*Config) ResolveProfile ¶
ResolveProfile returns the active profile by precedence.
func (*Config) ResolveProfileName ¶
ResolveProfileName returns the active profile name by precedence.
type OAuth ¶
type OAuth struct {
AccessToken string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
ExpiresAt string `json:"expires_at,omitempty"`
Issuer string `json:"issuer,omitempty"`
}
OAuth stores OAuth tokens written by `langsmith auth login`.
type Profile ¶
type Profile struct {
APIKey string `json:"api_key,omitempty"`
APIKeyEnv string `json:"api_key_env,omitempty"`
APIKeyCmd string `json:"api_key_cmd,omitempty"`
APIURL string `json:"api_url,omitempty"`
WorkspaceID string `json:"workspace_id,omitempty"`
OAuth OAuth `json:"oauth,omitempty"`
}
Profile represents one named LangSmith CLI profile.
Instead of storing the API key, a profile can name where it lives: APIKeyEnv is an environment variable and APIKeyCmd a shell command that prints the key. APIKey wins over APIKeyEnv, which wins over APIKeyCmd.
func (Profile) APIKeySource ¶ added in v0.3.9
APIKeySource describes where the profile's API key comes from, for display: "config", "$NAME" for an environment variable, or "$(command)".
func (Profile) AccessToken ¶
AccessToken returns the OAuth access token to use for bearer auth.
func (Profile) HasAPIKey ¶ added in v0.3.9
HasAPIKey reports whether the profile stores an API key or names where one lives.
func (Profile) ResolveAPIKey ¶ added in v0.3.9
ResolveAPIKey returns the profile's API key, reading api_key_env or running api_key_cmd when the key is not stored in the config.