Skip to content

Commit

Permalink
Merge pull request #972 from WolframResearch/feature/InstallVectorDat…
Browse files Browse the repository at this point in the history
…abases

Added `InstallVectorDatabases` as exported symbol
  • Loading branch information
rhennigan authored Dec 6, 2024
2 parents fce190d + b0b2f4f commit 87764c2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion PacletInfo.wl
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 2 additions & 0 deletions Source/Chatbook/Main.wl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ BeginPackage[ "Wolfram`Chatbook`" ];
`GetExpressionURIs;
`GetFocusedNotebook;
`InlineTemplateBoxes;
`InstallVectorDatabases;
`InvalidateServiceCache;
`ListSavedChats;
`LoadChat;
Expand Down Expand Up @@ -232,6 +233,7 @@ $ChatbookProtectedNames = "Wolfram`Chatbook`" <> # & /@ {
"GetExpressionURIs",
"GetFocusedNotebook",
"InlineTemplateBoxes",
"InstallVectorDatabases",
"ListSavedChats",
"LoadChat",
"LogChatTiming",
Expand Down
15 changes: 15 additions & 0 deletions Source/Chatbook/PromptGenerators/VectorDatabases.wl
Original file line number Diff line number Diff line change
Expand Up @@ -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*)
Expand Down

0 comments on commit 87764c2

Please sign in to comment.