models

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeMessageData

func EncodeMessageData(d StoredMessageData) string

func EncodeToDoList

func EncodeToDoList(todos []ToDo) string

Types

type Message

type Message struct {
	gorm.Model
	SessionID   string
	ID          uint  `gorm:"PrimaryKey;autoIncrement"`
	TimeCreated int64 `gorm:"autoCreateTime"`
	TimeUpdated int64 `gorm:"autoUpdateTime:nano"`
	Data        string
}

type Session

type Session struct {
	gorm.Model
	ID          string `gorm:"primaryKey"`
	Directory   string
	ToDoList    string `gorm:"type:longtext"`
	Title       string
	TimeCreated int64 `gorm:"autoCreateTime"`
	TimeUpdated int64 `gorm:"autoUpdateTime:nano"`
}

type StoredMessageData

type StoredMessageData struct {
	Role        string           `json:"role"`
	Content     string           `json:"content,omitempty"`
	CodeChanges []string         `json:"code_changes,omitempty"`
	Usage       *StoredUsage     `json:"usage,omitempty"`
	ToolCalls   []StoredToolCall `json:"tool_calls,omitempty"`
}

func DecodeMessageData

func DecodeMessageData(s string) StoredMessageData

type StoredToolCall

type StoredToolCall struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Arguments string `json:"arguments,omitempty"`
}

type StoredUsage

type StoredUsage struct {
	PromptTokens     int64 `json:"prompt_tokens,omitempty"`
	CompletionTokens int64 `json:"completion_tokens,omitempty"`
	TotalTokens      int64 `json:"total_tokens,omitempty"`
}

type ToDo

type ToDo struct {
	Index       int
	Description string
	Completed   bool
}

func DecodeToDoList

func DecodeToDoList(s string) []ToDo

Jump to

Keyboard shortcuts

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