clientdb

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TruncateStr added in v0.1.10

func TruncateStr(str string, maxLen int) string

Types

type ClientDB

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

func InitClientDB

func InitClientDB(db_name string, verbose bool) (*ClientDB, error)

func (*ClientDB) AddChatHistory

func (cdb *ClientDB) AddChatHistory(chat_history *model.ConversationHistory) bool

func (*ClientDB) AddOptionHistory

func (cdb *ClientDB) AddOptionHistory(op_history *OptionHistory) bool

func (*ClientDB) LoadOptionHistory

func (cdb *ClientDB) LoadOptionHistory(role_name string) ([]string, error)

type OptionHistory

type OptionHistory struct {
	gorm.Model

	Role   string `gorm:"type:varchar(32);<-:create"`  // allow read and create
	Option string `gorm:"type:varchar(256);<-:create"` // allow read and create
}

Jump to

Keyboard shortcuts

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