ai

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRetryConfig = RetryConfig{
	MaxAttempts: 3,
	BaseDelay:   2 * time.Second,
	MaxDelay:    30 * time.Second,
}

DefaultRetryConfig is used for all AI provider calls.

Functions

func GenerateSlides

func GenerateSlides(cfg *config.Config, content *crawler.CollectedContent) (string, error)

GenerateSlides routes the slide generation request to the appropriate LLM provider based on the model name in the config. Accepts either *crawler.CollectedContent (structured) or a flat code string.

func RequiresAPIKey

func RequiresAPIKey(model string) bool

RequiresAPIKey returns true if the model needs a remote API key.

Types

type HTTPError

type HTTPError struct {
	StatusCode int
	Body       string
}

HTTPError wraps a non-2xx HTTP response so the retry logic can inspect the status code without string parsing.

func (*HTTPError) Error

func (e *HTTPError) Error() string

type RetryConfig

type RetryConfig struct {
	MaxAttempts int
	BaseDelay   time.Duration
	MaxDelay    time.Duration
}

RetryConfig controls retry behaviour for transient AI provider errors.

Jump to

Keyboard shortcuts

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