model

package
v0.0.0-...-8c5cae0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LLM

type LLM interface {
	Name() string
	Generate(context.Context, *Request) iter.Seq2[*Response, error]
}

LLM is the model abstraction used by the kernel.

type Message

type Message struct {
	Role         Role
	Text         string
	Reasoning    string
	ToolCalls    []ToolCall
	ToolResponse *ToolResponse
}

Message is a single turn element in model context.

type ReasoningConfig

type ReasoningConfig struct {
	// Enabled toggles reasoning mode when supported by provider.
	Enabled *bool
	// BudgetTokens limits provider thinking tokens when supported.
	BudgetTokens int
	// Effort is provider-specific reasoning effort hint, e.g. low|medium|high.
	Effort string
}

ReasoningConfig controls provider reasoning/thinking behavior.

type Request

type Request struct {
	Messages  []Message
	Tools     []ToolDefinition
	Stream    bool
	Reasoning ReasoningConfig
}

Request is a provider-agnostic model request.

type Response

type Response struct {
	Message      Message
	Partial      bool
	TurnComplete bool
	Usage        Usage
	Model        string
	Provider     string
}

Response is a provider-agnostic model response chunk.

type Role

type Role string

Role identifies message author type.

const (
	RoleSystem    Role = "system"
	RoleUser      Role = "user"
	RoleAssistant Role = "assistant"
	RoleTool      Role = "tool"
)

type ToolCall

type ToolCall struct {
	ID   string
	Name string
	Args map[string]any
	// ThoughtSignature carries provider-specific chain-of-thought signature
	// required by some providers (for example Gemini) to validate tool loops.
	ThoughtSignature string
}

ToolCall is a model-emitted tool invocation request.

type ToolDefinition

type ToolDefinition struct {
	Name        string
	Description string
	Parameters  map[string]any
}

ToolDefinition describes a callable tool for model planning.

type ToolResponse

type ToolResponse struct {
	ID     string
	Name   string
	Result map[string]any
}

ToolResponse is a tool execution result returned to model context.

type Usage

type Usage struct {
	PromptTokens     int
	CompletionTokens int
	TotalTokens      int
}

Usage reports model token usage (best-effort).

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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