serve

package
v0.0.113 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 SessionRuntime added in v0.0.85

type SessionRuntime struct {
	Engine       *llm.Engine
	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
	Store               session.Store
	// 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) Run

func (p *TelegramPlatform) Run(ctx context.Context, cfg *config.Config, settings Settings) error

Run starts the Telegram bot loop, blocking until ctx is cancelled.

func (*TelegramPlatform) RunSetup

func (p *TelegramPlatform) RunSetup() error

RunSetup runs an interactive wizard that collects and persists bot credentials.

Jump to

Keyboard shortcuts

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