driver

package
v0.10.3 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	ID          string                   `json:"-" yaml:"-"`
	Use         string                   `json:"use,omitempty"`
	Name        string                   `json:"name,omitempty"`
	Description string                   `json:"description,omitempty"`
	Args        []map[string]interface{} `json:"args,omitempty"`
	Stack       string                   `json:"stack,omitempty"`
	Path        string                   `json:"path,omitempty"`
}

Command the command struct

type Memory

type Memory struct {
	// contains filtered or unexported fields
}

Memory the memory driver

func NewMemory

func NewMemory(model string, prompts []aigc.Prompt) (*Memory, error)

NewMemory create a new memory driver

func (*Memory) Del

func (driver *Memory) Del(key string)

Del delete the command data

func (*Memory) DelRequest

func (driver *Memory) DelRequest(sid string)

DelRequest delete the command request

func (*Memory) Get

func (driver *Memory) Get(key string) (Command, bool)

Get the command data

func (*Memory) GetCommands

func (driver *Memory) GetCommands() ([]Command, error)

GetCommands get all commands

func (*Memory) GetRequest

func (driver *Memory) GetRequest(sid string) (string, string, bool)

GetRequest get the command request

func (*Memory) Match

func (driver *Memory) Match(query query.Param, content string) (string, error)

Match match the command data

func (*Memory) Set

func (driver *Memory) Set(key string, cmd Command) error

Set Set the command data

func (*Memory) SetRequest

func (driver *Memory) SetRequest(sid, id, cid string) error

SetRequest set the command request

type Request

type Request struct {
	ID  string
	Sid string
	Cid string
}

Request the command request

Jump to

Keyboard shortcuts

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