Documentation
¶
Overview ¶
Package session stores an agent conversation as an append-only JSON-lines journal.
Events are the portable transcript. Items are opaque, append-only provider state: a provider hands them out and takes the same bytes back on resume. Metadata belongs to the caller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Line ¶
type Line struct {
Kind Kind `json:"kind"`
Time time.Time `json:"time"`
ID string `json:"id,omitempty"`
Metadata json.RawMessage `json:"metadata,omitempty"`
Event *agent.Event `json:"event,omitempty"`
Payload json.RawMessage `json:"payload,omitempty"`
}
Line is one journal record. Head records include the original session ID.
type Session ¶
type Session struct {
ID string
Metadata json.RawMessage
Started time.Time
Touched time.Time
Events []agent.Event
Items []json.RawMessage
}
Session is a stored conversation.
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
Writer appends records to a session. The file is made by the first record, so an unused session leaves nothing behind.
func Create ¶
func Create(directory string, metadata json.RawMessage) (*Writer, error)
Create starts a session in directory with caller-owned metadata.
Click to show internal directories.
Click to hide internal directories.