model

package
v0.0.0-...-78ba06b Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 27 Imported by: ? 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 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 sandbox.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