Documentation
¶
Overview ¶
Package providers is a shared helper used by the runnable examples to pick an LLM provider from the environment.
The precedence order — OpenAI → Anthropic → Gemini → Azure OpenAI → Vertex AI → AWS Bedrock → Mistral → Ollama → OpenAI-compatible — is arbitrary; it simply lets an example script run with whatever credentials the user happens to have exported. Every example wired through Pick automatically gains support for the full provider matrix.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnvHint ¶
func EnvHint() string
EnvHint returns the multi-line message to print when no provider is configured. Consistent across examples so users see the same option set.
func Pick ¶
Pick returns the first configured provider from the environment along with its human-readable name, or (nil, "") if nothing is configured.
Recognized env vars (checked in order):
OPENAI_API_KEY → OpenAI ANTHROPIC_API_KEY → Anthropic GEMINI_API_KEY → Google Gemini (AI Studio) AZURE_OPENAI_API_KEY + AZURE_OPENAI_ENDPOINT + AZURE_OPENAI_DEPLOYMENT → Azure OpenAI GOOGLE_CLOUD_PROJECT + GOOGLE_ACCESS_TOKEN → Google Cloud Vertex AI AWS_REGION + AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY → AWS Bedrock MISTRAL_API_KEY → Mistral OLLAMA_HOST → Ollama (local) OPENAI_COMPATIBLE_BASE_URL + OPENAI_COMPATIBLE_MODEL → any OpenAI-compatible endpoint
Types ¶
This section is empty.