Documentation
¶
Index ¶
- type Skill
- func (instance *Skill) AddKnowledge(filename, content string) *Skill
- func (instance *Skill) Clone() (response *Skill)
- func (instance *Skill) Deploy() (err error)
- func (instance *Skill) Description() (response string)
- func (instance *Skill) GetSystemRendered() (response string)
- func (instance *Skill) IsOpened() (response bool)
- func (instance *Skill) Knowledge() (response map[string]string)
- func (instance *Skill) KnowledgeKeys() (response []string)
- func (instance *Skill) KnowledgeNames() (response []string)
- func (instance *Skill) Map() (response map[string]interface{})
- func (instance *Skill) Model() (response string)
- func (instance *Skill) ModelOptions() (response map[string]interface{})
- func (instance *Skill) ModelOptionsValue(field string) (response interface{})
- func (instance *Skill) ModelOptionsValueAsString(field string) (response string)
- func (instance *Skill) Name() (response string)
- func (instance *Skill) Open() (err error)
- func (instance *Skill) Options() (response *SkillOptions)
- func (instance *Skill) PromptGet(uid, lang string) (response *prompts.Prompt, err error)
- func (instance *Skill) PromptGetText(uid, lang string) (response string)
- func (instance *Skill) PromptReset() *Skill
- func (instance *Skill) Prompts() (response *prompts.PromptPackages)
- func (instance *Skill) RagOptions() (response map[string]interface{})
- func (instance *Skill) Root() (response string)
- func (instance *Skill) SetDescription(v string) *Skill
- func (instance *Skill) SetModel(v string) *Skill
- func (instance *Skill) SetName(v string) *Skill
- func (instance *Skill) SetOverwrite(v bool) *Skill
- func (instance *Skill) SetRAGContext(data []map[string]interface{}, userPayload map[string]interface{}, ...)
- func (instance *Skill) SetRoot(v string) *Skill
- func (instance *Skill) SetRootVector(v string) *Skill
- func (instance *Skill) SetSystem(v string) *Skill
- func (instance *Skill) SetUid(v string) *Skill
- func (instance *Skill) String() string
- func (instance *Skill) System() (response string)
- func (instance *Skill) Uid() (response string)
- type SkillActionOptions
- type SkillOptions
- type Skills
- func (instance *Skills) Add(v interface{}) (response *Skills)
- func (instance *Skills) Clone(uid string) (response *Skill)
- func (instance *Skills) Contains(uid string) bool
- func (instance *Skills) Count() int
- func (instance *Skills) Deploy() (err error)
- func (instance *Skills) ForEach(f func(skill *Skill) error) (err error)
- func (instance *Skills) Get(uid string) (skill *Skill)
- func (instance *Skills) GetAll(skillUid, promptName, promptLang string) (skill *Skill, prompt *prompts.Prompt)
- func (instance *Skills) Has(uid string) bool
- func (instance *Skills) Knowledge(detailed bool) (response []map[string]interface{})
- func (instance *Skills) List() (response []map[string]interface{})
- func (instance *Skills) Map() (response map[string]interface{})
- func (instance *Skills) Names() (response []string)
- func (instance *Skills) NewSkill(uid string) (skill *Skill, err error)
- func (instance *Skills) NewSkillFromDir(dir string) (skill *Skill, err error)
- func (instance *Skills) NewSkillFromPackage(pkg *prompts.PromptPackage) (skill *Skill, err error)
- func (instance *Skills) NewSkillWithPrompts(prompts *prompts.PromptPackages) (skill *Skill, err error)
- func (instance *Skills) Overwrite() bool
- func (instance *Skills) PackageNames() (response []string)
- func (instance *Skills) PromptCount() (response int)
- func (instance *Skills) PromptGet(skillName, packageName, promptName, lang string) (response *prompts.Prompt)
- func (instance *Skills) PromptGetDefault(promptName string) (response *prompts.Prompt)
- func (instance *Skills) PromptHasUpload(skillName string) (response bool)
- func (instance *Skills) PromptNames() (response []string)
- func (instance *Skills) PromptNamesFromPackage(packageName string) (response []string)
- func (instance *Skills) PromptNamesMap() (response []map[string]interface{})
- func (instance *Skills) Root() string
- func (instance *Skills) SetOverwrite(v bool) *Skills
- func (instance *Skills) SetRoot(v string) *Skills
- func (instance *Skills) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Skill ¶
type Skill struct {
// contains filtered or unexported fields
}
func (*Skill) AddKnowledge ¶
func (*Skill) Clone ¶
Clone creates a copy of the current Skill instance with a unique UID and cloned properties.
func (*Skill) Description ¶
func (*Skill) GetSystemRendered ¶
func (*Skill) KnowledgeKeys ¶
func (*Skill) KnowledgeNames ¶
KnowledgeNames extracts and returns a list of knowledge resource names derived from knowledge keys in the Skill instance. The list is an array of "collection" names
func (*Skill) ModelOptions ¶
func (*Skill) ModelOptionsValue ¶
func (*Skill) ModelOptionsValueAsString ¶
func (*Skill) Options ¶
func (instance *Skill) Options() (response *SkillOptions)
func (*Skill) PromptGetText ¶ added in v0.3.71
func (*Skill) PromptReset ¶
func (*Skill) Prompts ¶
func (instance *Skill) Prompts() (response *prompts.PromptPackages)
func (*Skill) RagOptions ¶
func (*Skill) SetDescription ¶
func (*Skill) SetOverwrite ¶
func (*Skill) SetRAGContext ¶
func (*Skill) SetRoot ¶
SetRoot sets the root directory for the Skill instance. If the provided directory name differs from the instance's name, it concatenates the name with the provided path. Returns the Skill instance.
func (*Skill) SetRootVector ¶
type SkillActionOptions ¶
type SkillActionOptions struct { Name string `json:"name"` // name of this action Description string `json:"description"` // description of this action Command string `json:"command"` // command to perform }
func (*SkillActionOptions) Map ¶
func (instance *SkillActionOptions) Map() (response map[string]interface{})
func (*SkillActionOptions) String ¶
func (instance *SkillActionOptions) String() (response string)
type SkillOptions ¶
type SkillOptions struct { Uid string `json:"uid"` // unique identifier Name string `json:"name"` // name of this skill Description string `json:"description"` // description of this skill Overwrite bool `json:"overwrite"` // overwrite prompts on deploy Model string `json:"model"` // required model System string `json:"system"` // filename or text for context refining ModelOptions map[string]interface{} `json:"model_options"` // optional parameters for model RagOptions map[string]interface{} `json:"rag_options"` // optional parameters for rag Parameters map[string]interface{} `json:"parameters"` // skill parameters Actions []*SkillActionOptions `json:"actions"` // defines the list of actions that the skill can perform. }
func NewSkillOptions ¶
func NewSkillOptions(args ...interface{}) (instance *SkillOptions, err error)
func (*SkillOptions) Clone ¶
func (instance *SkillOptions) Clone() (response *SkillOptions)
func (*SkillOptions) Map ¶
func (instance *SkillOptions) Map() (response map[string]interface{})
func (*SkillOptions) String ¶
func (instance *SkillOptions) String() (response string)
type Skills ¶
type Skills struct {
// contains filtered or unexported fields
}
func (*Skills) Deploy ¶
Deploy initializes and deploys all skills within the Skills struct. It creates the root directory if it does not exist and calls the Deploy method for each skill. Returns an error if directory creation or skill deployment fails.
func (*Skills) GetAll ¶
func (instance *Skills) GetAll(skillUid, promptName, promptLang string) (skill *Skill, prompt *prompts.Prompt)
GetAll retrieves a skill and a corresponding prompt based on the provided skill UID, prompt name, and prompt language. It locks the instance for thread safety and ensures the skill and prompt exist before returning them.
func (*Skills) NewSkillFromDir ¶
func (*Skills) NewSkillFromPackage ¶
func (instance *Skills) NewSkillFromPackage(pkg *prompts.PromptPackage) (skill *Skill, err error)
func (*Skills) NewSkillWithPrompts ¶
func (instance *Skills) NewSkillWithPrompts(prompts *prompts.PromptPackages) (skill *Skill, err error)
func (*Skills) PackageNames ¶
func (*Skills) PromptCount ¶
func (*Skills) PromptGetDefault ¶
func (*Skills) PromptHasUpload ¶
PromptHasUpload checks if a given skill has an associated upload prompt available. Returns true if it exists.