Documentation
¶
Index ¶
- type Context
- type ContextsEntity
- type Db
- type DirectoryChange
- type Pattern
- type PatternsEntity
- func (o *PatternsEntity) Get(name string) (*Pattern, error)
- func (o *PatternsEntity) GetApplyVariables(source string, variables map[string]string, input string) (pattern *Pattern, err error)
- func (o *PatternsEntity) GetNames() (ret []string, err error)
- func (o *PatternsEntity) GetRaw(name string) (*Pattern, error)
- func (o *PatternsEntity) GetWithoutVariables(source, input string) (pattern *Pattern, err error)
- func (o *PatternsEntity) ListNames(shellCompleteList bool) (err error)
- func (o *PatternsEntity) PrintLatestPatterns(latestNumber int) (err error)
- func (o *PatternsEntity) PrintPattern(name string) (err error)
- func (o *PatternsEntity) Save(name string, content []byte) (err error)
- type Session
- type SessionsEntity
- type StorageEntity
- func (o *StorageEntity) BuildFilePath(fileName string) (ret string)
- func (o *StorageEntity) BuildFilePathByName(name string) (ret string)
- func (o *StorageEntity) Configure() (err error)
- func (o *StorageEntity) Delete(name string) (err error)
- func (o *StorageEntity) Exists(name string) (ret bool)
- func (o *StorageEntity) GetNames() (ret []string, err error)
- func (o *StorageEntity) ListNames(shellCompleteList bool) (err error)
- func (o *StorageEntity) Load(name string) (ret []byte, err error)
- func (o *StorageEntity) LoadAsJson(name string, item any) (err error)
- func (o *StorageEntity) Rename(oldName, newName string) (err error)
- func (o *StorageEntity) Save(name string, content []byte) (err error)
- func (o *StorageEntity) SaveAsJson(name string, item any) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextsEntity ¶
type ContextsEntity struct {
*StorageEntity
}
func (*ContextsEntity) Get ¶
func (o *ContextsEntity) Get(name string) (ret *Context, err error)
Get Load a context from file
func (*ContextsEntity) PrintContext ¶
func (o *ContextsEntity) PrintContext(name string) (err error)
type Db ¶
type Db struct {
Dir string
Patterns *PatternsEntity
Sessions *SessionsEntity
Contexts *ContextsEntity
EnvFilePath string
}
func (*Db) IsEnvFileExists ¶
func (*Db) LoadEnvFile ¶
type DirectoryChange ¶
type PatternsEntity ¶
type PatternsEntity struct {
*StorageEntity
SystemPatternFile string
UniquePatternsFilePath string
CustomPatternsDir string
}
func (*PatternsEntity) Get ¶
func (o *PatternsEntity) Get(name string) (*Pattern, error)
Get required for Storage interface
func (*PatternsEntity) GetApplyVariables ¶
func (o *PatternsEntity) GetApplyVariables( source string, variables map[string]string, input string) (pattern *Pattern, err error)
GetApplyVariables main entry point for getting patterns from any source
func (*PatternsEntity) GetNames ¶
func (o *PatternsEntity) GetNames() (ret []string, err error)
GetNames overrides StorageEntity.GetNames to include custom patterns directory
func (*PatternsEntity) GetRaw ¶ added in v1.4.429
func (o *PatternsEntity) GetRaw(name string) (*Pattern, error)
GetRaw returns a pattern from storage without applying variable processing.
func (*PatternsEntity) GetWithoutVariables ¶ added in v1.4.289
func (o *PatternsEntity) GetWithoutVariables(source, input string) (pattern *Pattern, err error)
GetWithoutVariables returns a pattern with only the {{input}} placeholder processed and skips template variable replacement
func (*PatternsEntity) ListNames ¶
func (o *PatternsEntity) ListNames(shellCompleteList bool) (err error)
ListNames overrides StorageEntity.ListNames to use PatternsEntity.GetNames
func (*PatternsEntity) PrintLatestPatterns ¶
func (o *PatternsEntity) PrintLatestPatterns(latestNumber int) (err error)
func (*PatternsEntity) PrintPattern ¶ added in v1.4.446
func (o *PatternsEntity) PrintPattern(name string) (err error)
PrintPattern prints the raw contents of the named pattern to the terminal. It checks the custom patterns directory first, then falls back to the main directory.
type Session ¶
type Session struct {
Name string
Messages []*chat.ChatCompletionMessage
// contains filtered or unexported fields
}
func (*Session) Append ¶
func (o *Session) Append(messages ...*chat.ChatCompletionMessage)
func (*Session) GetLastMessage ¶
func (o *Session) GetLastMessage() (ret *chat.ChatCompletionMessage)
func (*Session) GetVendorMessages ¶
func (o *Session) GetVendorMessages() (ret []*chat.ChatCompletionMessage)
type SessionsEntity ¶
type SessionsEntity struct {
*StorageEntity
}
func (*SessionsEntity) Get ¶
func (o *SessionsEntity) Get(name string) (session *Session, err error)
func (*SessionsEntity) PrintSession ¶
func (o *SessionsEntity) PrintSession(name string) (err error)
func (*SessionsEntity) SaveSession ¶
func (o *SessionsEntity) SaveSession(session *Session) (err error)
type StorageEntity ¶
func (*StorageEntity) BuildFilePath ¶
func (o *StorageEntity) BuildFilePath(fileName string) (ret string)
func (*StorageEntity) BuildFilePathByName ¶
func (o *StorageEntity) BuildFilePathByName(name string) (ret string)
func (*StorageEntity) Configure ¶
func (o *StorageEntity) Configure() (err error)
func (*StorageEntity) Delete ¶
func (o *StorageEntity) Delete(name string) (err error)
func (*StorageEntity) Exists ¶
func (o *StorageEntity) Exists(name string) (ret bool)
func (*StorageEntity) GetNames ¶
func (o *StorageEntity) GetNames() (ret []string, err error)
GetNames finds all patterns in the patterns directory and enters the id, name, and pattern into a slice of Entry structs. it returns these entries or an error
func (*StorageEntity) ListNames ¶
func (o *StorageEntity) ListNames(shellCompleteList bool) (err error)
func (*StorageEntity) LoadAsJson ¶
func (o *StorageEntity) LoadAsJson(name string, item any) (err error)
func (*StorageEntity) Rename ¶
func (o *StorageEntity) Rename(oldName, newName string) (err error)
func (*StorageEntity) SaveAsJson ¶
func (o *StorageEntity) SaveAsJson(name string, item any) (err error)