llm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLMClient

type LLMClient interface {
	InvokeModel(ctx context.Context, request LLMRequest) (*LLMResponse, error)
	InvokeModelWithRetry(ctx context.Context, request LLMRequest) (*LLMResponse, error)
}

LLMClient is an interface for invoking LLM models This allows mocking in tests without making real API calls

type LLMClientRegistry

type LLMClientRegistry struct {
	// contains filtered or unexported fields
}

LLMClientRegistry stores LLM clients organized by family and model ID

func NewLLMClientRegistry

func NewLLMClientRegistry(clients map[LLMFamily]map[string]LLMClient) *LLMClientRegistry

NewLLMClientRegistry creates a new registry with the provided clients clients map is structured as: family -> (modelID -> client)

func (*LLMClientRegistry) Get

func (r *LLMClientRegistry) Get(family LLMFamily, modelID string) (LLMClient, error)

Get retrieves a client by family and model ID

type LLMFamily

type LLMFamily string
const (
	FamilyAnthropic      LLMFamily = "anthropic"
	FamilyOpenAI         LLMFamily = "openai"
	FamilyOpenAIPlatform LLMFamily = "openai_platform"
	FamilyOllama         LLMFamily = "ollama"
)

type LLMRequest

type LLMRequest struct {
	Prompt      string
	MaxTokens   int
	Temperature float64
}

type LLMResponse

type LLMResponse struct {
	Content    string
	StopReason string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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