Documentation ¶
Index ¶
- func Channel[T any]() *agentv0.Channel
- func Display(msg *agentv0.Message, data map[string]string) *agentv0.Question
- func Do[T any](ctx context.Context, agent Communicate, handler AnswerProvider) error
- func GetDefaultConfirm(options []*agentv0.Question, name string) (bool, error)
- func GetDefaultStringInput(options []*agentv0.Question, name string) (string, error)
- func NewChoice(msg *agentv0.Message, options ...*agentv0.Message) *agentv0.Question
- func NewConfirm(msg *agentv0.Message, defaultConfirm bool) *agentv0.Question
- func NewIntInput(msg *agentv0.Message, defaultValue int) *agentv0.Question
- func NewSelection(msg *agentv0.Message, options ...*agentv0.Message) *agentv0.Question
- func NewStringInput(msg *agentv0.Message, defaultValue string) *agentv0.Question
- func StateAsString(s *agentv0.Answer) string
- type AnswerProvider
- type ClientSession
- type Communicate
- type Generator
- type QuestionGenerator
- type Sequence
- type Server
- func (server *Server) Channels() []string
- func (server *Server) Communicate(ctx context.Context, req *agentv0.Engage) (*agentv0.InformationRequest, error)
- func (server *Server) Done(ctx context.Context, channel *agentv0.Channel) (*ServerSession, error)
- func (server *Server) Log(ctx context.Context)
- func (server *Server) Ready(s string) bool
- func (server *Server) Register(ctx context.Context, generator *Generator) error
- func (server *Server) RequiresCommunication(channel *agentv0.Channel) (*ServerContext, bool)
- type ServerContext
- type ServerSession
- func (session *ServerSession) Choice(stage string) (*agentv0.ChoiceAnswer, error)
- func (session *ServerSession) Confirm(stage string) (bool, error)
- func (session *ServerSession) GetInputString(stage string) (string, error)
- func (session *ServerSession) GetIntString(stage string) (int, error)
- func (session *ServerSession) GetState() map[string]*agentv0.Answer
- func (session *ServerSession) Input(stage string) (*agentv0.InputAnswer, error)
- func (session *ServerSession) Process(ctx context.Context, eng *agentv0.Engage) (*agentv0.InformationRequest, error)
- func (session *ServerSession) Ready() bool
- func (session *ServerSession) Selection(stage string) (*agentv0.SelectionAnswer, error)
- func (session *ServerSession) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Do ¶ added in v0.0.51
func Do[T any](ctx context.Context, agent Communicate, handler AnswerProvider) error
func GetDefaultConfirm ¶ added in v0.1.89
func GetDefaultStringInput ¶ added in v0.1.89
func NewConfirm ¶ added in v0.0.51
func NewIntInput ¶ added in v0.1.33
func NewSelection ¶ added in v0.0.51
func NewStringInput ¶ added in v0.0.51
func StateAsString ¶
Types ¶
type AnswerProvider ¶ added in v0.0.51
type ClientSession ¶ added in v0.0.51
type ClientSession struct {
// contains filtered or unexported fields
}
func NewClientSession ¶ added in v0.0.51
func NewClientSession(channel *agentv0.Channel, handler AnswerProvider) *ClientSession
func (*ClientSession) Engage ¶ added in v0.0.51
func (s *ClientSession) Engage(ctx context.Context, req *agentv0.InformationRequest) (*agentv0.Engage, error)
type Communicate ¶ added in v0.0.51
type Generator ¶ added in v0.0.51
type Generator struct { Kind string QuestionGenerator QuestionGenerator }
func New ¶ added in v0.0.51
func New[T any](gen QuestionGenerator) *Generator
type QuestionGenerator ¶ added in v0.0.51
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
func NewSequence ¶
type Server ¶ added in v0.0.51
type Server struct {
// contains filtered or unexported fields
}
Server is the Agent
func (*Server) Communicate ¶ added in v0.0.51
func (server *Server) Communicate(ctx context.Context, req *agentv0.Engage) (*agentv0.InformationRequest, error)
Communicate from the generator and sends back information request required
func (*Server) RequiresCommunication ¶ added in v0.0.51
func (server *Server) RequiresCommunication(channel *agentv0.Channel) (*ServerContext, bool)
type ServerContext ¶
type ServerContext struct {
// contains filtered or unexported fields
}
func NewServerContext ¶
func NewServerContext(_ context.Context, gen QuestionGenerator) *ServerContext
func (*ServerContext) Communicate ¶
func (c *ServerContext) Communicate(ctx context.Context, req *agentv0.Engage) (*agentv0.InformationRequest, error)
func (*ServerContext) Done ¶
func (c *ServerContext) Done() bool
type ServerSession ¶ added in v0.0.51
type ServerSession struct {
// contains filtered or unexported fields
}
func NewServerSession ¶ added in v0.0.51
func NewServerSession(generator QuestionGenerator) *ServerSession
func (*ServerSession) Choice ¶ added in v0.1.31
func (session *ServerSession) Choice(stage string) (*agentv0.ChoiceAnswer, error)
func (*ServerSession) Confirm ¶ added in v0.0.51
func (session *ServerSession) Confirm(stage string) (bool, error)
func (*ServerSession) GetInputString ¶ added in v0.0.51
func (session *ServerSession) GetInputString(stage string) (string, error)
func (*ServerSession) GetIntString ¶ added in v0.1.33
func (session *ServerSession) GetIntString(stage string) (int, error)
func (*ServerSession) GetState ¶ added in v0.0.91
func (session *ServerSession) GetState() map[string]*agentv0.Answer
func (*ServerSession) Input ¶ added in v0.0.51
func (session *ServerSession) Input(stage string) (*agentv0.InputAnswer, error)
func (*ServerSession) Process ¶ added in v0.0.51
func (session *ServerSession) Process(ctx context.Context, eng *agentv0.Engage) (*agentv0.InformationRequest, error)
func (*ServerSession) Ready ¶ added in v0.0.51
func (session *ServerSession) Ready() bool
func (*ServerSession) Selection ¶ added in v0.0.51
func (session *ServerSession) Selection(stage string) (*agentv0.SelectionAnswer, error)
func (*ServerSession) String ¶ added in v0.0.51
func (session *ServerSession) String() string
Click to show internal directories.
Click to hide internal directories.