Documentation
¶
Index ¶
- Variables
- func AddUpdateModel(db QataiDatabase, m *LLMModel, updateIfExists bool) error
- func AddUpdateUser(db *QataiDatabase, user *User, updateIfExists bool) error
- func ClearAllConfig(db QataiDatabase) error
- func ClearAllModels(db QataiDatabase) error
- func SetConfig(db QataiDatabase, config *Config) error
- type BBoltDB
- func (db *BBoltDB) ClearAllRecordsInCollection(CollectionBucketName string) error
- func (db *BBoltDB) GetAllRecordForCollectionBucket(CollectionBucketName string) ([]QataiDatabaseRecord, error)
- func (b *BBoltDB) GetValueByKeyName(CollectionBucketName string, Key string) (*QataiDatabaseRecord, error)
- func (b *BBoltDB) SetValueByKeyName(CollectionBucketName string, record *QataiDatabaseRecord) error
- type Config
- type LLMEndPoint
- type LLMModel
- func GetAllModels(db QataiDatabase) ([]LLMModel, error)
- func GetModelByName(db QataiDatabase, modelName string) (*LLMModel, error)
- func GetModelByUUID(db QataiDatabase, uuid string) (*LLMModel, error)
- func NewLLMModel(name string, description string, provider LLMProvider, prePrompt string, ...) *LLMModel
- type LLMParameters
- type LLMPrompts
- type LLMProvider
- type LLMTokens
- type MongoDB
- func (db *MongoDB) ClearAllRecordsInCollection(CollectionBucketName string) error
- func (db *MongoDB) GetAllRecordForCollectionBucket(CollectionBucketName string) ([]QataiDatabaseRecord, error)
- func (m *MongoDB) GetValueByKeyName(CollectionBucketName string, Key string) (*QataiDatabaseRecord, error)
- func (m *MongoDB) SetValueByKeyName(CollectionBucketName string, record *QataiDatabaseRecord) error
- type QataiDatabase
- type QataiDatabaseRecord
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var RequiredCollectionBucket = []string{"config", "users", "models", "chats", "messages", "media", "openai"}
Functions ¶
func AddUpdateModel ¶
func AddUpdateModel(db QataiDatabase, m *LLMModel, updateIfExists bool) error
func AddUpdateUser ¶
func AddUpdateUser(db *QataiDatabase, user *User, updateIfExists bool) error
func ClearAllConfig ¶
func ClearAllConfig(db QataiDatabase) error
func ClearAllModels ¶
func ClearAllModels(db QataiDatabase) error
func SetConfig ¶
func SetConfig(db QataiDatabase, config *Config) error
Types ¶
type BBoltDB ¶
type BBoltDB struct {
// contains filtered or unexported fields
}
func InitNewBoltDB ¶
func (*BBoltDB) ClearAllRecordsInCollection ¶
func (*BBoltDB) GetAllRecordForCollectionBucket ¶
func (db *BBoltDB) GetAllRecordForCollectionBucket(CollectionBucketName string) ([]QataiDatabaseRecord, error)
func (*BBoltDB) GetValueByKeyName ¶
func (b *BBoltDB) GetValueByKeyName(CollectionBucketName string, Key string) (*QataiDatabaseRecord, error)
func (*BBoltDB) SetValueByKeyName ¶
func (b *BBoltDB) SetValueByKeyName(CollectionBucketName string, record *QataiDatabaseRecord) error
type Config ¶
func GetAllConfig ¶
func GetAllConfig(db QataiDatabase) ([]Config, error)
type LLMEndPoint ¶
type LLMModel ¶
type LLMModel struct { UUID string `json:"uuid"` Name string `json:"name"` Description string `json:"description"` PrePrompt string `json:"prePrompt"` Tokens LLMTokens `json:"tokens"` Stops []string `json:"stops"` Provider LLMProvider `json:"provider"` Prompts []LLMPrompts `json:"prompts"` Parameters LLMParameters `json:"parameters"` EndPoints []LLMEndPoint `json:"endPoints"` }
func GetAllModels ¶
func GetAllModels(db QataiDatabase) ([]LLMModel, error)
func GetModelByName ¶
func GetModelByName(db QataiDatabase, modelName string) (*LLMModel, error)
func GetModelByUUID ¶
func GetModelByUUID(db QataiDatabase, uuid string) (*LLMModel, error)
func NewLLMModel ¶
func NewLLMModel(name string, description string, provider LLMProvider, prePrompt string, tokens LLMTokens, stops []string, endpoints []LLMEndPoint, prompts []LLMPrompts, params LLMParameters) *LLMModel
Initialise LLMModel
type LLMParameters ¶
type LLMPrompts ¶
type LLMProvider ¶
type LLMProvider string
const ( OPENAI LLMProvider = "openai" HFTGI LLMProvider = "tgi" )
type MongoDB ¶
type MongoDB struct {
// contains filtered or unexported fields
}
func (*MongoDB) ClearAllRecordsInCollection ¶
func (*MongoDB) GetAllRecordForCollectionBucket ¶
func (db *MongoDB) GetAllRecordForCollectionBucket(CollectionBucketName string) ([]QataiDatabaseRecord, error)
func (*MongoDB) GetValueByKeyName ¶
func (m *MongoDB) GetValueByKeyName(CollectionBucketName string, Key string) (*QataiDatabaseRecord, error)
func (*MongoDB) SetValueByKeyName ¶
func (m *MongoDB) SetValueByKeyName(CollectionBucketName string, record *QataiDatabaseRecord) error
type QataiDatabase ¶
type QataiDatabase interface { SetValueByKeyName(CollectionBucketName string, record *QataiDatabaseRecord) error GetValueByKeyName(CollectionBucketName string, Key string) (*QataiDatabaseRecord, error) GetAllRecordForCollectionBucket(CollectionBucketName string) ([]QataiDatabaseRecord, error) //TODO: I know, wrong, dirty, but I need it anyway and too lazy to create a new a collection for mapping ClearAllRecordsInCollection(CollectionBucketName string) error }
type QataiDatabaseRecord ¶
type User ¶
type User struct { UUID string `json:"uuid"` Email string `json:"email"` Name string `json:"name"` Salt string `json:"salt"` Password string `json:"password"` // This should be hashed & salted in a real-world scenario Disabled bool `json:"disabled"` LastLoginIP string `json:"last_login_ip"` LastLoginTime string `json:"last_login_time"` ChatsIDs []string `json:"chats"` }
Click to show internal directories.
Click to hide internal directories.