chat

package
v0.0.0-...-71c47e0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 9 Imported by: 2 modules, 2 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

Overview

Package chat provides chat session management, message persistence, and LLM invocation logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager coordinates chat message management and LLM execution.

func New

func New(
	settings kv.Repo,
) *Manager

New creates a new Manager for chat processing.

func (*Manager) AddInstruction

func (m *Manager) AddInstruction(ctx context.Context, tx libdb.Exec, id string, sendAt time.Time, message string) error

AddInstruction inserts a system message into an existing chat.

func (*Manager) AppendMessage

func (m *Manager) AppendMessage(ctx context.Context, messages []taskengine.Message, sendAt time.Time, message string, role string) ([]taskengine.Message, error)

AppendMessage appends a message to an existing message slice.

func (*Manager) AppendMessages

func (m *Manager) AppendMessages(ctx context.Context, tx libdb.Exec, subjectID string, inputMessage *taskengine.Message, responseMessage *taskengine.Message) error

AppendMessages stores a user message and the assistant response to the database.

func (*Manager) ListMessages

func (m *Manager) ListMessages(ctx context.Context, tx libdb.Exec, subjectID string) ([]taskengine.Message, error)

ListMessages retrieves all stored messages for a given subject ID.

func (*Manager) PersistDiff

func (m *Manager) PersistDiff(ctx context.Context, tx libdb.Exec, subjectID string, hist []taskengine.Message) error

Jump to

Keyboard shortcuts

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