|
@@ -55,6 +55,8 @@
|
|
|
:search/graph-filters []
|
|
:search/graph-filters []
|
|
|
:search/engines {}
|
|
:search/engines {}
|
|
|
|
|
|
|
|
|
|
+ :ai/text-encoders {}
|
|
|
|
|
+
|
|
|
;; modals
|
|
;; modals
|
|
|
:modal/dropdowns {}
|
|
:modal/dropdowns {}
|
|
|
:modal/id nil
|
|
:modal/id nil
|
|
@@ -1542,7 +1544,11 @@ Similar to re-frame subscriptions"
|
|
|
|
|
|
|
|
;; search engines state for results
|
|
;; search engines state for results
|
|
|
(when (= type :search)
|
|
(when (= type :search)
|
|
|
- (set-state! [:search/engines (str pid name)] service)))))))
|
|
|
|
|
|
|
+ (set-state! [:search/engines (str pid name)] service))
|
|
|
|
|
+
|
|
|
|
|
+ ;; text encoders for calling
|
|
|
|
|
+ (when (= type :text-encoder)
|
|
|
|
|
+ (set-state! [:ai/text-encoders (str pid name)] service)))))))
|
|
|
|
|
|
|
|
(defn uninstall-plugin-service
|
|
(defn uninstall-plugin-service
|
|
|
[pid type-or-all]
|
|
[pid type-or-all]
|
|
@@ -1575,11 +1581,24 @@ Similar to re-frame subscriptions"
|
|
|
(f %) %)))))
|
|
(f %) %)))))
|
|
|
|
|
|
|
|
(defn reset-plugin-search-engines
|
|
(defn reset-plugin-search-engines
|
|
|
|
|
+ "Clears all search engine results.
|
|
|
|
|
+ Search engine results are stored in the :result of state under :search/engines.
|
|
|
|
|
+ Then subscribed by the search modal to display results."
|
|
|
[]
|
|
[]
|
|
|
(when-let [engines (get-all-plugin-search-engines)]
|
|
(when-let [engines (get-all-plugin-search-engines)]
|
|
|
(set-state! :search/engines
|
|
(set-state! :search/engines
|
|
|
(update-vals engines #(assoc % :result nil)))))
|
|
(update-vals engines #(assoc % :result nil)))))
|
|
|
|
|
|
|
|
|
|
+(defn get-all-plugin-text-encoders
|
|
|
|
|
+ []
|
|
|
|
|
+ (:ai/text-encoders @state))
|
|
|
|
|
+
|
|
|
|
|
+(defn reset-plugin-text-encoder
|
|
|
|
|
+ []
|
|
|
|
|
+ (when-let [encoders (get-all-plugin-text-encoders)]
|
|
|
|
|
+ (set-state! :ai/text-encoders
|
|
|
|
|
+ (update-vals encoders #(assoc % :result nil)))))
|
|
|
|
|
+
|
|
|
(defn install-plugin-hook
|
|
(defn install-plugin-hook
|
|
|
([pid hook] (install-plugin-hook pid hook true))
|
|
([pid hook] (install-plugin-hook pid hook true))
|
|
|
([pid hook opts]
|
|
([pid hook opts]
|