structs

package
v0.0.0-...-f80be27 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Tables = []any{
	&Chats{},
	&Messages{},
	&SubAgents{},
	&Terminals{},
	&Scopes{},
	&Configs{},
	&Traces{},
}

Tables 所有表

Functions

This section is empty.

Types

type Chats

type Chats struct {
	ID          uint32 `gorm:"primaryKey;autoIncrement"`
	LastModelID uint32
	NowAgent    string
	TraceID     uint64
	// === 会话过程参数 ===
	DB                   *gorm.DB            `gorm:"-" json:"-"`
	CurrentAgentID       string              `gorm:"-" json:"-"`
	CurrentAgentConfig   structs.AgentConfig `gorm:"-" json:"-"`
	CurrentActivatePath  string              `gorm:"-" json:"-"`
	EnableScopes         map[string]bool     `gorm:"-" json:"-"`
	TemporyDataOfRequest map[string]any      `gorm:"-" json:"-"`
	TemporyDataOfSession map[string]any      `gorm:"-" json:"-"`
	InTestFlag           bool                `gorm:"-" json:"-"`
}

Chats 对话列表

type Configs

type Configs struct {
	LastChatID uint32
}

Configs 全局表

type Messages

type Messages struct {
	ID            uint64 `gorm:"primaryKey;autoIncrement"`
	ChatID        uint32
	AgentID       *string
	Delta         string `gorm:"type:text"`
	Summary       string `gorm:"type:text"`
	ThinkingDelta string `gorm:"type:text"`
	Chats         Chats  `gorm:"foreignKey:ChatID;constraints:OnDelete:RESTRICT;OnUpdate:CASCADE"`
	// SubAgents             SubAgents         `gorm:"foreignKey:AgentID;constraints:OnDelete:RESTRICT;OnUpdate:CASCADE"`
	Refers                MessagesReferList `gorm:"type:bytes;serialize:gob"`
	ToolCallingJSONString string            `gorm:"type:text"`
	// ToolFinished          bool              `gorm:"default:false"`
	Time      uint64 `gorm:"autoCreateTime"`
	ModelName string
	ModelID   uint32
	Type      MessagesRole
}

Messages 消息列表

type MessagesRefer

type MessagesRefer struct {
	FilePath     string
	FileType     MessagesReferType
	FileFromLine int32
	FileFromCol  int32
	FileToLine   int32
	FileToCol    int32
	Origin       []byte
}

MessagesRefer 消息引用

type MessagesReferList

type MessagesReferList []MessagesRefer

MessagesReferList 消息引用

type MessagesReferType

type MessagesReferType uint8

MessagesReferType 消息引用类型

const (
	MessagesReferTypeFile MessagesReferType = iota
	MessagesReferTypeText
	MessagesReferTypeImage
)

消息引用类型

type MessagesRole

type MessagesRole uint8

MessagesRole 消息类型

const (
	MessagesRoleUser MessagesRole = iota
	MessagesRoleAgent
	MessagesRoleTool
	MessagesRoleCommunicate
)

消息引用类型

type Scopes

type Scopes struct {
	ChatID  uint32 `gorm:"primaryKey;column:chat_id"`
	Name    string `gorm:"primaryKey;column:name"`
	Enabled bool   `gorm:"column:enabled"`
	Chats   Chats  `gorm:"foreignKey:ChatID;references:ID"`
}

Scopes 存储命名空间启用状态

type SubAgents

type SubAgents struct {
	ID string `gorm:"primaryKey"`
	// ChatID      uint32
	AgentID     string
	BindPath    string
	Deleted     bool
	LastSummary string
}

SubAgents 子 agents 列表

type Terminals

type Terminals struct {
	ID      uint32 `gorm:"primaryKey"`
	ChatID  uint32
	Chats   Chats  `gorm:"foreignKey:ChatID"`
	History []byte `gorm:"type:blob"`
	Title   string
}

Terminals 终端表

type Traces

type Traces struct {
	Path    string `gorm:"primaryKey"`
	ChatID  uint32 `gorm:"primaryKey"`
	AgentID string `gorm:"primaryKey"`
	TraceID uint64
	Chats   Chats `gorm:"foreignKey:ChatID"`
}

Traces 文件跟踪表

Jump to

Keyboard shortcuts

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