model

package
v0.0.0-...-ef24e85 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 27 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 {
	Provider() string
	ProviderName() string
	ListModels() map[string]ModelMetadata
	NewModel(mdlCfg config.ModelConfig) (Model, error)
	NewState() State
}

func NewClient

func NewClient(clntCfg *config.ClientConfig) (Client, error)

type Model

type Model interface {
	Generate(ctx context.Context, st State, opts *Options) error
	SetTools(tools map[string]tool.Tool, sb *system.Sandbox) error
	ContextLimit() int
}

type ModelInfo

type ModelInfo struct {
	Name        string
	DisplayName string    // Optional
	Created     time.Time // Optional
}

type ModelMetadata

type ModelMetadata struct {
	Model        string
	Name         string
	Reasoning    bool
	ContextLimit int
	OutputLimit  int
	InputCost    float64
	OutputCost   float64
}

type Options

type Options struct {
	Verbose bool
	Trace   bool
}

type State

type State interface {
	SystemPrompt(s string)
	Prompt(s string)
	Len() int
	Step(n int) Step
	Clear()
	Usage() (int64, int64, int64) // input tokens, output tokens, contextTokens
	Cost() (float64, float64)     // input cost, output cost
}

type Step

type Step struct {
	Type    StepType
	Content string          // Prompt, ModelResponse, Thinking, and ToolOutput
	Name    string          // ToolCall and ToolOutput
	Input   json.RawMessage // ToolCall
}

type StepType

type StepType int
const (
	PromptStep StepType = iota
	ModelResponseStep
	ThinkingStep
	ToolCallStep
	ToolOutputStep
)

func (StepType) String

func (st StepType) String() string

Jump to

Keyboard shortcuts

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