Documentation ¶
Index ¶
- Constants
- type Database
- type History
- type IUser
- type Message
- func (m *Message) Insert(message *Message) error
- func (m *Message) ReplaceBySessionId(message *Message) error
- func (m *Message) SelectBySessionId(id string) (*Message, error)
- func (m *Message) SelectByUserId(userId string) ([]*Message, error)
- func (m *Message) SelectLastByUserId(userId string) (*Message, error)
- type Model
- type User
Constants ¶
View Source
const ( ModelIdOpenAiGpt4 = 1 ModelIdOpenAiGpt35 = 2 )
View Source
const (
BalanceMultipleFactor = 1000000
)
View Source
const (
ProviderOpenAi = "openai"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type History ¶
type History struct { SessionId string Timestamp int64 UserId string ModelId int InTokenCount int OutTokenCount int // contains filtered or unexported fields }
func (*History) SelectBySessionId ¶
type Message ¶
type Message struct { Deleted bool SessionId string UserId string // uuid Timestamp int64 Messages string // json string of messages, might include persona (role: system) ModelId int Saved bool // if false, it means the message is automatically saved (last) // contains filtered or unexported fields }
func (*Message) ReplaceBySessionId ¶
func (*Message) SelectBySessionId ¶
func (*Message) SelectByUserId ¶
type Model ¶
type User ¶
type User struct { Id string // uuid Balance int64 // dollar * multiple factor (1000000) Clipboard string // contains filtered or unexported fields }
func (*User) SelectByIdInsertIfNotExists ¶
func (*User) UpdateClipboard ¶
Click to show internal directories.
Click to hide internal directories.