Documentation ¶
Index ¶
- func Channel[T any]() *agentv1.Channel
- func Display(msg *agentv1.Message, data map[string]string) *agentv1.Question
- func Do[T any](ctx context.Context, agent Communicate, handler AnswerProvider) error
- func NewChoice(msg *agentv1.Message, options ...*agentv1.Message) *agentv1.Question
- func NewConfirm(msg *agentv1.Message, defaultConfirm bool) *agentv1.Question
- func NewSelection(msg *agentv1.Message, options ...*agentv1.Message) *agentv1.Question
- func NewStringInput(msg *agentv1.Message, defaultValue string) *agentv1.Question
- func StateAsString(s *agentv1.Answer) string
- type AnswerProvider
- type ClientSession
- type Communicate
- type Generator
- type QuestionGenerator
- type Sequence
- type Server
- func (m *Server) Communicate(ctx context.Context, req *agentv1.Engage) (*agentv1.InformationRequest, error)
- func (m *Server) Done(ctx context.Context, channel *agentv1.Channel) (*ServerSession, error)
- func (m *Server) Ready(s string) bool
- func (m *Server) Register(ctx context.Context, generator *Generator) error
- func (m *Server) RequiresCommunication(channel *agentv1.Channel) (*ServerContext, bool)
- type ServerContext
- type ServerSession
- func (c *ServerSession) Confirm(stage string) (bool, error)
- func (c *ServerSession) GetInputString(stage string) (string, error)
- func (c *ServerSession) Input(stage string) (*agentv1.InputAnswer, error)
- func (c *ServerSession) Process(ctx context.Context, eng *agentv1.Engage) (*agentv1.InformationRequest, error)
- func (c *ServerSession) Ready() bool
- func (c *ServerSession) Selection(stage string) (*agentv1.SelectionAnswer, error)
- func (c *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 NewConfirm ¶ added in v0.0.51
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 *agentv1.Channel, handler AnswerProvider) *ClientSession
func (*ClientSession) Engage ¶ added in v0.0.51
func (s *ClientSession) Engage(ctx context.Context, req *agentv1.InformationRequest) (*agentv1.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 (m *Server) Communicate(ctx context.Context, req *agentv1.Engage) (*agentv1.InformationRequest, error)
Communicate from the generator and sends back information request required
func (*Server) RequiresCommunication ¶ added in v0.0.51
func (m *Server) RequiresCommunication(channel *agentv1.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 *agentv1.Engage) (*agentv1.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) Confirm ¶ added in v0.0.51
func (c *ServerSession) Confirm(stage string) (bool, error)
func (*ServerSession) GetInputString ¶ added in v0.0.51
func (c *ServerSession) GetInputString(stage string) (string, error)
func (*ServerSession) Input ¶ added in v0.0.51
func (c *ServerSession) Input(stage string) (*agentv1.InputAnswer, error)
func (*ServerSession) Process ¶ added in v0.0.51
func (c *ServerSession) Process(ctx context.Context, eng *agentv1.Engage) (*agentv1.InformationRequest, error)
func (*ServerSession) Ready ¶ added in v0.0.51
func (c *ServerSession) Ready() bool
func (*ServerSession) Selection ¶ added in v0.0.51
func (c *ServerSession) Selection(stage string) (*agentv1.SelectionAnswer, error)
func (*ServerSession) String ¶ added in v0.0.51
func (c *ServerSession) String() string
Click to show internal directories.
Click to hide internal directories.