Documentation
¶
Index ¶
- Variables
- type Agent
- func (a *Agent) AssignCallable(ctx context.Context, userInput string) (callable function.Callable, err error)
- func (a *Agent) AssignFunc(ctx context.Context, userInput string) (f *function.Function, rawParams []string, err error)
- func (a *Agent) GetFunc(funcName string) (*function.Function, error)
- func (a *Agent) RegisterFn(ctx context.Context, fn any, opts ...RegisterOption) (*function.Function, error)
- func (a *Agent) RegisterFunc(f *function.Function) error
- type Definer
- type FuncCallErr
- type FuncCreateErr
- type FuncStrParseErr
- type RegisterOption
- type RegisterOpts
- type Resolver
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmptyUserInputErr = errors.New("empty user input")
)
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
// contains filtered or unexported fields
}
func (*Agent) AssignCallable ¶
func (*Agent) AssignFunc ¶
func (a *Agent) AssignFunc(ctx context.Context, userInput string) (f *function.Function, rawParams []string, err error)
AssignFunc assigns the user input to the corresponding function.Function
func (*Agent) RegisterFn ¶
func (a *Agent) RegisterFn(ctx context.Context, fn any, opts ...RegisterOption) (*function.Function, error)
RegisterFn registers a golang function can be called the golang fn definition can be generated by the Definer according to options ignore idx in this case will not be considered
type FuncCallErr ¶
type FuncCallErr struct {
Msg string
}
func (FuncCallErr) Error ¶
func (e FuncCallErr) Error() string
type FuncCreateErr ¶
type FuncCreateErr struct {
Msg string
}
func (FuncCreateErr) Error ¶
func (e FuncCreateErr) Error() string
type FuncStrParseErr ¶
type FuncStrParseErr struct {
Msg string
}
func (FuncStrParseErr) Error ¶
func (e FuncStrParseErr) Error() string
type RegisterOption ¶
type RegisterOption func(*RegisterOpts)
func WithLoadDefDir ¶
func WithLoadDefDir(path string) RegisterOption
func WithOverwrite ¶
func WithOverwrite(overwrite bool) RegisterOption
func WithSaveDefDir ¶
func WithSaveDefDir(path string) RegisterOption
type RegisterOpts ¶
Click to show internal directories.
Click to hide internal directories.