Documentation
¶
Index ¶
- Constants
- type AIBotInfo
- type AIBotsResponse
- type API
- type ClearMCPToolsCacheResponse
- type Config
- type FetchModelsRequest
- type MCPClientManager
- type MCPServerInfo
- type MCPToolInfo
- type MCPToolsResponse
- type RawSearchRequest
- type RawSearchResponse
- type RawSearchResult
- type ReindexRequest
- type SearchRequest
Constants ¶
const ( ContextPostKey = "post" ContextChannelKey = "channel" ContextBotKey = "bot" )
const ( TitleSummarizeUnreads = "Summarize Unreads" TitleSummarizeChannel = "Summarize Channel" )
const ( TitleThreadSummary = "Thread Summary" TitleFindActionItems = "Action Items" TitleFindOpenQuestions = "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 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, mcpClientManager MCPClientManager, mcpHandlers *mcpserver.PluginMCPHandlers, llmUpstreamHTTPClient *http.Client, getSearchInitError func() string, ) *API
New creates a new API instance
func (*API) MattermostAuthorizationRequired ¶
func (*API) ServeMetrics ¶
ServeMetrics serves the metrics endpoint
type ClearMCPToolsCacheResponse ¶ added in v1.5.0
type ClearMCPToolsCacheResponse struct {
ClearedServers int `json:"cleared_servers"`
Message string `json:"message"`
}
ClearMCPToolsCacheResponse represents the response for clearing the cache
type Config ¶
type Config interface {
GetDefaultBotName() string
MCP() mcp.Config
AllowUnsafeLinks() bool
EmbeddingSearchConfig() embeddings.EmbeddingSearchConfig
EnableChannelMentionToolCalling() bool
}
type FetchModelsRequest ¶ added in v1.7.0
type MCPClientManager ¶ added in v1.4.0
type MCPClientManager interface {
GetOAuthManager() *mcp.OAuthManager
GetToolsCache() *mcp.ToolsCache
GetHTTPClient() *http.Client
ProcessOAuthCallback(ctx context.Context, loggedInUserID, state, code string) (*mcp.OAuthSession, error)
GetEmbeddedServer() mcp.EmbeddedMCPServer
EnsureMCPSessionID(userID string) (string, error)
}
type MCPServerInfo ¶ added in v1.4.0
type MCPServerInfo struct {
Name string `json:"name"`
URL string `json:"url"`
Tools []MCPToolInfo `json:"tools"`
NeethsOAuth bool `json:"needsOAuth"`
OAuthURL string `json:"oauthURL,omitempty"` // URL to redirect for OAuth if needed
Error *string `json:"error"`
}
MCPServerInfo represents a server and its tools for API response
type MCPToolInfo ¶ added in v1.4.0
type MCPToolInfo struct {
Name string `json:"name"`
Description string `json:"description"`
InputSchema any `json:"inputSchema"`
}
MCPToolInfo represents a tool from an MCP server for API response
type MCPToolsResponse ¶ added in v1.4.0
type MCPToolsResponse struct {
Servers []MCPServerInfo `json:"servers"`
}
MCPToolsResponse represents the response structure for MCP tools endpoint
type RawSearchRequest ¶ added in v1.14.0
type RawSearchRequest struct {
Query string `json:"query"`
TeamID string `json:"team_id,omitempty"`
ChannelID string `json:"channel_id,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
}
RawSearchRequest represents the request body for the raw semantic search endpoint
type RawSearchResponse ¶ added in v1.14.0
type RawSearchResponse struct {
Results []RawSearchResult `json:"results"`
}
RawSearchResponse represents the response body for the raw semantic search endpoint
type RawSearchResult ¶ added in v1.14.0
type RawSearchResult struct {
PostID string `json:"post_id"`
ChannelID string `json:"channel_id"`
ChannelName string `json:"channel_name"`
UserID string `json:"user_id"`
Username string `json:"username"`
Content string `json:"content"`
Score float32 `json:"score"`
}
RawSearchResult represents a single raw semantic search result
type ReindexRequest ¶ added in v1.14.0
type ReindexRequest struct {
ClearIndex *bool `json:"clearIndex"`
}
ReindexRequest represents the request body for reindexing