From c35af037203ac5c39a4f704d5343bc2b5cc56a0c Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Thu, 21 Nov 2024 18:15:01 +0300 Subject: Feat: add tools to tool map --- storage/storage.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'storage/storage.go') diff --git a/storage/storage.go b/storage/storage.go index 67b8dd8..7d0d941 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -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) -- cgit v1.2.3