models

package
v0.0.0-...-81cac2f Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrResourceNotFound      = errors.New("resource not found")
	ErrInvalidResourceSyntax = errors.New("resource syntax invalid")
)

Functions

This section is empty.

Types

type Bot

type Bot struct {
	gorm.Model
	Name             string     `json:"name"`
	Description      string     `json:"description"`
	SendName         bool       `json:"send_name"`
	AiApiPluginName  string     `json:"ai_api_plugin_name"`
	AiModel          string     `json:"model"`
	Personality      string     `json:"personality"`
	CorrectionPrompt string     `json:"correction_prompt"`
	UserHistory      string     `json:"user_history"`
	Randomness       float64    `json:"randomness"`
	LastMessageAt    *time.Time `json:"last_message_at"`
}

type Chat

type Chat struct {
	gorm.Model
	Name           string        `json:"name"`
	BotID          uint          `json:"bot_id"`
	MemoryDuration time.Duration `json:"memory_duration"`
	LastMessageAt  *time.Time    `json:"last_message_at"`
}

type EventType

type EventType string
const (
	EVENT_TYPE_MESSAGE_CREATED EventType = "message_created"
)

type GetMessagesOptions

type GetMessagesOptions struct {
	ChatID  uint `json:"chat_id"`
	Page    int  `json:"page"`
	PerPage int  `json:"per_page"`
}

type Message

type Message struct {
	gorm.Model
	ChatID     uint        `json:"chat_id"`
	Text       string      `json:"text"`
	Correction string      `json:"correction"`
	Role       MessageRole `json:"role"`
}

type MessageCreated

type MessageCreated struct {
	Message *Message
}

type MessageRole

type MessageRole string
const (
	MESSAGE_ROLE_USER   MessageRole = "USER"
	MESSAGE_ROLE_BOT    MessageRole = "BOT"
	MESSAGE_ROLE_SYSTEM MessageRole = "SYSTEM"
)

type MessagesDTO

type MessagesDTO struct {
	Messages []*Message `json:"messages"`
	Page     int        `json:"page"`
	PerPage  int        `json:"per_page"`
	Total    int        `json:"total"`
}

Jump to

Keyboard shortcuts

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