Feat: add tools to tool map

This commit is contained in:
Grail Finder
2024-11-21 18:15:01 +03:00
parent 35340d8886
commit c35af03720
5 changed files with 130 additions and 23 deletions

View File

@@ -8,6 +8,11 @@ import (
"github.com/jmoiron/sqlx"
)
type FullRepo interface {
ChatHistory
Memories
}
type ChatHistory interface {
ListChats() ([]models.Chat, error)
GetChatByID(id uint32) (*models.Chat, error)
@@ -61,7 +66,7 @@ func (p ProviderSQL) RemoveChat(id uint32) error {
return err
}
func NewProviderSQL(dbPath string, logger *slog.Logger) ChatHistory {
func NewProviderSQL(dbPath string, logger *slog.Logger) FullRepo {
db, err := sqlx.Open("sqlite", dbPath)
if err != nil {
panic(err)