chat

package
v2.14.1 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChatSessionDoesNotExist = errors.New("chat session does not exist")
	ErrChatSessionNameInvalid  = fmt.Errorf("chat session name does not match the regex %s", sessionNameRegex)
	ErrChatSessionNameTooLong  = fmt.Errorf("chat session name is greater than %d", sessionNameMaxLength)
)

Functions

This section is empty.

Types

type FilesystemChatSessionManager

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

func (FilesystemChatSessionManager) DeleteSession

func (m FilesystemChatSessionManager) DeleteSession(sessionName string) error

func (FilesystemChatSessionManager) GetSession

func (m FilesystemChatSessionManager) GetSession(sessionName string) ([]openai.ChatCompletionMessage, error)

func (FilesystemChatSessionManager) ListSessions

func (m FilesystemChatSessionManager) ListSessions() ([]string, error)

func (FilesystemChatSessionManager) SaveSession

func (m FilesystemChatSessionManager) SaveSession(sessionName string, messages []openai.ChatCompletionMessage) error

func (FilesystemChatSessionManager) SessionExists

func (m FilesystemChatSessionManager) SessionExists(sessionName string) (bool, error)

type SessionManager

type SessionManager interface {
	SessionExists(sessionName string) (bool, error)
	GetSession(sessionName string) ([]openai.ChatCompletionMessage, error)
	SaveSession(sessionName string, messages []openai.ChatCompletionMessage) error
	ListSessions() ([]string, error)
	DeleteSession(sessionName string) error
}

func NewFilesystemChatSessionManager

func NewFilesystemChatSessionManager(config *viper.Viper) (SessionManager, error)

Jump to

Keyboard shortcuts

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