From b0b2f4f9c845a9b83a35c5096097e570a300504b Mon Sep 17 00:00:00 2001 From: Rick Hennigan Date: Fri, 6 Dec 2024 10:46:15 -0500 Subject: [PATCH] Added `InstallVectorDatabases` as exported symbol --- PacletInfo.wl | 2 +- Source/Chatbook/Main.wl | 2 ++ .../Chatbook/PromptGenerators/VectorDatabases.wl | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/PacletInfo.wl b/PacletInfo.wl index 96d524d5..c7e38550 100644 --- a/PacletInfo.wl +++ b/PacletInfo.wl @@ -1,7 +1,7 @@ PacletObject[ <| "Name" -> "Wolfram/Chatbook", "PublisherID" -> "Wolfram", - "Version" -> "1.5.2.21", + "Version" -> "1.5.2.22", "WolframVersion" -> "14.1+", "Description" -> "Wolfram Notebooks + LLMs", "License" -> "MIT", diff --git a/Source/Chatbook/Main.wl b/Source/Chatbook/Main.wl index a822c767..1b077a8c 100644 --- a/Source/Chatbook/Main.wl +++ b/Source/Chatbook/Main.wl @@ -66,6 +66,7 @@ BeginPackage[ "Wolfram`Chatbook`" ]; `GetExpressionURIs; `GetFocusedNotebook; `InlineTemplateBoxes; +`InstallVectorDatabases; `InvalidateServiceCache; `ListSavedChats; `LoadChat; @@ -232,6 +233,7 @@ $ChatbookProtectedNames = "Wolfram`Chatbook`" <> # & /@ { "GetExpressionURIs", "GetFocusedNotebook", "InlineTemplateBoxes", + "InstallVectorDatabases", "ListSavedChats", "LoadChat", "LogChatTiming", diff --git a/Source/Chatbook/PromptGenerators/VectorDatabases.wl b/Source/Chatbook/PromptGenerators/VectorDatabases.wl index 1741cfba..0c01d9cf 100644 --- a/Source/Chatbook/PromptGenerators/VectorDatabases.wl +++ b/Source/Chatbook/PromptGenerators/VectorDatabases.wl @@ -65,6 +65,21 @@ $$vectorDatabase = HoldPattern[ _VectorDatabaseObject? System`Private`ValidQ ]; $vectorDBSearchCache = <| |>; $embeddingCache = <| |>; +(* ::**************************************************************************************************************:: *) +(* ::Section::Closed:: *) +(*InstallVectorDatabases*) +InstallVectorDatabases // beginDefinition; + +InstallVectorDatabases[ ] := catchMine @ Enclose[ + Success[ + "VectorDatabasesInstalled", + <| "Location" -> ConfirmBy[ getVectorDBDirectory[ ], vectorDBDirectoryQ, "Location" ] |> + ], + throwInternalFailure +]; + +InstallVectorDatabases // endExportedDefinition; + (* ::**************************************************************************************************************:: *) (* ::Section::Closed:: *) (*Vector Database Utilities*)