Documentation
¶
Overview ¶
Package steer provides persistent user steering for autonomous conversations.
Index ¶
- Constants
- func FormatPendingNotice(content string, imageCount int) string
- type Message
- type Store
- func (s *Store) Close() error
- func (s *Store) Consume(ctx context.Context, conversationID string) ([]Message, error)
- func (s *Store) Enqueue(ctx context.Context, conversationID, content string, images []string) (bool, error)
- func (s *Store) HasPending(ctx context.Context, conversationID string) (bool, error)
- func (s *Store) Peek(ctx context.Context, conversationID string) ([]Message, error)
- type StoreOption
Constants ¶
const MaxMessageLength = 10000
Variables ¶
This section is empty.
Functions ¶
func FormatPendingNotice ¶
FormatPendingNotice renders the user-facing notice shown when queued steering is injected.
Types ¶
type Message ¶
type Message struct {
Role string `json:"role"`
Content string `json:"content"`
Images []string `json:"images,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
Message represents a queued steering message.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages the steering queue in Kodelet's shared SQLite database.
func NewSteerStore ¶
func NewSteerStore(ctx context.Context, opts ...StoreOption) (*Store, error)
NewSteerStore opens the shared SQLite database. Database migrations must be applied before the store is used.
func (*Store) Consume ¶
Consume atomically removes and returns all pending steering messages for a conversation.
func (*Store) Enqueue ¶
func (s *Store) Enqueue(ctx context.Context, conversationID, content string, images []string) (bool, error)
Enqueue appends a steering message and reports whether messages were already queued.
func (*Store) HasPending ¶
HasPending reports whether a conversation has queued steering messages.
type StoreOption ¶
type StoreOption func(*storeConfig)
StoreOption configures a steering store.
func WithDBPath ¶
func WithDBPath(dbPath string) StoreOption
WithDBPath overrides the shared database path. It is primarily useful for tests.