Documentation
¶
Index ¶
Constants ¶
View Source
const ( TitleSourceAuto = "auto" TitleSourceUser = "user" TitleStatePending = "pending" TitleStateStable = "stable" )
Variables ¶
This section is empty.
Functions ¶
func RefreshTitle ¶
RefreshTitle updates the session title when it is auto-managed.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager 会话管理器
func (*Manager) GetOrCreate ¶
GetOrCreate 获取或创建会话
type Message ¶
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
Timeline []TimelineEntry `json:"timeline,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
Message 会话消息
type Session ¶
type Session struct {
Key string `json:"key"`
Title string `json:"title,omitempty"`
TitleSource string `json:"titleSource,omitempty"`
TitleState string `json:"titleState,omitempty"`
TitleUpdatedAt time.Time `json:"titleUpdatedAt,omitempty"`
Messages []Message `json:"messages"`
LastConsolidated int `json:"lastConsolidated,omitempty"`
}
Session 会话
func (*Session) AddMessageWithTimeline ¶
func (s *Session) AddMessageWithTimeline(role, content string, timeline []TimelineEntry)
func (*Session) GetHistory ¶
GetHistory 获取历史记录
type TimelineActivity ¶
type TimelineEntry ¶
type TimelineEntry struct {
Kind string `json:"kind"`
Activity *TimelineActivity `json:"activity,omitempty"`
Text string `json:"text,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.