Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface {
Execute(ctx context.Context, actionInfo *ActionInfo) (next bool, err error)
}
type ActionInfo ¶
type ActionInfo struct { Message *LarkMessage Result *ActionResult // 返回的消息。如果已经有了返回的消息,则不执行下一阶段。 }
func (*ActionInfo) ExistsResult ¶
func (a *ActionInfo) ExistsResult() bool
func (*ActionInfo) GetMessageID ¶
func (a *ActionInfo) GetMessageID() string
func (*ActionInfo) GetText ¶
func (a *ActionInfo) GetText() string
func (*ActionInfo) UsePlugin ¶
func (a *ActionInfo) UsePlugin() bool
type ActionResult ¶
type ActionResult struct { ReplyMsgID string Result string // may: text, base64 for image Type ActionResultType }
type ActionResultType ¶
type ActionResultType string
const ( ActionResultText ActionResultType = "text" ActionResultImageB64 ActionResultType = "image_b64" ActionResultHelpCard ActionResultType = "help_card" )
type FeishuEx ¶
type FeishuEx struct {
// contains filtered or unexported fields
}
func NewFeishuEx ¶
func NewFeishuEx(feishuer Feishuer, opts ...FeishuExOption) (*FeishuEx, error)
func (*FeishuEx) HandleMessageReceive ¶
func (f *FeishuEx) HandleMessageReceive(ctx context.Context, msg *LarkMessage) error
type FeishuExOption ¶
type FeishuExOption func(*FeishuEx)
type Feishuer ¶
type Feishuer interface {
Reply(ctx context.Context, actionResult *ActionResult) error
}
type FinalReply ¶
type FinalReply struct {
// contains filtered or unexported fields
}
func NewFinalReply ¶
func NewFinalReply(text string) *FinalReply
func (*FinalReply) Execute ¶
func (a *FinalReply) Execute(ctx context.Context, actionInfo *ActionInfo) (next bool, err error)
type HelperAction ¶
type HelperAction struct{}
HelperAction 帮助卡片
func NewHelperAction ¶
func NewHelperAction() *HelperAction
func (HelperAction) Execute ¶
func (h HelperAction) Execute(ctx context.Context, actionInfo *ActionInfo) (next bool, err error)
type LLMer ¶
type LLMer interface {
Chat(ctx context.Context, messages []LlmMessage) (*LlmAnswer, error)
}
type LarkMessage ¶
type LarkMessage larkim.EventMessage
func (LarkMessage) GetChatType ¶
func (m LarkMessage) GetChatType() consts.ChatType
func (LarkMessage) GetText ¶
func (m LarkMessage) GetText() string
func (LarkMessage) ID ¶
func (m LarkMessage) ID() string
func (LarkMessage) IsMentionAt ¶
func (m LarkMessage) IsMentionAt(name string) bool
type LlmMessage ¶
type MessageAction ¶
type MessageAction struct {
// contains filtered or unexported fields
}
func NewMessageAction ¶
func NewMessageAction(llmer LLMer) *MessageAction
func (MessageAction) Execute ¶
func (a MessageAction) Execute(ctx context.Context, actionInfo *ActionInfo) (next bool, err error)
type PluginAction ¶
type PluginAction struct {
// contains filtered or unexported fields
}
func NewPluginAction ¶
func NewPluginAction(manager *llmplugin.PluginManager) *PluginAction
func (PluginAction) Execute ¶
func (a PluginAction) Execute(ctx context.Context, actionInfo *ActionInfo) (next bool, err error)
type ProcessMentionAction ¶
type ProcessMentionAction struct {
// contains filtered or unexported fields
}
ProcessMentionAction 是否 @ 机器人
func NewProcessMentionAction ¶
func NewProcessMentionAction(botname string) *ProcessMentionAction
func (ProcessMentionAction) Execute ¶
func (a ProcessMentionAction) Execute(ctx context.Context, actionInfo *ActionInfo) (bool, error)
type ProcessUniqueAction ¶
type ProcessUniqueAction struct {
// contains filtered or unexported fields
}
func NewProcessUniqueAction ¶
func NewProcessUniqueAction() *ProcessUniqueAction
func (*ProcessUniqueAction) Execute ¶
func (a *ProcessUniqueAction) Execute(ctx context.Context, actionInfo *ActionInfo) (next bool, err error)
Click to show internal directories.
Click to hide internal directories.