conversations

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActivateAIProp  = "activate_ai"
	FromWebhookProp = "from_webhook"
	FromBotProp     = "from_bot"
	FromPluginProp  = "from_plugin"
	WranglerProp    = "wrangler"
)
View Source
const (
	ReferencedRecordingFileID  = "referenced_recording_file_id"
	ReferencedTranscriptPostID = "referenced_transcript_post_id"
)
View Source
const AnalysisTypeProp = "prompt_type"
View Source
const ThreadIDProp = "referenced_thread"

Variables

View Source
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 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,
) *Conversations

func (*Conversations) BotCreateNonResponsePost

func (c *Conversations) BotCreateNonResponsePost(botid string, requesterUserID string, post *model.Post) error

func (*Conversations) GenerateTitle

func (c *Conversations) GenerateTitle(bot *bots.Bot, request string, postID string, context *llm.Context) error

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) MessageHasBeenPosted

func (c *Conversations) MessageHasBeenPosted(ctx *plugin.Context, post *model.Post)

func (*Conversations) PostToAIPost

func (c *Conversations) PostToAIPost(bot *bots.Bot, post *model.Post) llm.Post

func (*Conversations) ProcessUserRequest

func (c *Conversations) ProcessUserRequest(bot *bots.Bot, postingUser *model.User, channel *model.Channel, post *model.Post) (*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) (*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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL