llm

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultMaxTokens = 1024

DefaultMaxTokens is used when MaxTokens is 0 and the provider requires it (e.g. Anthropic).

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMConfig

type LLMConfig struct {
	APIKey   string
	Model    string
	BaseURL  string
	Logger   log.Logger
	LogLevel string
}

func BuildConfig

func BuildConfig(opts ...Option) (*LLMConfig, error)

BuildConfig builds LLMConfig from options. Defaults when not set:

  • LogLevel: "error"
  • Logger: zap adapter

Sampling (Temperature, MaxTokens, TopP, TopK) is per-agent—use agent.WithTemperature etc.

type Option

type Option func(*LLMConfig)

func WithAPIKey

func WithAPIKey(apiKey string) Option

func WithBaseURL

func WithBaseURL(baseURL string) Option

func WithLogLevel

func WithLogLevel(level string) Option

func WithLogger

func WithLogger(logger log.Logger) Option

func WithModel

func WithModel(model string) Option

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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