Documentation
¶
Index ¶
- func New(cfg Config, deps Deps) (agentkit.Platform, error)
- type Config
- type Deps
- type Platform
- func (p *Platform) AddDoneReaction(rctx any)
- func (p *Platform) BuildRichCard(status cardStatus, title string, steps []toolStep, markdown string, ...) string
- func (p *Platform) DeletePreviewMessage(ctx context.Context, previewHandle any) error
- func (p *Platform) IsMessageRecalled(ctx context.Context, rctx any) (bool, error)
- func (p *Platform) PermissionCapability() permission.Capability
- func (p *Platform) PlatformID() string
- func (p *Platform) Receive(ctx context.Context) (agentkit.MessageEvent, error)
- func (p *Platform) ReconstructReplyCtx(sessionKey string) (any, error)
- func (p *Platform) RefreshCard(ctx context.Context, sessionKey string, card *common.Card) error
- func (p *Platform) Reply(ctx context.Context, rctx any, content string) error
- func (p *Platform) ReplyCard(ctx context.Context, rctx replyContext, card *common.Card) error
- func (p *Platform) Send(ctx context.Context, event agentkit.OutboundEvent) error
- func (p *Platform) SendAudio(ctx context.Context, rctx any, audio []byte, format string) error
- func (p *Platform) SendFile(ctx context.Context, rctx any, file common.FileAttachment) error
- func (p *Platform) SendImage(ctx context.Context, rctx any, img common.ImageAttachment) error
- func (p *Platform) SendPreviewStart(ctx context.Context, rctx any, content string) (any, error)
- func (p *Platform) SetPreviewStatus(previewHandle any, status cardStatus)
- func (p *Platform) SplitMarkdownByTables(md string, maxTables int) []string
- func (p *Platform) StartTyping(ctx context.Context, rctx any) (stop func())
- func (p *Platform) UpdateMessage(ctx context.Context, previewHandle any, content string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
common.AgentRoutingConfig
AppID string `json:"appId"`
AppSecret string `json:"appSecret"`
Domain string `json:"domain"`
AllowFrom string `json:"allowFrom"`
AllowChat string `json:"allowChat"`
GroupReplyAll bool `json:"groupReplyAll"`
ThreadIsolation bool `json:"threadIsolation"`
ReactionEmoji string `json:"reactionEmoji"`
DoneEmoji string `json:"doneEmoji"`
GroupOnly bool `json:"groupOnly"`
RespondToAtEveryoneAndHere bool `json:"respondToAtEveryoneAndHere"`
ReplyToTrigger *bool `json:"replyToTrigger"`
ResolveMentions bool `json:"resolveMentions"`
PeerBots map[string]string `json:"peerBots"`
ProgressStyle string `json:"progressStyle"`
EnableFeishuCard *bool `json:"enableFeishuCard"`
EncryptKey string `json:"encryptKey"`
Port string `json:"port"`
CallbackPath string `json:"callbackPath"`
}
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
func (*Platform) AddDoneReaction ¶
AddDoneReaction adds a "done" emoji reaction so the user gets a push notification when the agent finishes a multi-round turn in quiet mode.
func (*Platform) BuildRichCard ¶
func (p *Platform) BuildRichCard(status cardStatus, title string, steps []toolStep, markdown string, streaming bool, elapsed time.Duration) string
BuildRichCard implements core.RichCardSupporter. Feishu engine passes an elapsed duration via the preview handle; buildRichCard itself is the renderer and must be called with the duration from engine state.
func (*Platform) DeletePreviewMessage ¶
DeletePreviewMessage removes a preview message so the caller can send a separate final message without leaving a stale interactive card behind.
func (*Platform) IsMessageRecalled ¶
func (*Platform) PermissionCapability ¶
func (p *Platform) PermissionCapability() permission.Capability
func (*Platform) PlatformID ¶
func (*Platform) ReconstructReplyCtx ¶
func (*Platform) RefreshCard ¶
func (*Platform) SendAudio ¶
SendAudio uploads audio bytes to Feishu and sends a voice message. Implements core.AudioSender interface. Feishu audio messages require opus format; non-opus input is converted via ffmpeg.
func (*Platform) SendPreviewStart ¶
SendPreviewStart sends a new card message and returns a handle for subsequent edits. Using card (interactive) type for both preview and final message so updates are in-place without needing to delete and resend.
func (*Platform) SetPreviewStatus ¶
SetPreviewStatus updates the card header color to reflect the agent's current state.
func (*Platform) SplitMarkdownByTables ¶
SplitMarkdownByTables implements core.MarkdownTableSplitter.
func (*Platform) StartTyping ¶
StartTyping adds an emoji reaction to the user's message and returns a stop function that removes the reaction when processing is complete.