Documentation ¶
Overview ¶
Service natural provides a conversational interface to the sarif network.
Index ¶
- Variables
- func ParseSimple(ctx *natural.Context) (*natural.ParseResult, error)
- type Actionable
- type Annotator
- type Config
- type Conversation
- type Dependencies
- type MsgErrNatural
- type Parser
- type Service
- func (s *Service) AnnotateReply(msg sarif.Message) sarif.Message
- func (s *Service) Enable() error
- func (s *Service) Parse(ctx *natural.Context) (*natural.ParseResult, error)
- func (s *Service) ParseRegular(ctx *natural.Context) (*natural.ParseResult, error)
- func (s *Service) TransformReply(text string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var Module = &services.Module{ Name: "natural", Version: "1.0", NewInstance: NewService, }
Functions ¶
func ParseSimple ¶
func ParseSimple(ctx *natural.Context) (*natural.ParseResult, error)
Types ¶
type Actionable ¶
type Actionable struct { Action *schema.Action `json:"action"` Actions []*schema.Action `json:"actions"` }
func (Actionable) IsAction ¶
func (a Actionable) IsAction() bool
type Conversation ¶
type Conversation struct { Device string LastTime time.Time LastMessage sarif.Message LastMessageAction Actionable LastUserTime time.Time LastUserText string LastUserMessage sarif.Message // contains filtered or unexported fields }
func (*Conversation) HandleClientMessage ¶
func (cv *Conversation) HandleClientMessage(msg sarif.Message)
func (*Conversation) PublishForClient ¶
func (cv *Conversation) PublishForClient(msg sarif.Message)
func (*Conversation) SendToClient ¶
func (cv *Conversation) SendToClient(msg sarif.Message)
type MsgErrNatural ¶
type MsgErrNatural struct { Original string `json:"original"` Type string `json:"-"` Action interface{} `json:"action"` Result *natural.ParseResult `json:"result"` }
func (MsgErrNatural) String ¶
func (pl MsgErrNatural) String() string
type Service ¶
type Service struct { Config services.Config Cfg Config sarif.Client ParserKeepAlive time.Duration // contains filtered or unexported fields }
func NewService ¶
func NewService(deps *Dependencies) *Service
func (*Service) ParseRegular ¶
func (*Service) TransformReply ¶
Click to show internal directories.
Click to hide internal directories.