File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ - Fix prePrompt hook.
6+
57## 0.70.0
68
79- Add hooks support. #43
Original file line number Diff line number Diff line change 945945 seq
946946 (f.prompt/contexts-str repo-map*))]
947947 [{:type :text :text contexts-str}])
948- user-messages [{:role " user" :content (concat [{:type :text :text message}]
949- expanded-prompt-contexts
950- image-contents)}]
948+ user-messages [{:role " user" :content (vec ( concat [{:type :text :text message}]
949+ expanded-prompt-contexts
950+ image-contents) )}]
951951 chat-ctx {:chat-id chat-id
952952 :message message
953953 :contexts contexts
967967 :prompt message}
968968 {:on-before-action (partial notify-before-hook-action! chat-ctx)
969969 :on-after-action (fn [result]
970- (when (= 0 (:status result))
971- (reset! hook-outputs* (:outputs result)))
970+ (when (and (= 0 (:status result))
971+ (:output result))
972+ (swap! hook-outputs* conj (:output result)))
972973 (notify-after-hook-action! chat-ctx result))}
973974 db
974975 config)
975976 user-messages (if (seq @hook-outputs*)
976- (update-in user-messages [0 :content 0 :text ] str " " (string/join " \n " @hook-outputs*))
977+ (update-in user-messages [0 :content 0 :text ] #( str % " " (string/join " \n " @hook-outputs*) ))
977978 user-messages)]
978979 (swap! db* assoc-in [:chats chat-id :status ] :running )
979980 (send-content! chat-ctx :user {:type :text
You can’t perform that action at this time.
0 commit comments