Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PlatformContains ¶ added in v0.0.320
PlatformContains reports whether platforms includes name.
func ResolvePlatforms ¶ added in v0.0.320
ResolvePlatforms returns the list of platforms to serve. Positional args take precedence; if none are given, configPlatforms (from config.yaml serve.platforms) is used as fallback.
Types ¶
type Options ¶ added in v0.0.320
type Options struct {
Host string
Port int
AuthMode string
Token string
TokenSource string
BasePath string
Title string
Platforms []string
// Runner executes the current serve implementation. It is intentionally a
// temporary seam: internal packages can be extracted without changing CLI
// behavior, and cmd/serve.go can already be reduced to constructing a Service
// and invoking Run.
Runner func(context.Context) error
}
Options describes the resolved inputs required to run the serve service.
The long-term goal for the serve command is for cmd/ to perform only flag parsing/validation and pass concrete values here. During the extraction, the legacy runner hook keeps behavior stable while serve orchestration is moved behind this package boundary incrementally.
type Platform ¶
type Platform interface {
// Name returns the platform identifier (e.g. "telegram").
Name() string
// NeedsSetup returns true when required configuration is missing.
NeedsSetup() bool
// RunSetup runs an interactive wizard to collect and persist configuration.
RunSetup() error
// Run starts the platform's message loop, blocking until ctx is cancelled.
Run(ctx context.Context, cfg *config.Config, settings Settings) error
}
Platform is the interface implemented by each messaging platform adapter.
type Service ¶ added in v0.0.320
type Service struct {
// contains filtered or unexported fields
}
Service owns serve orchestration.
func NewService ¶ added in v0.0.320
NewService constructs a serve service from resolved options.
type SessionRuntime ¶ added in v0.0.85
type SessionRuntime struct {
Engine *llm.Engine
Provider llm.Provider
ProviderName string
ModelName string
Cleanup func()
}
SessionRuntime is a per-conversation runtime for non-web platforms.
type Settings ¶
type Settings struct {
SystemPrompt string
IdleTimeout time.Duration
// TelegramCarryoverChars controls how many trailing characters from the
// previous Telegram session are carried into a replacement session.
// 0 disables carry-over.
TelegramCarryoverChars int
MaxTurns int
Debug bool
DebugRaw bool
Search bool
// ForceExternalSearch disables provider-native search and uses external
// web_search/read_url tools instead when search is enabled.
ForceExternalSearch bool
Tools string
MCP string
Agent string
PlatformMessages agents.PlatformMessagesConfig
Store session.Store
Runner runpkg.Runner
// NewSession creates a fresh runtime instance for a new conversation.
// Called once per platform session (for example, per Telegram chat session).
NewSession func(context.Context) (*SessionRuntime, error)
}
Settings holds per-platform runtime settings derived from CLI flags and config.
type TelegramPlatform ¶
type TelegramPlatform struct {
// contains filtered or unexported fields
}
func NewTelegramPlatform ¶
func NewTelegramPlatform(cfg config.TelegramServeConfig) *TelegramPlatform
NewTelegramPlatform creates a new TelegramPlatform with the given config.
func (*TelegramPlatform) Name ¶
func (p *TelegramPlatform) Name() string
func (*TelegramPlatform) NeedsSetup ¶
func (p *TelegramPlatform) NeedsSetup() bool
NeedsSetup returns true when the bot token is missing.
func (*TelegramPlatform) RunSetup ¶
func (p *TelegramPlatform) RunSetup() error
RunSetup runs an interactive wizard that collects and persists bot credentials.