llm

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Complete(ctx context.Context, messages []Message) (string, error)
}

Client is the common interface all LLM provider adapters implement.

func New

func New(cfg Config) (Client, error)

New returns a Client for the provider named in cfg.Provider.

type Config

type Config struct {
	Provider  string // "openai" | "anthropic" | "ollama"
	APIKey    string
	Model     string
	BaseURL   string // required for ollama; overrides default for openai/anthropic
	MaxTokens int
}

Config holds the provider selection and all provider-specific credentials.

type Message

type Message struct {
	Role    string
	Content string
}

Message is a single chat message with a role and content.

Jump to

Keyboard shortcuts

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