Documentation
¶
Index ¶
- type BotInterface
- type Server
- func (s *Server) SetAgentLogRepo(repo storage.AgentLogRepository)
- func (s *Server) SetArtifactRepository(repo storage.ArtifactRepository)
- func (s *Server) SetFileStorage(fs files.Storage)
- func (s *Server) SetPeopleRepository(repo storage.PeopleRepository)
- func (s *Server) SetScopeRepository(repo storage.ScopeRepository)
- func (s *Server) Start(ctx context.Context) error
- type TopicWithMessages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BotInterface ¶ added in v0.3.0
type BotInterface interface {
HandleUpdateAsync(ctx context.Context, update json.RawMessage, remoteAddr string)
API() telegram.BotAPI
GetActiveSessions() ([]rag.ActiveSessionInfo, error)
ForceCloseSession(ctx context.Context, userID storage.ScopeID) (int, error)
ForceCloseSessionWithProgress(ctx context.Context, userID storage.ScopeID, onProgress rag.ProgressCallback) (*rag.ProcessingStats, error)
SendTestMessage(ctx context.Context, userID storage.ScopeID, text string, saveToHistory bool) (*rag.TestMessageResult, error)
// IsAllowedScope authorizes a scope id against the allowlists of all
// transports (Telegram + Mattermost), not just Telegram.
IsAllowedScope(scopeID storage.ScopeID) bool
}
BotInterface is an interface that abstracts the bot's functionality needed by the web server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(ctx context.Context, logger *slog.Logger, cfg *config.Config, factRepo storage.FactRepository, userRepo storage.UserRepository, statsRepo storage.StatsRepository, topicRepo storage.TopicRepository, msgRepo storage.MessageRepository, factHistoryRepo storage.FactHistoryRepository, maintenanceRepo storage.MaintenanceRepository, artifactRepo storage.ArtifactRepository, bot BotInterface, rag rag.MaintenanceService) (*Server, error)
func (*Server) SetAgentLogRepo ¶ added in v0.4.8
func (s *Server) SetAgentLogRepo(repo storage.AgentLogRepository)
SetAgentLogRepo sets the agent log repository (used for debug UI)
func (*Server) SetArtifactRepository ¶ added in v0.6.0
func (s *Server) SetArtifactRepository(repo storage.ArtifactRepository)
SetArtifactRepository sets the artifact repository (for debug UI).
func (*Server) SetFileStorage ¶ added in v0.10.0
SetFileStorage wires the artifact blob store used by the download handler to read artifact bytes (local disk or S3). Optional: when unset, downloads 500.
func (*Server) SetPeopleRepository ¶ added in v0.5.1
func (s *Server) SetPeopleRepository(repo storage.PeopleRepository)
SetPeopleRepository sets the people repository (v0.5.1)
func (*Server) SetScopeRepository ¶ added in v0.10.0
func (s *Server) SetScopeRepository(repo storage.ScopeRepository)
SetScopeRepository sets the scope repository, letting the dashboard label channel scopes (Time O/P/G) distinctly from person scopes. Optional: when unset (no resolver), every scope renders as a user.
type TopicWithMessages ¶ added in v0.5.1
type TopicWithMessages struct {
storage.TopicExtended
Messages []storage.Message
}
TopicWithMessages extends TopicExtended with loaded messages for UI display.