llm

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package llm defines the provider seam for AI-Assisted onboarding. Provider is the plugin interface; Anthropic (Claude) is the default implementation and other providers can be registered behind the same interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Role Role
	Text string
}

Message is one turn in a conversation.

type Provider

type Provider interface {
	// Name identifies the provider, e.g. "anthropic".
	Name() string
	// Complete sends a system prompt plus a conversation and returns the
	// assistant's reply text.
	Complete(ctx context.Context, req Request) (string, error)
}

Provider is a minimal text-completion interface. It is intentionally small so new providers (OpenAI, local models) are cheap to add.

type Request

type Request struct {
	System    string
	Messages  []Message
	MaxTokens int
	Model     string
}

Request is a single completion request.

type Role

type Role string

Role is the author of a message.

const (
	RoleUser      Role = "user"
	RoleAssistant Role = "assistant"
)

Directories

Path Synopsis
Package anthropic provides an llm.Provider backed by Anthropic's Claude Messages API.
Package anthropic provides an llm.Provider backed by Anthropic's Claude Messages API.
Package ollama provides an llm.Provider backed by a local Ollama server's chat API.
Package ollama provides an llm.Provider backed by a local Ollama server's chat API.
Package openai provides an llm.Provider backed by OpenAI's Chat Completions API.
Package openai provides an llm.Provider backed by OpenAI's Chat Completions API.

Jump to

Keyboard shortcuts

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