Documentation
¶
Index ¶
- Variables
- type Action
- type ActionParameter
- type ActionParameterSet
- func (a *ActionParameterSet) AddParam(param *ActionParameter)
- func (a *ActionParameterSet) CheckRequiredParams() error
- func (a *ActionParameterSet) GetParam(name string) (*ActionParameter, error)
- func (a *ActionParameterSet) GetParams() []*ActionParameter
- func (a *ActionParameterSet) SetParam(key, value string)
- type ActionRequest
- func (creq *ActionRequest) GetContext() context.Context
- func (creq *ActionRequest) GetID() string
- func (creq *ActionRequest) GetMessage() *memory.Message
- func (creq *ActionRequest) GetSkipClose() bool
- func (creq *ActionRequest) GetWriter() writer_structs.ChloeWriter
- func (creq *ActionRequest) SetWriter(w writer_structs.ChloeWriter)
Constants ¶
This section is empty.
Variables ¶
View Source
var SuccessMessage = []byte(`{"success":true}`)
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { // GetName Get the name of the action GetName() string // GetDescription Get the description of the action GetDescription() string // GetNotification Get the notification message that will be sent when the action is executed GetNotification() string // SetParam Set the parameters of the action SetParam(string, string) // GetParam Get the value of a parameter GetParam(string) (string, error) // GetParams Get all parameters GetParams() []*ActionParameter // CheckRequiredParams Check if all required parameters are set CheckRequiredParams() error // SetMessage Set the message that triggered the action SetMessage(*memory.Message) // Execute The actual implementation of the action Execute(*ActionRequest) ([]*response_object_structs.ResponseObject, error) // RunPreActions Actions that will be executed before the action is executed RunPreActions(*ActionRequest) error // RunPostActions Actions that will be executed after the action is executed RunPostActions(*ActionRequest) error // GetSchema Get the schema of the action to be passed to `functions` GetSchema() *functions.FunctionDefinition // SkipFunctionCall Check if the action can be automatically executed by the AI SkipFunctionCall() bool }
type ActionParameter ¶
type ActionParameterSet ¶
type ActionParameterSet struct {
Params []*ActionParameter
}
func (*ActionParameterSet) AddParam ¶
func (a *ActionParameterSet) AddParam(param *ActionParameter)
func (*ActionParameterSet) CheckRequiredParams ¶
func (a *ActionParameterSet) CheckRequiredParams() error
func (*ActionParameterSet) GetParam ¶
func (a *ActionParameterSet) GetParam(name string) (*ActionParameter, error)
func (*ActionParameterSet) GetParams ¶
func (a *ActionParameterSet) GetParams() []*ActionParameter
func (*ActionParameterSet) SetParam ¶
func (a *ActionParameterSet) SetParam(key, value string)
type ActionRequest ¶
type ActionRequest struct { ID string Context context.Context Writer writer_structs.ChloeWriter SkipClose bool AutomaticallyCalled bool ErrorChannel chan error Action string Params map[string]string Count int Message *memory.Message `json:"message,omitempty"` }
func NewActionRequest ¶
func NewActionRequest() *ActionRequest
func (*ActionRequest) GetContext ¶
func (creq *ActionRequest) GetContext() context.Context
func (*ActionRequest) GetID ¶
func (creq *ActionRequest) GetID() string
func (*ActionRequest) GetMessage ¶
func (creq *ActionRequest) GetMessage() *memory.Message
func (*ActionRequest) GetSkipClose ¶
func (creq *ActionRequest) GetSkipClose() bool
func (*ActionRequest) GetWriter ¶
func (creq *ActionRequest) GetWriter() writer_structs.ChloeWriter
func (*ActionRequest) SetWriter ¶
func (creq *ActionRequest) SetWriter(w writer_structs.ChloeWriter)
Click to show internal directories.
Click to hide internal directories.