llm

package
v0.1.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompleteOptions

type CompleteOptions struct {
	Temperature *float32
	MaxTokens   int
}

CompleteOptions controls per-request LLM parameters. A nil value uses provider-specific defaults.

type Provider

type Provider interface {
	Complete(ctx context.Context, system, prompt string, opts *CompleteOptions) (string, error)
}

Provider abstracts an LLM completion backend.

func NewProvider

func NewProvider(cfg ProviderConfig) (Provider, error)

NewProvider creates a Provider for the given configuration.

type ProviderConfig

type ProviderConfig struct {
	Name            ProviderName
	APIKey          string
	Model           string
	OllamaHost      string
	UseVertexAI     bool
	VertexRegion    string
	VertexProjectID string
}

ProviderConfig holds the configuration needed to construct a Provider.

type ProviderName

type ProviderName string

ProviderName identifies a supported LLM provider.

const (
	ProviderOpenAI    ProviderName = "openai"
	ProviderAnthropic ProviderName = "anthropic"
	ProviderOllama    ProviderName = "ollama"
)

Jump to

Keyboard shortcuts

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