Documentation ¶
Index ¶
- type Context
- type ContextsEntity
- type Db
- type DirectoryChange
- type Pattern
- type PatternsEntity
- 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() (err error)
- func (o *StorageEntity) Load(name string) (ret []byte, err error)
- func (o *StorageEntity) LoadAsJson(name string, item interface{}) (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 interface{}) (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 }
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) PrintLatestPatterns ¶
func (o *PatternsEntity) PrintLatestPatterns(latestNumber int) (err error)
type Session ¶
type Session struct { Name string Messages []*goopenai.ChatCompletionMessage // contains filtered or unexported fields }
func (*Session) Append ¶
func (o *Session) Append(messages ...*goopenai.ChatCompletionMessage)
func (*Session) GetLastMessage ¶
func (o *Session) GetLastMessage() (ret *goopenai.ChatCompletionMessage)
func (*Session) GetVendorMessages ¶
func (o *Session) GetVendorMessages() (ret []*goopenai.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() (err error)
func (*StorageEntity) LoadAsJson ¶
func (o *StorageEntity) LoadAsJson(name string, item interface{}) (err error)
func (*StorageEntity) Rename ¶
func (o *StorageEntity) Rename(oldName, newName string) (err error)
func (*StorageEntity) SaveAsJson ¶
func (o *StorageEntity) SaveAsJson(name string, item interface{}) (err error)
Click to show internal directories.
Click to hide internal directories.