runner

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HistoryStore

type HistoryStore interface {
	AppendEvent(ctx context.Context, sessionID string, event *llm.Event) error
	CreateUsageRecord(ctx context.Context, sessionID string, event *llm.Event) error
}

HistoryStore 对话历史持久化接口。

type Runner

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

Runner 统一持久化入口:历史追加、状态合并、用量记录。

func New

func New(sessionStore SessionStore, historyStore HistoryStore) *Runner

New 创建 Runner。

func (*Runner) Persist

func (r *Runner) Persist(ctx context.Context, sessionID string, event *llm.Event) error

Persist 持久化一个事件:追加历史、合并 StateDelta、记录用量。

type SessionStore

type SessionStore interface {
	MergeDelta(ctx context.Context, sessionID string, delta map[string]any) error
}

SessionStore 会话级状态存储接口。

Jump to

Keyboard shortcuts

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