session

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2026 License: MIT Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Key      string              `json:"key"`
	Messages []providers.Message `json:"messages"`
	Created  time.Time           `json:"created"`
	Updated  time.Time           `json:"updated"`
}

type SessionManager

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

func NewSessionManager

func NewSessionManager(storage string) *SessionManager

func (*SessionManager) AddMessage

func (sm *SessionManager) AddMessage(sessionKey, role, content string)

func (*SessionManager) GetHistory

func (sm *SessionManager) GetHistory(key string) []providers.Message

func (*SessionManager) GetOrCreate

func (sm *SessionManager) GetOrCreate(key string) *Session

func (*SessionManager) Save

func (sm *SessionManager) Save(session *Session) error

Jump to

Keyboard shortcuts

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