Documentation
¶
Overview ¶
Package inmem provides in-memory conversation storage. Use when the agent and worker run in the same process. For remote workers, use redis.
Index ¶
- type InMemoryConversation
- func (c *InMemoryConversation) AddMessage(ctx context.Context, id string, msg interfaces.Message) error
- func (c *InMemoryConversation) Clear(ctx context.Context, id string) error
- func (c *InMemoryConversation) IsDistributed() bool
- func (c *InMemoryConversation) ListMessages(ctx context.Context, id string, opts ...interfaces.ListMessagesOption) ([]interfaces.Message, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InMemoryConversation ¶
type InMemoryConversation struct {
// contains filtered or unexported fields
}
func NewInMemoryConversation ¶
func NewInMemoryConversation(options ...Option) *InMemoryConversation
func (*InMemoryConversation) AddMessage ¶
func (c *InMemoryConversation) AddMessage(ctx context.Context, id string, msg interfaces.Message) error
func (*InMemoryConversation) Clear ¶
func (c *InMemoryConversation) Clear(ctx context.Context, id string) error
func (*InMemoryConversation) IsDistributed ¶
func (c *InMemoryConversation) IsDistributed() bool
func (*InMemoryConversation) ListMessages ¶
func (c *InMemoryConversation) ListMessages(ctx context.Context, id string, opts ...interfaces.ListMessagesOption) ([]interfaces.Message, error)
type Option ¶
type Option func(*InMemoryConversation)
func WithMaxSize ¶
WithMaxSize sets the maximum number of messages to store per conversation.
Click to show internal directories.
Click to hide internal directories.