Documentation
¶
Overview ¶
Package telegrambot routes allowlisted Telegram messages to regular workers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
GetUpdates(context.Context, int64, int) ([]telegram.Update, error)
SendMessage(context.Context, int64, string) (telegram.Message, error)
SendDocument(context.Context, int64, string, []byte) (
telegram.Message, error,
)
Download(context.Context, string, int64) ([]byte, error)
}
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) Handle ¶
Handle admits at most one task per chat. Turns run outside the polling loop.
func (*Engine) NotifyCron ¶
type Options ¶
type Options struct {
Client Client
Runner Runner
Sessions Sessions
SessionReader SessionReader
Store *telegramstore.Store
Policy config.TelegramPolicy
Workspace string
AgentSpace string
Models []string
MaxMessageBytes int
MaxSystemPromptBytes int
MaxFileBytes int64
MaxImageBytes int
MaxImages int
}
type Runner ¶
type Runner interface {
Run(context.Context, control.ConversationRequest) (
*control.ConversationResult, error,
)
}
type SessionReader ¶
type Sessions ¶
type Sessions interface {
Open(context.Context, string, string) (control.OpenResult, error)
ResolveWorkspace(string) (string, error)
ValidateWorkspaceSession(context.Context, uuid.UUID) error
ReadWorkspaceFile(context.Context, uuid.UUID, string) (
control.WorkspaceFileContent, error,
)
WriteWorkspaceFile(context.Context, uuid.UUID, string, string, bool) (
control.WorkspaceFileEntry, error,
)
}
Click to show internal directories.
Click to hide internal directories.