cmd

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: Apache-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmd has the memory's commands and flags

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCommands

type ClientCommands struct {
	DetailCommands
	MemoryCommands
}

ClientCommands are the commands which call the memory's API

type DetailCommands

type DetailCommands struct {
	Details      DetailsCmd      `cmd:"" name:"details" help:"List the details of you, and the assistant, which every session knows." group:"MEMORY"`
	DetailSet    DetailSetCmd    `cmd:"" name:"detail-set" help:"Set a detail, or decline to give it with --declined." group:"MEMORY"`
	DetailForget DetailForgetCmd `cmd:"" name:"detail-forget" help:"Forget a detail, so it isn't known." group:"MEMORY"`
}

DetailCommands are the commands which get, set and forget the memory's details

type DetailForgetCmd

type DetailForgetCmd struct {
	Field string `` /* 136-byte string literal not displayed */
}

func (*DetailForgetCmd) Run

func (cmd *DetailForgetCmd) Run(ctx server.Cmd) error

Run forgets the detail, and prints the details

type DetailSetCmd

type DetailSetCmd struct {
	Field    string   `` /* 136-byte string literal not displayed */
	Value    []string `` /* 127-byte string literal not displayed */
	Declined bool     `name:"declined" help:"Decline to give it, so it isn't in the system prompt, or asked for."`
}

func (*DetailSetCmd) Run

func (cmd *DetailSetCmd) Run(ctx server.Cmd) error

Run sets the detail, and prints the details

type DetailsCmd

type DetailsCmd struct{}

func (*DetailsCmd) Run

func (cmd *DetailsCmd) Run(ctx server.Cmd) error

Run prints the details

type Flags

type Flags struct{}

Flags are the memory's flags for the server, which has none yet

func (Flags) WithMemory

func (flags Flags) WithMemory(ctx server.Cmd, srv *servercmd.RunServer, store memory.Store, fn func(*memory.Memory) error, opts ...memory.Opt) error

WithMemory creates the memory, with the details in the store, and the options, such as the broadcaster it publishes its changes to, registers its HTTP handlers with the server, when there is one, and then calls the function with the memory, returning any error. The function adds it to a toolkit, so models have its system prompt, and tools.

type MemoriesCmd

type MemoriesCmd struct {
	Q      []string `arg:"" name:"words" optional:"" help:"Words which each memory has, in its key, description or body, or every memory."`
	Offset uint64   `name:"offset" help:"How many memories to skip."`
	Limit  *uint64  `name:"limit" help:"Most memories to list."`
}

func (*MemoriesCmd) Run

func (cmd *MemoriesCmd) Run(ctx server.Cmd) error

Run prints the memories, as a table, and how many there are

type MemoryCmd

type MemoryCmd struct {
	Key string `arg:"" name:"key" help:"Key of the memory, such as kitchen_lights."`
}

func (*MemoryCmd) Run

func (cmd *MemoryCmd) Run(ctx server.Cmd) error

Run prints the memory

type MemoryCommands

type MemoryCommands struct {
	Memories       MemoriesCmd       `cmd:"" name:"memories" help:"List what's remembered, or search it, the most recent first." group:"MEMORY"`
	Memory         MemoryCmd         `cmd:"" name:"memory" help:"Print what's remembered under a key." group:"MEMORY"`
	MemoryRemember MemoryRememberCmd `cmd:"" name:"memory-remember" help:"Remember something under a key, from the arguments, or standard input." group:"MEMORY"`
	MemoryForget   MemoryForgetCmd   `cmd:"" name:"memory-forget" help:"Forget what's remembered under a key, or a line of it, with --line." group:"MEMORY"`
}

MemoryCommands are the commands which list, get, remember and forget the memories

type MemoryForgetCmd

type MemoryForgetCmd struct {
	Key  string `arg:"" name:"key" help:"Key of the memory, such as kitchen_lights."`
	Line string `name:"line" help:"A line of the memory to forget, rather than the whole memory."`
}

func (*MemoryForgetCmd) Run

func (cmd *MemoryForgetCmd) Run(ctx server.Cmd) error

Run forgets the memory, or a line of it, and prints it, as it is, or was

type MemoryRememberCmd

type MemoryRememberCmd struct {
	Key         string   `arg:"" name:"key" help:"Key of the memory, such as kitchen_lights."`
	Body        []string `` /* 199-byte string literal not displayed */
	Description string   `name:"description" short:"d" required:"" help:"A line which describes what's remembered."`
	Version     string   `name:"at" help:"Version of the memory it replaces, which memory prints, or none, to remember a new one."`
}

func (*MemoryRememberCmd) Run

func (cmd *MemoryRememberCmd) Run(ctx server.Cmd) error

Run remembers the memory, and prints it

Jump to

Keyboard shortcuts

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