model

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MigrationType = "agenthop_migration"

Variables

This section is empty.

Functions

func OriginDigest

func OriginDigest(conv *Conversation) string

Types

type ContentBlock

type ContentBlock struct {
	Type string `json:"type"`
	Text string `json:"text,omitempty"`
}

type Conversation

type Conversation struct {
	ID           string    `json:"id"`
	Provider     string    `json:"provider"`
	ProjectPath  string    `json:"project_path,omitempty"`
	Title        string    `json:"title,omitempty"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	Messages     []Message `json:"messages"`
	StoragePath  string    `json:"storage_path,omitempty"`
	MessageCount int       `json:"message_count"`
}

type Message

type Message struct {
	Role      Role           `json:"role"`
	Content   string         `json:"content"`
	Blocks    []ContentBlock `json:"blocks,omitempty"`
	Timestamp time.Time      `json:"timestamp,omitempty"`
}

func (Message) PlainText

func (m Message) PlainText() string

type MigrationMeta

type MigrationMeta struct {
	Type                string `json:"type"`
	OriginID            string `json:"originId"`
	OriginSource        string `json:"originSource"`
	OriginMessageCount  int    `json:"originMessageCount"`
	OriginDigest        string `json:"originDigest,omitempty"`
	TargetFormatVersion *int   `json:"targetFormatVersion,omitempty"`
}

func NewMigrationMeta

func NewMigrationMeta(conv *Conversation) MigrationMeta

type Role

type Role string
const (
	RoleUser      Role = "user"
	RoleAssistant Role = "assistant"
	RoleSystem    Role = "system"
	RoleTool      Role = "tool"
)

type Summary

type Summary struct {
	ID           string    `json:"id"`
	Provider     string    `json:"provider"`
	ProjectPath  string    `json:"project_path,omitempty"`
	Title        string    `json:"title,omitempty"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	MessageCount int       `json:"message_count"`
	StoragePath  string    `json:"storage_path,omitempty"`
	SourceMtime  int64     `json:"source_mtime,omitempty"`
}

func (Summary) ShortID

func (s Summary) ShortID() string

Jump to

Keyboard shortcuts

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