Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFragmentTables ¶
CreateFragmentTables creates tables for the fragments if they do not exist.
Types ¶
type Actor ¶
type Actor struct {
ID id.ID `gorm:"type:uuid;primaryKey"`
Name string `gorm:"type:varchar(255);not null"`
Assistant bool `gorm:"type:boolean;not null;default:false"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
Actor represents an entity in the system with a unique ID and name.
type Fragment ¶
type Fragment struct {
ID id.ID `gorm:"type:uuid;primaryKey"`
ActorID id.ID `gorm:"type:uuid;not null;index"`
SessionID id.ID `gorm:"type:uuid;not null;index"`
Content string `gorm:"type:text;not null"`
Metadata Metadata `gorm:"type:jsonb;not null;default:'{}'::jsonb"`
Embedding pgvector.Vector `gorm:"type:vector(1536)"`
Actor *Actor `gorm:"foreignKey:ActorID"`
Session *Session `gorm:"foreignKey:SessionID"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
}
Fragment represents a data fragment stored in one of the fragment tables.
type FragmentTable ¶
type FragmentTable string
FragmentTable defines the different types of fragment tables in the database.
const ( FragmentTableInteraction FragmentTable = "interaction" FragmentTablePersonality FragmentTable = "personality" FragmentTableInsight FragmentTable = "insight" FragmentTableTwitter FragmentTable = "twitter" )
type Metadata ¶
type Metadata map[string]interface{}
Metadata represents a JSON object stored in the database.
func (Metadata) GetBool ¶
GetBool retrieves a boolean value from Metadata, returning false if not found or not a bool.
func (Metadata) GetFloat ¶
GetFloat retrieves a float64 value from Metadata, returning 0 if not found or not a float64.
func (Metadata) GetString ¶
GetString retrieves a string value from Metadata, returning an empty string if not found or not a string.
Click to show internal directories.
Click to hide internal directories.