api

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextPostKey    = "post"
	ContextChannelKey = "channel"
	ContextBotKey     = "bot"
)
View Source
const (
	TitleThreadSummary     = "Thread Summary"
	TitleSummarizeUnreads  = "Summarize Unreads"
	TitleSummarizeChannel  = "Summarize Channel"
	TitleFindActionItems   = "Find Action Items"
	TitleFindOpenQuestions = "Find Open Questions"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AIBotInfo

type AIBotInfo struct {
	ID                 string                 `json:"id"`
	DisplayName        string                 `json:"displayName"`
	Username           string                 `json:"username"`
	LastIconUpdate     int64                  `json:"lastIconUpdate"`
	DMChannelID        string                 `json:"dmChannelID"`
	ChannelAccessLevel llm.ChannelAccessLevel `json:"channelAccessLevel"`
	ChannelIDs         []string               `json:"channelIDs"`
	UserAccessLevel    llm.UserAccessLevel    `json:"userAccessLevel"`
	UserIDs            []string               `json:"userIDs"`
}

type AIBotsResponse

type AIBotsResponse struct {
	Bots          []AIBotInfo `json:"bots"`
	SearchEnabled bool        `json:"searchEnabled"`
}

type API

type API struct {
	// contains filtered or unexported fields
}

API represents the HTTP API functionality for the plugin

func New

func New(
	bots *bots.MMBots,
	conversationsService *conversations.Conversations,
	meetingsService *meetings.Service,
	indexerService *indexer.Indexer,
	searchService *search.Search,
	pluginAPI *pluginapi.Client,
	metricsService metrics.Metrics,
	llmContextBuilder *llmcontext.Builder,
	config Config,
	prompts *llm.Prompts,
	mmClient mmapi.Client,
	dbClient *mmapi.DBClient,
	licenseChecker *enterprise.LicenseChecker,
	streamingService streaming.Service,
	i18nBundle *i18n.Bundle,
) *API

New creates a new API instance

func (*API) MattermostAuthorizationRequired

func (a *API) MattermostAuthorizationRequired(c *gin.Context)

func (*API) ServeHTTP

func (a *API) ServeHTTP(c *plugin.Context, w http.ResponseWriter, r *http.Request)

ServeHTTP handles HTTP requests to the plugin

func (*API) ServeMetrics

func (a *API) ServeMetrics(c *plugin.Context, w http.ResponseWriter, r *http.Request)

ServeMetrics serves the metrics endpoint

type Config

type Config interface {
	GetDefaultBotName() string
}

type SearchRequest

type SearchRequest struct {
	Query      string `json:"query"`
	TeamID     string `json:"teamId"`
	ChannelID  string `json:"channelId"`
	MaxResults int    `json:"maxResults"`
}

SearchRequest represents a search query request from the API

type SimpleCompletionRequest

type SimpleCompletionRequest struct {
	SystemPrompt    string         `json:"systemPrompt"`
	UserPrompt      string         `json:"userPrompt"`
	BotUsername     string         `json:"botUsername"`
	RequesterUserID string         `json:"requesterUserID"`
	Parameters      map[string]any `json:"parameters"`
}

Jump to

Keyboard shortcuts

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