Skip to content

Commit

Permalink
don't log using pprint
Browse files Browse the repository at this point in the history
  • Loading branch information
sid597 committed Feb 23, 2024
1 parent 490ca7b commit a168c17
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
12 changes: 6 additions & 6 deletions src/main/ui/actions/chat.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
:content (str (extract-from-code-block msg-str))})))))

(p (str pre "Calling openai api, with settings :"))
(pp settings)
;(pp settings)
(p (str pre "and messages :"))
(pp @message-by-role)
;(pp @message-by-role)
(p (str pre "Counting tokens for message:"))
(count-tokens-api {:message @message-by-role
:model (:model settings)
Expand All @@ -41,7 +41,7 @@
:callback (fn [response]
(println "received response from llm")
(p (str pre "openai api response received:"))
(pp response)
;(pp response)
(let [res-str (-> response
:body)]
(create-new-block m-uid "last" (str "Assistant: " res-str) (js/setTimeout
Expand Down Expand Up @@ -74,7 +74,7 @@
c-uid (:uid chat)
count (count children)]
(p (str pre "for these: "))
(pp children)
;(pp children)
(go
(doseq [child children]
^{:key child}
Expand All @@ -96,7 +96,7 @@
(clojure.string/join "\n -----" (data-for-pages res get-linked-refs?))
"```")]
(p (str pre "extracted data from query pages:"))
(pp page-data)
;(pp page-data)
(create-new-block
m-uid
order
Expand All @@ -117,7 +117,7 @@
get-linked-refs?))
"```")]
(p (str pre "extracted data for the page:"))
(pp page-data)
;(pp page-data)
(create-new-block
m-uid
order
Expand Down
8 changes: 4 additions & 4 deletions src/main/ui/actions/graph_overview_ai.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@
chat-block-uid
true
(do
(p (str pre "Created a new chat block and opening in sidebar with context: "))
(pp context-structure)))
(p (str pre "Created a new chat block and opening in sidebar with context: "))))
;(pp context-structure)))
(create-struct
(chat-ui-with-context-struct chat-block-uid context-block-uid context-structure)
(get-todays-uid)
chat-block-uid
true
(do
(p (str pre "Created a new chat block under `AI chats` block and opening in sidebar with context: "))
(pp context-structure))))))
(p (str pre "Created a new chat block under `AI chats` block and opening in sidebar with context: ")))))))
;(pp context-structure))))))
10 changes: 5 additions & 5 deletions src/main/ui/components/bottom_bar.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{:s ""}]
ai-block? (ai-block-exists? open-page-uid)]
(p (str pre "block with `AI chats` exist? " ai-block?))
(pp context)
;(pp context)

;(println "open page uid" open-page-uid)
;(println "page title" page-title)
Expand All @@ -57,16 +57,16 @@
chat-block-uid
true
(do
(p (str pre "Created a new chat block and opening in sidebar with context: "))
(pp context)))
(p (str pre "Created a new chat block and opening in sidebar with context: "))))
;(pp context)))
(create-struct
(chat-ui-with-context-struct chat-block-uid nil context-struct)
open-page-uid
chat-block-uid
true
(do
(p (str pre "Created a new chat block under `AI chats` block and opening in sidebar with context: "))
(pp context)))))))}
(p (str pre "Created a new chat block under `AI chats` block and opening in sidebar with context: "))))))))}
;(pp context)))))))}
"Chat with this page"]]
[:> Divider]
[:div
Expand Down
6 changes: 3 additions & 3 deletions src/main/ui/components/quick_buttons.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@
(<p! (js/Promise.
(fn [_]
(p (str pre "Calling openai api, with settings :"))
(pp settings)
;(pp settings)
(p (str pre "and messages :"))
(pp messages)
;(pp messages)
(p (str pre "Now sending message and wait for response ....."))
(call-openai-api
{:messages messages
:settings settings
:callback (fn [response]
(p (str pre "openai api response received:"))
(pp response)
;(pp response)
(let [res-str (-> response
:body)]
(update-block-string
Expand Down
2 changes: 1 addition & 1 deletion src/main/ui/utils.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@
t? (:t struct)
res (atom [top-parent])]
(p pre)
(pp struct)
;(pp struct)
(p (str pre "open in sidebar?") open-in-sidebar?)
(go
(while (not-empty @stack)
Expand Down

0 comments on commit a168c17

Please sign in to comment.