memllm

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	OperationExtract = "extract"
	OperationDecide  = "decide"
	OperationCompact = "compact"
)

Operation names reported to Config.OnUsage.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements adapters.LLM using the Twilight AI SDK.

func New

func New(cfg Config) *Client

New creates a memory LLM client.

func (*Client) Compact

func (*Client) Decide

func (*Client) Extract

type Config

type Config struct {
	ModelID               string
	BaseURL               string
	APIKey                string `json:"-"`
	ClientType            string
	ChatCompletionsCompat string
	Timeout               time.Duration
	PromptCacheTTL        string
	// Logger, when set, records the failed calls that are made again.
	Logger *slog.Logger
	// OnUsage, when set, receives the token usage of every successful call.
	// Memory calls never produce a chat message, so this is the only place
	// their cost becomes visible.
	OnUsage func(ctx context.Context, operation string, usage sdk.Usage)
}

Config holds model resolution details for the memory LLM.

Jump to

Keyboard shortcuts

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