Documentation
¶
Index ¶
Constants ¶
const MemoryListMax uint64 = 100
MemoryListMax is the most memories which are listed at once
Variables ¶
var Fields = []Field{FieldName, FieldAssistant, FieldLocation, FieldTimezone, FieldLanguage}
Fields are the fields, in the order they're described
Functions ¶
This section is empty.
Types ¶
type Detail ¶ added in v1.0.0
type Detail struct {
Value string `json:"value,omitempty" help:"The detail, such as a name"`
Declined bool `json:"declined,omitempty" help:"The person declined to say it, so it isn't in the system prompt"`
}
Detail is what's known of a field: its value, or that the person declined to say it, so it isn't in the system prompt. A field which isn't known, as it was never said, or was forgotten, has no detail.
type DetailRow ¶ added in v1.0.0
DetailRow is a field, and its detail, which is nil when it isn't known, as a row of a table
type Details ¶ added in v1.0.0
type Details struct {
Name *Detail `json:"name,omitempty" help:"The person's name"`
Assistant *Detail `json:"assistant,omitempty" help:"The assistant's name"`
Location *Detail `json:"location,omitempty" help:"Where the person is, such as their city"`
Timezone *Detail `json:"timezone,omitempty" help:"The person's time zone, by its IANA name, such as Europe/Berlin"`
Language *Detail `json:"language,omitempty" help:"The language the person speaks"`
}
Details are the details which the memory keeps, each of which is nil when it isn't known
func (Details) Get ¶ added in v1.0.0
Get returns the detail of the field, or nil when it isn't known
func (Details) Rows ¶ added in v1.0.0
Rows returns each field, and its detail, in the order of the fields
func (*Details) Set ¶ added in v1.0.0
Set sets the detail of the field, which forgets it, when it's nil, so it isn't known. Returns ErrBadParameter when the field, or the detail, isn't valid.
func (Details) Validate ¶ added in v1.0.0
Validate returns ErrBadParameter when a detail isn't valid
type Field ¶ added in v1.0.0
type Field string
Field is a detail which the memory keeps, about the person who's being talked to, or the assistant, such as their name
func ParseField ¶ added in v1.0.0
ParseField returns the field with the name, such as location, or ErrBadParameter when there's none
type Memory ¶
type Memory struct {
MemoryMeta
Version string `` /* 183-byte string literal not displayed */
Created time.Time `json:"created,omitzero" readonly:"" help:"When it was remembered"`
Modified time.Time `json:"modified,omitzero" readonly:"" help:"When it was last changed"`
}
Memory is what's remembered, its version, which is one when it's remembered, and one more each time it's changed, and when it was remembered, and last changed
func (Memory) Cell ¶ added in v1.0.0
Cell returns the memory's key, description, and when it was last changed, in local time
type MemoryEvent ¶ added in v1.0.0
type MemoryEvent struct {
Version string `json:"version" help:"Version of the memory, as it is now"`
}
MemoryEvent is the data of an event of a memory, which was created, or updated: its version
type MemoryForgetRequest ¶ added in v1.0.0
type MemoryForgetRequest struct {
Line string `json:"line,omitempty" help:"A line of the memory's body to forget, rather than the whole memory" optional:""`
}
MemoryForgetRequest is what's forgotten of a memory: a line of it, or all of it
type MemoryList ¶
type MemoryList struct {
MemoryListRequest
Count uint `json:"count" help:"How many memories match"`
Body []Memory `json:"body,omitzero" help:"The memories"`
}
MemoryList is the memories which are listed, the most recently changed first, and how many there are
func (MemoryList) String ¶ added in v1.0.0
func (l MemoryList) String() string
type MemoryListRequest ¶
type MemoryListRequest struct {
Q string `` /* 128-byte string literal not displayed */
Offset uint64 `json:"offset,omitempty" help:"How many memories to skip" optional:""`
Limit *uint64 `json:"limit,omitempty" help:"Most memories to return" optional:""`
}
MemoryListRequest is which memories are listed: those which match the query, when there is one, from the offset, and at most the limit of them
func (MemoryListRequest) Page ¶ added in v1.0.0
func (r MemoryListRequest) Page(memories []Memory) MemoryList
Page returns the memories of the request's page, from its offset, and at most its limit, or MemoryListMax, of them, and how many there are
func (MemoryListRequest) Query ¶
func (r MemoryListRequest) Query() url.Values
Query returns the request as URL query values
func (MemoryListRequest) String ¶ added in v1.0.0
func (r MemoryListRequest) String() string
type MemoryMeta ¶
type MemoryMeta struct {
Key string `json:"key" help:"Key of the memory, which is an identifier, such as kitchen_lights" example:"kitchen_lights"`
Description string `json:"description" help:"A line which describes what's remembered" example:"Which lights are in the kitchen"`
Body string `json:"body" help:"What's remembered, as Markdown"`
}
MemoryMeta is what's remembered: its key, which identifies it, a line which describes it, and its body
func (MemoryMeta) Hash ¶ added in v1.0.0
func (m MemoryMeta) Hash() string
Hash returns the version of what's remembered, which is a hash of its description and body, so it changes when either does, however they're changed, such as by hand, and is never the version of a memory with other content
func (MemoryMeta) Validate ¶ added in v1.0.0
func (m MemoryMeta) Validate() (MemoryMeta, error)
Validate returns the memory, with its key, description and body trimmed, or ErrBadParameter when its key isn't an identifier, or it has no description, or body
type MemoryRequest ¶ added in v1.0.0
type MemoryRequest struct {
Description string `json:"description" help:"A line which describes what's remembered" example:"Which lights are in the kitchen"`
Body string `json:"body" help:"What's remembered, as Markdown, which replaces all of what was remembered under the key"`
Version string `json:"version,omitempty" help:"Version of the memory which it replaces, or none, to remember a new memory" optional:""`
}
MemoryRequest is a memory to remember, under the key its path has: its description and body, and the version of the memory it replaces, or none, to remember a new memory