Documentation
¶
Index ¶
- Constants
- Variables
- type AIThread
- type ConfigProvider
- type Conversations
- func (c *Conversations) BotCreateNonResponsePost(botid string, requesterUserID string, post *model.Post) error
- func (c *Conversations) GenerateTitle(bot *bots.Bot, request string, postID string, context *llm.Context) error
- func (c *Conversations) GetAIThreads(userID string) ([]AIThread, error)
- func (c *Conversations) HandleRegenerate(userID string, post *model.Post, channel *model.Channel) error
- func (c *Conversations) HandleToolCall(userID string, post *model.Post, channel *model.Channel, ...) error
- func (c *Conversations) HandleToolResult(userID string, post *model.Post, channel *model.Channel, ...) error
- func (c *Conversations) MessageHasBeenPosted(ctx *plugin.Context, post *model.Post)
- func (c *Conversations) PostToAIPost(bot *bots.Bot, post *model.Post) llm.Post
- func (c *Conversations) ProcessUserRequest(bot *bots.Bot, postingUser *model.User, channel *model.Channel, ...) (*llm.TextStreamResult, error)
- func (c *Conversations) ProcessUserRequestWithContext(bot *bots.Bot, postingUser *model.User, channel *model.Channel, ...) (*llm.TextStreamResult, error)
- func (c *Conversations) SaveTitle(threadID, title string) error
- func (c *Conversations) SaveTitleAsync(threadID, title string)
- func (c *Conversations) SetMeetingsService(meetingsService MeetingsService)
- func (c *Conversations) ThreadToLLMPosts(bot *bots.Bot, threadData *mmapi.ThreadData) []llm.Post
- type MeetingsService
Constants ¶
const ( ActivateAIProp = "activate_ai" FromWebhookProp = "from_webhook" FromBotProp = "from_bot" FromPluginProp = "from_plugin" WranglerProp = "wrangler" )
const ( ReferencedRecordingFileID = "referenced_recording_file_id" ReferencedTranscriptPostID = "referenced_transcript_post_id" )
const AnalysisTypeProp = "prompt_type"
const ThreadIDProp = "referenced_thread"
Variables ¶
var ErrChannelToolCallingDisabled = errors.New("channel tool calling is disabled")
ErrChannelToolCallingDisabled is returned when tool calling is attempted in a channel but the EnableChannelMentionToolCalling config flag is disabled.
var ( // ErrNoResponse is returned when no response is posted under a normal condition. ErrNoResponse = errors.New("no response") )
Functions ¶
This section is empty.
Types ¶
type AIThread ¶
type AIThread struct {
ID string `json:"id"`
Message string `json:"message"`
Title string `json:"title"`
ChannelID string `json:"channel_id"`
ReplyCount int `json:"reply_count"`
UpdateAt int64 `json:"update_at"`
}
AIThread represents a user's conversation with an AI
type ConfigProvider ¶ added in v1.8.1
type ConfigProvider interface {
EnableChannelMentionToolCalling() bool
AllowNativeWebSearchInChannels() bool
}
ConfigProvider provides configuration values for conversation behavior
type Conversations ¶
type Conversations struct {
// contains filtered or unexported fields
}
func New ¶
func New( prompts *llm.Prompts, mmClient mmapi.Client, streamingService streaming.Service, contextBuilder *llmcontext.Builder, botsService *bots.MMBots, db *mmapi.DBClient, licenseChecker *enterprise.LicenseChecker, i18nBundle *i18n.Bundle, meetingsService MeetingsService, configProvider ConfigProvider, ) *Conversations
func (*Conversations) BotCreateNonResponsePost ¶
func (*Conversations) GenerateTitle ¶
func (*Conversations) GetAIThreads ¶
func (c *Conversations) GetAIThreads(userID string) ([]AIThread, error)
GetAIThreads gets AI conversation threads for a user
func (*Conversations) HandleRegenerate ¶
func (c *Conversations) HandleRegenerate(userID string, post *model.Post, channel *model.Channel) error
HandleRegenerate handles post regeneration requests
func (*Conversations) HandleToolCall ¶
func (c *Conversations) HandleToolCall(userID string, post *model.Post, channel *model.Channel, acceptedToolIDs []string) error
HandleToolCall handles tool call approval/rejection
func (*Conversations) HandleToolResult ¶ added in v1.9.0
func (c *Conversations) HandleToolResult(userID string, post *model.Post, channel *model.Channel, acceptedToolIDs []string) error
HandleToolResult handles tool result approval after tool execution.
func (*Conversations) MessageHasBeenPosted ¶
func (c *Conversations) MessageHasBeenPosted(ctx *plugin.Context, post *model.Post)
func (*Conversations) PostToAIPost ¶
func (*Conversations) ProcessUserRequest ¶
func (c *Conversations) ProcessUserRequest(bot *bots.Bot, postingUser *model.User, channel *model.Channel, post *model.Post, allowToolsInChannel bool) (*llm.TextStreamResult, error)
ProcessUserRequest processes a user request to a bot
func (*Conversations) ProcessUserRequestWithContext ¶
func (c *Conversations) ProcessUserRequestWithContext(bot *bots.Bot, postingUser *model.User, channel *model.Channel, post *model.Post, context *llm.Context, allowToolsInChannel bool) (*llm.TextStreamResult, error)
ProcessUserRequestWithContext is an internal helper that uses an existing context to process a message
func (*Conversations) SaveTitle ¶
func (c *Conversations) SaveTitle(threadID, title string) error
SaveTitle saves a title for a thread
func (*Conversations) SaveTitleAsync ¶
func (c *Conversations) SaveTitleAsync(threadID, title string)
SaveTitleAsync saves a title asynchronously
func (*Conversations) SetMeetingsService ¶
func (c *Conversations) SetMeetingsService(meetingsService MeetingsService)
SetMeetingsService sets the meetings service (used to break circular dependency during initialization)
func (*Conversations) ThreadToLLMPosts ¶
func (c *Conversations) ThreadToLLMPosts(bot *bots.Bot, threadData *mmapi.ThreadData) []llm.Post
type MeetingsService ¶
type MeetingsService interface {
GetCaptionsFileIDFromProps(post *model.Post) (fileID string, err error)
SummarizeTranscription(bot *bots.Bot, transcription *subtitles.Subtitles, context *llm.Context) (*llm.TextStreamResult, error)
}
MeetingsService defines the interface for meetings functionality needed by conversations