Documentation
¶
Overview ¶
Package session provides persistence for agent conversations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Session ¶
type Session struct {
ID string `json:"id"`
Title string `json:"title"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Messages []anthropic.MessageParam `json:"messages"`
}
Session represents a saved conversation session.
func NewSession ¶
NewSession creates a new session with a generated ID.
func (*Session) MessageCount ¶
MessageCount returns the number of messages in the session.
func (*Session) SetMessages ¶
func (s *Session) SetMessages(messages []anthropic.MessageParam)
SetMessages replaces the session's messages.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages session persistence to the filesystem.
func NewStore ¶
NewStore creates a new session store at the given directory. The directory will be created if it doesn't exist.
func StoreForWorkDir ¶
StoreForWorkDir returns a Store using .milo/sessions in the given work directory.
func (*Store) MostRecent ¶
MostRecent returns the most recently updated session, or nil if no sessions exist.
Click to show internal directories.
Click to hide internal directories.