Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conversation ¶
type Conversation interface { // GetID returns the unique identifier of the conversation. GetID() string // GetCreatedAt returns the time when the conversation was created. GetCreatedAt() time.Time // GetMessages returns all messages in the conversation, ordered by creation date. GetMessages() []Message // RemoveMessage deletes a message from the conversation by its ID. RemoveMessage(id uuid.UUID) // AddMessage appends a new message to the conversation. AddMessage(message Message) // WithPrompt attaches a prompt to the conversation. WithPrompt(prompt prompts.Prompt) // Reset clears the conversation but retains system messages. Reset() (Conversation, error) // Clean removes all messages from the conversation, including system messages. Clean() (Conversation, error) }
func NewStackedConversation ¶
func NewStackedConversation( repo Repository, ) Conversation
type Message ¶
type Message struct { ID uuid.UUID `json:"id"` Role Role `json:"role"` Content string `json:"content"` CreatedAt time.Time `json:"created_at"` IsFile bool `json:"is_file"` }
func NewFileMessage ¶
func NewMessage ¶
type Repository ¶
type Repository interface { SaveConversation(conversation Conversation) error LoadConversation(id string) (Conversation, error) DeleteConversation(id string) error GetConversations() ([]Conversation, error) Close() error }
func NewSQLiteRepository ¶
func NewSQLiteRepository(dbPath string) (Repository, error)
Click to show internal directories.
Click to hide internal directories.