Documentation
¶
Index ¶
- Constants
- Variables
- func ModifyPostForBot(botid string, requesterUserID string, post *model.Post, ...)
- type Client
- type MMPostStreamService
- func (p *MMPostStreamService) FinishStreaming(postID string)
- func (p *MMPostStreamService) GetStreamingContext(inCtx context.Context, postID string) (context.Context, error)
- func (p *MMPostStreamService) StopStreaming(postID string)
- func (p *MMPostStreamService) StreamToNewDM(ctx context.Context, botID string, stream *llm.TextStreamResult, userID string, ...) error
- func (p *MMPostStreamService) StreamToNewPost(ctx context.Context, botID string, requesterUserID string, ...) error
- func (p *MMPostStreamService) StreamToPost(ctx context.Context, stream *llm.TextStreamResult, post *model.Post, ...)
- type Service
Constants ¶
View Source
const AnnotationsProp = "annotations"
View Source
const LLMRequesterUserID = "llm_requester_user_id"
View Source
const NoRegen = "no_regen"
View Source
const PostStreamingControlCancel = "cancel"
View Source
const PostStreamingControlEnd = "end"
View Source
const PostStreamingControlStart = "start"
View Source
const ReasoningSignatureProp = "reasoning_signature"
View Source
const ReasoningSummaryProp = "reasoning_summary"
View Source
const RespondingToProp = "responding_to"
View Source
const ToolCallProp = "pending_tool_call"
View Source
const UnsafeLinksPostProp = "unsafe_links"
Variables ¶
View Source
var ErrAlreadyStreamingToPost = fmt.Errorf("already streaming to post")
Functions ¶
Types ¶
type Client ¶ added in v1.7.0
type Client interface {
PublishWebSocketEvent(event string, payload map[string]interface{}, broadcast *model.WebsocketBroadcast)
UpdatePost(post *model.Post) error
CreatePost(post *model.Post) error
DM(senderID, receiverID string, post *model.Post) error
GetUser(userID string) (*model.User, error)
GetChannel(channelID string) (*model.Channel, error)
GetConfig() *model.Config
LogError(msg string, keyValuePairs ...interface{})
LogDebug(msg string, keyValuePairs ...interface{})
}
Client defines the minimal client interface needed for streaming operations.
type MMPostStreamService ¶
type MMPostStreamService struct {
// contains filtered or unexported fields
}
func NewMMPostStreamService ¶
func NewMMPostStreamService(mmClient Client, i18n *i18n.Bundle) *MMPostStreamService
func (*MMPostStreamService) FinishStreaming ¶
func (p *MMPostStreamService) FinishStreaming(postID string)
FinishStreaming should be called when a post streaming operation is finished on success or failure. It is safe to call multiple times, must be called at least once.
func (*MMPostStreamService) GetStreamingContext ¶
func (*MMPostStreamService) StopStreaming ¶
func (p *MMPostStreamService) StopStreaming(postID string)
func (*MMPostStreamService) StreamToNewDM ¶
func (*MMPostStreamService) StreamToNewPost ¶
func (*MMPostStreamService) StreamToPost ¶
func (p *MMPostStreamService) StreamToPost(ctx context.Context, stream *llm.TextStreamResult, post *model.Post, userLocale string)
StreamToPost streams the result of a TextStreamResult to a post. it will internally handle logging needs and updating the post.
type Service ¶
type Service interface {
StreamToNewPost(ctx context.Context, botID string, requesterUserID string, stream *llm.TextStreamResult, post *model.Post, respondingToPostID string) error
StreamToNewDM(ctx context.Context, botID string, stream *llm.TextStreamResult, userID string, post *model.Post, respondingToPostID string) error
StreamToPost(ctx context.Context, stream *llm.TextStreamResult, post *model.Post, userLocale string)
StopStreaming(postID string)
GetStreamingContext(inCtx context.Context, postID string) (context.Context, error)
FinishStreaming(postID string)
}
Click to show internal directories.
Click to hide internal directories.