Documentation
¶
Overview ¶
Package factory constructs llm.Model instances for the supported providers. main.go uses this package; all other packages depend only on llm.Model.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context, provider, modelName, apiKey, baseURL string, options map[string]any) (llm.Model, error)
New constructs a Model for the given provider, model name, and API key. baseURL overrides the provider's default API endpoint; pass an empty string to use the official endpoint. This is only honoured by the OpenAI provider, allowing callers to target OpenAI-compatible services (e.g. Ollama). The returned model automatically retries transient errors with exponential back-off using llm.DefaultRetryAttempts and llm.DefaultRetryBaseDelay.
Types ¶
Click to show internal directories.
Click to hide internal directories.