providerdiag

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package providerdiag diagnoses provider credentials and endpoint settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthRequirements

func AuthRequirements(provider string, source string, baseURL string) (string, []string, bool)

AuthRequirements returns the auth env contract for a selected provider.

Types

type AuthDiagnostic

type AuthDiagnostic struct {
	SelectedProvider                 string   `json:"selected_provider"`
	RuntimeProviderSource            string   `json:"runtime_provider_source,omitempty"`
	RequiredAPIKeyEnv                string   `json:"required_api_key_env,omitempty"`
	RequiredAuthEnvs                 []string `json:"required_auth_envs,omitempty"`
	SelectedProviderAPIKeyPresent    bool     `json:"selected_provider_api_key_present"`
	SelectedProviderAuthTokenPresent bool     `json:"selected_provider_auth_token_present"`
	SelectedProviderAuthPresent      bool     `json:"selected_provider_auth_present"`
	LocalBaseURL                     bool     `json:"local_base_url,omitempty"`
	AuthOptional                     bool     `json:"auth_optional,omitempty"`
	AnthropicAPIKeyPresent           bool     `json:"anthropic_api_key_present"`
	AnthropicAuthTokenPresent        bool     `json:"anthropic_auth_token_present"`
	OpenAIAPIKeyPresent              bool     `json:"openai_api_key_present"`
	XAIAPIKeyPresent                 bool     `json:"xai_api_key_present"`
	DashScopeAPIKeyPresent           bool     `json:"dashscope_api_key_present"`
	OllamaHostPresent                bool     `json:"ollama_host_present"`
	EffectiveAuthSource              string   `json:"effective_auth_source"`
	HeadersSent                      []string `json:"headers_sent,omitempty"`
	BothAnthropicAuthEnvVarsPresent  bool     `json:"both_anthropic_auth_env_vars_present,omitempty"`
	SelectedProviderBothAuthPresent  bool     `json:"selected_provider_both_auth_present,omitempty"`
	Warning                          string   `json:"auth_warning,omitempty"`
	Hint                             string   `json:"auth_hint,omitempty"`
}

AuthDiagnostic reports provider auth preflight state without exposing secrets.

func AnalyzeAuth

func AnalyzeAuth(opts AuthOptions) AuthDiagnostic

AnalyzeAuth returns the effective auth state for the selected runtime provider.

func (AuthDiagnostic) Data

func (d AuthDiagnostic) Data() map[string]any

Data returns the legacy doctor data map plus newer auth-source fields.

type AuthOptions

type AuthOptions struct {
	Model                 string
	RuntimeProvider       string
	RuntimeProviderSource string
	BaseURL               string
	APIKey                string
	AuthToken             string
}

AuthOptions contains the redaction-safe inputs needed to diagnose provider auth.

Jump to

Keyboard shortcuts

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